I am using the excellent Hue Sensor component from @robmarkcole to have my Hue Dimmer remote pull double-duty. It directly controls a couple Hue bulbs through the Hue hub, AND I am able to react to the button presses in Home Assistant (I did a write-up on how I’m using it here). In theory, this setup is beautiful.
However, I’ve discovered a flaw in this setup for my use case. Because the value of the sensor for the remote is always the last value, you’re not actually able to truly detect button presses – you only can react if the current button press was different from the last press (because otherwise the sensor state doesn’t change).
In my case, I use the dimmer remote to turn off my bedroom lamps, which also deactivates an input_boolean that turns off a motion sensor. However, since the lights come on automatically (not using the remote), I pretty much only ever press the Off button. Which means the sensor state for the remote doesn’t change, which means my automation doesn’t get triggered:
- alias: Disable bedroom motion lights when lamps off
trigger:
- platform: state
entity_id: sensor.hue_dimmer_1
to: '4_click'
condition:
condition: or
conditions:
- condition: state
entity_id: input_select.mode
state: 'Evening'
- condition: state
entity_id: input_select.mode
state: 'Morning'
- condition: state
entity_id: input_select.mode
state: 'Night'
action:
- service: homeassistant.turn_off
entity_id: input_boolean.bedroom_motion_lights
I’ve looked into manually setting the sensor for the dimmer to some 0 value, but my research in other threads has indicated sensors are read-only.
Does anyone have any ideas on how I can detect button presses from this remote even if the press is the same as the last time?