I have created an automation that I want to trigger with a helper button: input_button.office_light_flash
I can run the automation and it works, but when I press the button it does not trigger. What am I missing?
alias: Flash Office Lights
description: Flash Office Lights
triggers:
- entity_id: input_button.office_light_flash
from: "off"
to: pressed
trigger: state
conditions: []
actions:
- variables:
original_brightness: "{{ state_attr('light.floor_lamp', 'brightness') | default(0) }}"
target_state: |
{% if original_brightness <= 128 %}
255
{% else %}
64
{% endif %}
- repeat:
count: 3
sequence:
- choose:
- conditions:
- condition: template
value_template: "{{ original_brightness == 0 }}"
sequence:
- target:
entity_id: light.floor_lamp
action: light.turn_off
data: {}
- conditions:
- condition: template
value_template: "{{ original_brightness > 0 }}"
sequence:
- target:
entity_id: light.floor_lamp
data:
brightness: "{{ target_state | int }}"
action: light.turn_on
- delay: "00:00:00.5"
- choose:
- conditions:
- condition: template
value_template: "{{ original_brightness == 0 }}"
sequence:
- target:
entity_id: light.floor_lamp
action: light.turn_off
data: {}
- conditions:
- condition: template
value_template: "{{ original_brightness > 0 }}"
sequence:
- target:
entity_id: light.floor_lamp
data:
brightness: "{{ original_brightness | int }}"
action: light.turn_on
- delay: "00:00:00.5"
- target:
entity_id: input_button.sam_office_light_flash
action: input_button.press
data: {}
mode: single