I have a water pump on a smart switch. I want the switch to turn on in either of the following two situations:
A. Automated turn-on requires all three conditions to be true:
1. Water Pump Schedule helper is ON AND
2. input_boolean switch for Automating the Water Pump is ON AND
3. binary_sensor for monitoring the temperature of the water that is being pumped is ON (because the temp of the water is lower than my set water temp)
OR
B. Manual turn-on requires that the user has clicked a UI button tied to an input_boolean to manually turn on the water pump.
For some reason that I can’t figure out, my template is only listening for state changes tied to the schedule and the input_boolean for manual turn-on. Why isn’t the template listening for state changes to the binary_sensor or the input_boolean that’s tied to running the automation?
Well first, someone will be along shortly to say please post the actual code and not screenshots, because they are much harder to work with.
And second - from what I can see that template is doing exactly what it should be.
BUT - you haven’t shown us the output of input_boolean.casita_manual_hot_water_on only the schedule state and the binary sensor.
From looking at the screenshots - I can see the hot water schedule is off, so your first set of and conditions will be false, I’d hazard a guess that the manual hot water boolean is off too, hence the false state.
I’d also additionally recommend that if you creating NEW template sensors, you follow the steps to create them in the new (not really new more than a year old now) way, and not the old way of using - platform: template
Sorry, you were so fast to look at my question that when I realized that I hadn’t uploaded my code about 2 minutes after I had posted it you had already loaded my question.
But, I’m afraid you misunderstood my question, and it’s likely that the screenshots do a much better job of demonstrating my problem than my code . . .
Yes, the output of the template is correct. The problem is that the template is only looking for state changes for two of my four entities. As you can see on the bottom right of the first screenshot, the template isn’t tracking changes for two of my four entities.
I’ve just tried your solution, and it is an improvement: now the template is tracking state changes for all of the entities in the AND block, but it isn’t tracking state changes to
@mobile.andrew.jones . Ahhh. I get it now. I misunderstood the purpose for the list of listeners on the Developer Tools Template page. I thought that the list was suppose to contain all of the entities that are being used in the template. Now I understand that the list only includes those entities that, if changed could change the value of the template.
You were right that that my template was doing exactly what it should be, although your solution is more sophisticated.