Update automations.yaml
This commit is contained in:
@@ -1,36 +1,57 @@
|
|||||||
alias: "Terminal Bramy - Obsługa"
|
alias: "Terminal Bramy - Obsługa"
|
||||||
|
description: "Weryfikacja tagów i sterowanie diodami oraz ekranem"
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: tag_scanned
|
event_type: tag_scanned
|
||||||
|
|
||||||
action:
|
action:
|
||||||
- variables:
|
- variables:
|
||||||
v_nazwa: "{{ trigger.event.data.name }}"
|
v_nazwa: "{{ trigger.event.data.name }}"
|
||||||
|
|
||||||
- choose:
|
- choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ v_nazwa is not none and 'Legitymacja' in v_nazwa }}"
|
value_template: "{{ v_nazwa is not none and 'Legitymacja' in v_nazwa }}"
|
||||||
sequence:
|
sequence:
|
||||||
- action: input_text.set_value
|
- action: input_text.set_value
|
||||||
target: { entity_id: **input_text.terminal_status** }
|
target:
|
||||||
data: { value: "{{ v_nazwa | replace('Legitymacja ', '') | trim }}" }
|
entity_id: input_text.terminal_status
|
||||||
|
data:
|
||||||
|
value: "{{ v_nazwa | replace('Legitymacja ', '') | trim }}"
|
||||||
|
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target: { entity_id: light.terminal_brama_terminal_led_zielona }
|
target:
|
||||||
|
entity_id: light.terminal_brama_terminal_led_zielona
|
||||||
|
|
||||||
- action: switch.turn_on
|
- action: switch.turn_on
|
||||||
target: { entity_id: switch.terminal_brama_przekaznik_bramy }
|
target:
|
||||||
|
entity_id: switch.terminal_brama_przekaznik_bramy
|
||||||
|
|
||||||
- delay: 3
|
- delay: 3
|
||||||
|
|
||||||
- action: light.turn_off
|
- action: light.turn_off
|
||||||
target: { entity_id: light.terminal_brama_terminal_led_zielona }
|
target:
|
||||||
|
entity_id: light.terminal_brama_terminal_led_zielona
|
||||||
|
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ v_nazwa is none or 'Legitymacja' not in v_nazwa }}"
|
value_template: "{{ v_nazwa is none or 'Legitymacja' not in v_nazwa }}"
|
||||||
sequence:
|
sequence:
|
||||||
- action: input_text.set_value
|
- action: input_text.set_value
|
||||||
target: { entity_id: **input_text.terminal_status** }
|
target:
|
||||||
data: { value: "Brak Uprawnień" }
|
entity_id: input_text.terminal_status
|
||||||
- action: light.turn_on
|
data:
|
||||||
target: { entity_id: light.terminal_brama_terminal_led_czerwona }
|
value: "Brak Uprawnień"
|
||||||
- delay: 3
|
|
||||||
- action: light.turn_off
|
|
||||||
target: { entity_id: light.terminal_brama_terminal_led_czerwona }
|
|
||||||
mode: restart
|
|
||||||
|
|
||||||
|
- 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