Files
NFC-University-Gate-Access-…/automations.yaml
2026-02-20 04:57:47 +01:00

36 lines
5.6 KiB
YAML

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