Hi everyone. Im really stumped by this odd behaviour from HA automations. I have a hue dimmer remote(i have others as well and the same problem happens) which i want to control the living room lights with. Usually the remote works as configured. But sometimes randomly, it seems to not work as if it ignores a button press and might work on the next try or two.
Im using choose to capture the triggers. I have a yaml below of the automation which i can use to reproduce locally.
alias: Ground Remote
description: ""
trigger:
- platform: state
entity_id:
- sensor.dimmer_living_room_action
to:
- on_press
- off_press
- on_hold
condition: []
action:
- choose:
- conditions:
- condition: state
entity_id: sensor.dimmer_living_room_action
state: on_press
sequence:
- service: light.turn_on
data:
brightness_pct: 100
target:
entity_id:
- light.g_sofa_lamp
- light.g_vertical_lamp
- conditions:
- condition: state
entity_id: sensor.dimmer_living_room_action
state: off_press
sequence:
- service: light.turn_off
data: {}
target:
entity_id:
- light.g_sofa_lamp
- light.g_vertical_lamp
- conditions:
- condition: state
entity_id: sensor.dimmer_living_room_action
state: on_hold
sequence:
- service: light.turn_on
data:
brightness_step_pct: 20
target:
entity_id:
- light.g_sofa_lamp
- light.g_vertical_lamp
default:
- service: system_log.write
data:
level: error
message: >-
Inoperable Automation state. The new state: {{trigger.to_state.state}}
mode: queued
Now what I expect when im testing with triggers on_press
and off_press
, I should fall in the respective choose condition. But it will fall in the default. and the log message will still have the expected new state.
Do you see anything im doing wrong? Any suggestions to where to log to debug further?
Here is the log output of a ignored button press:
Inoperable Automation state. The new state: off_press
Here you can see the trace where the state is off_press
but it does not fall in the 2nd condition but goes to default as if the condition does not match somehow.