think you’d need an {% else %} to cater for when sekonder is more than 71100 as your automation will fail then since you’ll try and switch on a light but won’t provide the entity id.
Or better still you need to use a service_template instead
Think the issue is you have 2 items to turn on, you need to list them with a - or you need to write 2 separate actions. The latter will be easier to ensure you have no indentation issues created by your if statements
The only problem that’s remaining is when I try to turn off several items in the same automation. So the code below is now working as expected. I have tried with - in front of each device without success.
In some of my automations I have several items with kind of long names, so putting everything coma separated in a single row would make my code very hard to read.
Any suggestions concerning that last issue would be very welcome!