Im working on an automatiion to turn on lights when TV is on AND sun is below elevation, but somehow my conditions does not work. What am I doing wrong?
As you describe it, you haven’t got a trigger at all - you want the lights to come on if the TV is on and if the sun’s elevation is below 5 - both conditions - but there is no event to kick the process off.
Is this a good idea?
How about a template binary sensor - “on” if the TV was on and the sun’s evelation was below 5, otherwise “off”? It’s state would be evaluated every time either one changed and would provide a simple state (not device_id) trigger for the automation.
Your condition is just checking the trigger IDs. Since you have both listed, then it’s not doing anything. I would change the conditions to be an AND with both trigger conditions being met.
Why not?
I did something similar for automatic curtains, the sun’s azimuth and temperature inside.
Not saying this is the best/ideal way and I’m always open for learning something new.
Are you refering to the trigger in conditions? Why shouldn’t they trigger as they are refering to the initial triggers which Ihave verified is working.
My problem is that conditions are not doing its job…
I don’t think it will because the automation will not get triggered when you switch on the TV AFTER the sun has gone below 5° + you are learning something wrong: you don’t have to AND conditions since they are AND by default.
Trigger ID’s are meant to use together with actions when you have multiple triggers in the same automation, for instance a motion detected light where you use the detection from the sensor switching on or off.
I’m sure it works, it’s just that I ran a short test this morning and the automation would have been triggered about 100 times in the space of a few hours:
Must be consuming resources, surely? Not to mention wear and tear on the SD card. Continuous evaluation of a state is what templates are for, aren’t they? Or maybe in this case, a threshold helper.
You’re right, that seems to be a better solution.
I watched the release party but I couldn’t see how to use it - until now!
What would then be the trigger in this case if you put TV and SUN in the sensor
I was wrong.
I wonder though if, by putting both as a trigger and condition is ‘the best’ solution.
All good, just wanted to make sure I didn’t miss something.
I suppose it’s 6 in one hand and a half dozen in the other. The one benefit of my proposal, is that it’s configurable from the UI if someone isn’t comfortable diving into templating.