Hi, trying to get HA to do something different based upon who pushes a button in the UI
made a button helper input_button.naar_bed and had a condition, that now should trigger if anyone BUT the sys presses the button. But it fails…
id: '1666207961471'
alias: Naar Bed
description: Per gebruiker
trigger:
- id: button
platform: state
entity_id: input_button.naar_bed
condition:
- condition: template
value_template: |
{{ trigger.event.data.new_state.state.context.user_id != 'null' }}
action:
- service: light.toggle
data: {}
target:
entity_id: light.primelamp
mode: single
@Sandmman a state trigger does not generate trigger.event. See Automation Trigger Variables - Home Assistant for the value of the trigger variable after a state trigger fires. Also note that in YAML null is a valid value (which is equivalent to Python’s None), which is different from ‘null’ (which is a string.)