How to access scene definition in template/script/automation

Hi folks,

I was wondering if there is any chance to access the to be-state of an entity from a scene via template to be used in an automation or a script.

Background: Let’s say I have a scene dusk that defines the position of window covers to give some privacy when it starts to become darker outside. In my current set-up, this scene is activated by an outdoor light sensor. Now imagine that I already manually closed one of the covers completely. The activation of the scene would open the cover “again”. Hence, I’d like to write a template the only updates the state of the cover in case the current position is higher than the one defined in the scene. You could say a “activate scene but only move the covers down, never up” kind of script.

Thanks,
Rags

You can’t use templates in a scene nor can you use decision statements like choose and (the recently introduced) if-then-else. Therefore your dusk scene can’t make decisions about setting the cover based on the cover’s current position.

However, all of that is possible in a script. It can employ if to check the cover’s current position and decide if it should move the cover or not.