i have a question because my automation which loops through a group fails.
I create a script that checks the current position of a roller shutter and set the new position only if current position > new position
Then i create a single automation with a cover entity and a position entity and it works. My script is:
I think the reason might be that you pass the current cover into the script declared as: entity rather than: cover_entity like your script’s field variable expects.
So i think it should look like this: cover_entity: "{{repeat.item}}"
If that isn’t the cause then maybe you could provide some trace logs.
Isn’t the target only used for script.turn_on to reference the target script?
As stated in the docs: “The other way is calling the script as a service directly. In this case, all service data will be made available as variables”
If the Script is called as a service directly, only the service data should be published, right?
In my case, I forgot to add the entity_id before “{{repeat.item}}”
So with the variable called cover_entity, I believe you’d need to change the target to service data:
You’re right… apparently while I was looking over the automation I forgot about the script
@JC00P3R You probably want to move the value comparison to a condition instead of having a template with if but no else. It doesn’t always cause problems, but there have been other threads where user report issues with similar setups.
thx for your help. the solution was the condition in my script and the data names of my script in my loop. now it works like a charm and i’m a bit further on my detach from node-red