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.