Need some help figuring out why this automation doesn’t work. Pulling my hair out

Here is my automation file

I currently have my Honeywell home security system connected via Envisalink 3 and my Ecobee Thermostat. What I want is when a first floor window or deck door is open for more than 5 minutes and the heat/cooling is on, I want it to turn the Ecobee to Off and announce via Alexa what it did and why.

The automation above works fine with ANY listed sensor until I add the for: and minutes/seconds (currently set to 15 seconds for testing). Once I add the time to the trigger, the only item I have found so far that will actually trigger it is the living room left window. The others don’t set it off.

Can anybody see something wrong? Other than going to a trigger for each binary sensor I’m not sure what else to do.

Try creating a group that contains the sensors and use that instead of the list.

Thanks, I will give it a shot. That popped in my head last night after I posted it but I liked being able to announce why the Ecobee was turned off and it seems there’s no way to get what caused the group to flip to use in an announcement. However having it work is better than it not working :stuck_out_tongue:

I have one like this working with
for: 00:00:15
instead of seconds: 15

So now I’m really confused. My wife said the back door triggered the automation earlier today. Looking at the logs you can see where it happened.

When I got home I tried to replicate it… and it never triggered.

Then later I tried it again and it triggered.

I am so confused with the inconsistency. I’m at a loss.

I would try to make it simpler for a start.

  • Add all the entities into a group.
  • just focus on one condition ‘heat’
    once that is stable enhance it again.

other ideas:

  • does the status of your door/window always come from “off” to “on” or could it come from “unknown” to “on”?
  • maybe you could change the condition to NOT OFF

I have a simple automation that turns my exhaust fan on when there is motion for 3 minutes and it is NOT night.

Thanks for the ideas. I haven’t seen the status ever not Off or On. I have added them all to a group for testing purposes and simplified the conditions. I will see how this works.

- id: '1549214578776'
  alias: Turn off HVAC
  trigger:
  - platform: state
entity_id: group.hvac
from: 'off'
to: 'on'
for:
  seconds: 15
  condition:
conditions:
  - condition: state
    entity_id: 'climate.home'
    state: 'heat'
  action:
  - data_template:
  entity_id: media_player.Living_Room
  message: 'Turning off thermostat because first floor is open'
service: media_player.alexa_tts
  - service: climate.set_operation_mode
data:
  entity_id: climate.home
  operation_mode: 'off'

First test is promising. Set it to 5 minutes and will see what happens. The next thing I would like to figure out is storing the state so that when the first floor is closed up it returns to cool or heat, whatever it was before it was disabled. I’m not sure if doing it through YAML is the way to go or if NODERED or something would be better

33%20PM