scene.HueRoomA_SceneNameA
scene.HueRoomA_SceneNameB
scene.HueRoomA_SceneNameC
scene.HueRoomA_SceneNameD
etc.
I would like to know in an automation which of the scenes from scene.RoomA_* was triggered last in order to trigger it again.
Does anyone have an idea how I can do this?
Perhaps via a template helper which I can use to trigger the last scene?
PS: I don’t want to list the scenes in the script, as these come from Philips Hue and some may be added or removed. What I can make sure of, however, is that the scenes always start with the same prefix.
Modify the HueRoomA_SceneName string to meet your specific needs. Let me know if you need additional assistance to customize the template. For example the next step would be to determine which scene’s state contains the latest datetime value.
Ok I’ve only been using Home Assistant for 2 months
I’m still not quite sure where to insert your script into the automation. I tried it once in a helper, but nothing happens except that the script is not reported as faulty.
Can you tell me where I have to insert the script? And what do I see then?
Yes, I would like to reactivate the last scene used in a room. So Turn_on.
For example, a wait template that does the following.
Filter scenes that start with “HueRoomA_SceneName”.
Filter the last used scene.
Activate the last used scene.
Background information:
I control my Philips Hue lamps with relays.
So they are dead when not in use.
Ceiling light, bedside tables, TV lamp, etc.
Now, for example, the ceiling light is switched on.
A scene is changed by a person.
Now the light on the bedside table is switched on.
Now I would like to trigger the last scene that was used again via automation so that the lights also receive the same scene.
As they were without power and did not know which scene was used.
What you want to do is accomplished with scene.turn_on. I don’t see a need for a wait_template, which is part of an automation’s actions, not its triggers. Unless you planned to trigger on one activity and then wait for another activity to occur. Is that what you want to do?
What were you planning to use for the automation’s trigger(s)?
I’m glad to hear that you now understand that in order to activate a scene you must use the scene.turn_on service call.
Please consider marking my post above with the Solution tag. It will automatically place a checkmark next to the topic’s title which indicates that this topic is solved. This helps other users find answers to similar questions.