Hi,
I’d like to get your opinions on the approach I use for stepping through permutations of light states with a Philips Hue Dimmer, and if there is a better way of achieving this.
In my living room, I have a small lamp, a big lamp, and a ceiling light (mix of LIFX and Tradfri). Starting at zero, every press of the ‘On’ button on the remote moves the lights to the next state/configuration:
- All lights off
- Small lamp on
- Large lamp on
- Small & large lamp on
- Small, large, and ceiling light on
The ‘Off’ button moves through the states in reverse.
I have achieved this with five scenes named ‘Living_Room_0’ to ‘Living_Room_4’ and an input_number helper to track the current scene number. The ‘On’ and ‘Off’ buttons on the remote control increment and decrement the input_number and another automation switches scene whenever the input_number changes.
Is there a better way to achieve this? My previous attempt didn’t use scenes or numbering, and had multiple automations with a series of conditions to check which lights were on and therefore which should be turned on/off when a button was pressed. This was cumbersome and didn’t lend itself to maintenance when bulbs were added or changed.
One problem I have with the current setup is when lights are turned on and off without the remote - the input_number doesn’t then correspond with the actual state of the lights. So the number could be ‘4’ (all lights on) while all light are actually off - this results in confusion when pressing the ‘On’ button as ‘4’ is the max and so no scenes are called and the lights remain off.
I’d love to know if there are other ways of handling this. I wonder if there’s a way to equate the current light states with a scene.