Add automations.yaml
This commit is contained in:
36
automations.yaml
Normal file
36
automations.yaml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
alias: "Terminal Bramy - Obsługa"
|
||||||
|
trigger:
|
||||||
|
- platform: event
|
||||||
|
event_type: tag_scanned
|
||||||
|
action:
|
||||||
|
- variables:
|
||||||
|
v_nazwa: "{{ trigger.event.data.name }}"
|
||||||
|
- choose:
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ v_nazwa is not none and 'Legitymacja' in v_nazwa }}"
|
||||||
|
sequence:
|
||||||
|
- action: input_text.set_value
|
||||||
|
target: { entity_id: **input_text.terminal_status** }
|
||||||
|
data: { value: "{{ v_nazwa | replace('Legitymacja ', '') | trim }}" }
|
||||||
|
- action: light.turn_on
|
||||||
|
target: { entity_id: light.terminal_brama_terminal_led_zielona }
|
||||||
|
- action: switch.turn_on
|
||||||
|
target: { entity_id: switch.terminal_brama_przekaznik_bramy }
|
||||||
|
- delay: 3
|
||||||
|
- action: light.turn_off
|
||||||
|
target: { entity_id: light.terminal_brama_terminal_led_zielona }
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ v_nazwa is none or 'Legitymacja' not in v_nazwa }}"
|
||||||
|
sequence:
|
||||||
|
- action: input_text.set_value
|
||||||
|
target: { entity_id: **input_text.terminal_status** }
|
||||||
|
data: { value: "Brak Uprawnień" }
|
||||||
|
- action: light.turn_on
|
||||||
|
target: { entity_id: light.terminal_brama_terminal_led_czerwona }
|
||||||
|
- delay: 3
|
||||||
|
- action: light.turn_off
|
||||||
|
target: { entity_id: light.terminal_brama_terminal_led_czerwona }
|
||||||
|
mode: restart
|
||||||
|
|
||||||
Reference in New Issue
Block a user