ztripez
(Ztripez)
September 8, 2020, 12:47pm
1
As the title says:
After a scene triggers it would be great to be able to resume the (in my case) lights to it’s previous state.
Ex. We have a motion detector in our staircase that activates a scene at night (so you don’t trip) and set some dim lights in the kitchen and hallway.
It would be great to be able to tell HA to resume it’s previous state after a while instead of having to set up and update 2 scenes.
petro
(Petro)
September 8, 2020, 12:52pm
2
You can do this by creating scenes on the fly
The example at the bottom even shows you how to return to the previous state.
ztripez
(Ztripez)
September 8, 2020, 1:18pm
3
That’s handy but not really what I’m asking for since, the automation needs to know what entities in the scene, iow again 2 places.
I want to trigger a scene and resume, not having to specify all the entities multiple times.
petro
(Petro)
September 8, 2020, 1:31pm
4
It is what you’re asking for though. It’s not as easy as you want it to be
ztripez
(Ztripez)
September 8, 2020, 2:22pm
5
Uhm no, since your suggestion do not solve the issue, it is not, by definition, the solution.
If I was able too snapshot the entities of a scene it would be, it is not the same as have to manually specify the same entities again.
tom_l
September 8, 2020, 2:28pm
6
Resuming a scene will absolutely do that. Try it.
1 Like
petro
(Petro)
September 8, 2020, 2:42pm
7
not only that but you can easily template it…
- service: scene.create
data_template:
scene_id: before
snapshot_entities: "{{ state_attr('scene.xxx', 'entity_id') | join(', ') }}"
1 Like
ztripez
(Ztripez)
September 8, 2020, 2:43pm
8
You mean that i can do something like this:
action:
- service: scene.create
data:
scene_id: before
snapshot_entities:
- scene.downstairs_night
ztripez
(Ztripez)
September 8, 2020, 7:25pm
9
A small change and it worked
- service: scene.create
data_template:
scene_id: before
snapshot_entities: "{{ state_attr('scene.xxx', 'entity_id') | join(', ') }}"
1 Like
petro
(Petro)
September 8, 2020, 7:27pm
10
are you talking about the space you added before each field?
ztripez
(Ztripez)
September 8, 2020, 7:34pm
11
no I had to change
state_attr('scene.xxx', 'entities')
to
state_attr('scene.xxx', 'entity_id')
1 Like
petro
(Petro)
September 8, 2020, 8:08pm
12
Ah, ok. I didn’t notice that!