I’m currently using a combination of input_numbers to create automations that cycle through a list of actions upon repetitive triggering. This is quite cumbersome and hard to scale. Ideally similar as to the “Chose” option in the Action block of an Automation there should be a “Cycle” option.
Cycle would consists of
a list of actions
parameter 1: seconds of inactivity after which the next trigger will again start with the first action on the list
parameter 2: boolean to decide if after having executed the last action form the list the next trigger will start over from the top or not
How do you like the idea? Any suggestions to improve?
I assumed @Kugelfang was describing something like how you might use an automation to give multi-press-like functionality to a single-press button, but with the possibility of other triggers. Though, personally, I can’t really think of an example of when I would want a different trigger to work like a multi-press button.
I want to creat a automation that is triggered by the press of a button to cycle through some scenes in my hue setup.
Scenario
Lights are off
There are 3 known scenes A, B, C
Button press #1: Load Scene A
Button press #2: Load Scene B
Button press #3: Load Scene C
Button press #4: Load Scene A
…
(No Button Press for >10s)
Button press #5: switch off all lights
Button press #6: Load Scene A
…
I hope that makes it clearer. this is a functionality I‘m today using with iConnect Hue on my dimmer switches that I try replication using HA since i want to migrate to Zigbee2MQTT
Currently I created a monstrosity where i count a input_number by +1 everytime the button ist pressed. There is a second automation that resets the the input_number to 0 after 10s of no button pressed
Button press #1: If input_number = 0 and lights=on —> turn off all lights
Button press #1: If input_number = 0 and lights=off —> Load Scene A, input_number +1
Button press #2: If input_number = 1 and lights=on —> Load Scene B input_number +1
Button press #3: If input_number = 2 and lights=on —> Load Scene C input_number = 0
this however is super unsalable since i need to create an input_number for every automation ne also a scrips that resets the input_number after 10s of inactivity.
OH WOW, i was not aware of this, thanks for bringing this up! The only question: how do I create a select entity that holds the Scenes IDs so I can use them for the MQTT publish to call the scene?
It’s a template select. But it’s probably easier to do with a input_select and an automation that triggers off the input select changing.
You’d need 1 input select with your scene Ids
1 automation that triggers off the input_select state and publishs to MQTT
1 automation that triggers off a button press and selects the next input select state.
Or
1 input select and 1 automation that changes the input selects state and publishes to MQTT.