Rotate a sensor state (button press to state)

Hey all,

I have an idea I’m running with using a Hue Dimmer Remote (through zigbb2MQTT).

I have been able to get the dimmer buttons working so they dim the light.

The idea is to use the bottom button (off) to ‘rotate’ the state of a sensor to select a specific light or light group.

Using this new state I can then use it to have the dimmer work on the selected light:

ie
Press > changes sensor state to ‘living room’ > dimmer works on living room light
Press > changes sensor state to ‘little lamp’ > dimmer works on little lamp
Press > changes sensor state to ‘big lamp’ > dimmer works on big lamp
Press > changes sensor state to ‘living room’… etc

What would be the best way to achieve this?

Use an automation to increment a counter on each button press. Use the counter value in a template to select the required light.

You would also have to reset the counter with another automaton triggered on the maximum value (number of devices).

Sorry for the delay, life got in the way!

Thats brill, never knew about the counter but thats working awesomely to flick a test sensor between two test lights!

Just need to do the automation’s for it now :smiley:

1 Like