Automating ecobee to turn off when door open not working (problem with integration?)

I think there might be an issue with the Ecobee integration. I’m trying to set my ecobee to “off” if the door is opened while the HVAC mode is set to “cool” but it’s not working.

I’ve managed to get the automation to trigger using the following YAML (I’m using the GUI actually):

device_id: 1ff0afc7f8f14f7383374355d55028fd
domain: binary_sensor
entity_id: binary_sensor.front_door
for:
  hours: 0
  minutes: 0
  seconds: 0
platform: device
type: opened

the above works totally normally. However, when I add a condition:

condition: device
device_id: 776384b56a7140a28b94d11d15bcec9a
domain: climate
entity_id: climate.home
hvac_mode: cool
type: is_hvac_mode

the automation never fires. I’ve also tried using the “state” type as well:

condition: state
entity_id: climate.home
state: cool

and it STILL doesn’t fire. Though when I try a different device or state (a light for example) everything works as expected.

Is there an issue with the ecobee integration that I don’t know about or perhaps I should be using something other than “cool” for the state (even though that’s what is displayed in the states tool)?

Hey jjross,

would you mind going to Developer Tools -> Template and entering:

{{ states('climate.home') }}

This should display “cool”
Then, enter:

{{ is_state('climate.home', 'cool') }}

This should display “True”

Thanks for the reply. I tested both and they returned as expected (cool and true).

It’s so odd! :slight_smile:

Hm, let’s check the trigger to make sure…

Please create a new automation and disable the old one.

In the UI, set the trigger to:

Trigger: State
entity:binary_sensor.front_door
to: open

Use a state condition:
entity_id: climate.home
state: cool

Use whatever action you’ve decided upon.

If this still doesn’t work, change the condition to:
Type: Template
template: {{ is_state('climate.home', 'cool') }}

OK, I just tested the state mode again and this time it worked! No idea why it wasn’t before…

The device mode still doesn’t seem to work (which sucks) but at least I should be able to get by with the state…

Is there a way to diagnose why the device isn’t working?

1 Like

Hm, I have a ton of things in Home Assistant, however I don’t use the “device” stuff, the services and states just work a lot better for me, especially when you switch things around :slight_smile:

I hear you and I don’t mind using the “state” though I wish I could determine whether this is a bug or not and then makes the devs aware. Is there a way to see the state of a device?

I guess via Configuration -> Devices? :thinking:

I don’t really see anything in there…but maybe I’m missing something. I was hoping for something like “Developer Tools–>States”

Thank you both for this. For any other noobs having Ecobee and HA issues, here’s my YAML code for the automation. I set a group for all my door sensors. Tested and working! Obviously remember to change the timing. I left it short so you can test it faster!

alias: AC Door Trigger
description: >-
  Turn off AC when doors are open. Turn back on AC when doors have been closed
  for 5 minutes.
trigger:
  - platform: state
    entity_id: binary_sensor.door_sensors
    to: 'on'
    for:
      hours: 0
      minutes: 0
      seconds: 1
condition:
  - condition: state
    entity_id: climate.ecobee_thermostat
    state: cool
action:
  - service: climate.turn_off
    data: {}
    target:
      entity_id: climate.ecobee_thermostat
  - wait_for_trigger:
      - platform: state
        entity_id: binary_sensor.door_sensors
        to: 'off'
        for:
          hours: 0
          minutes: 0
          seconds: 5
    continue_on_timeout: true
  - service: ecobee.resume_program
    data:
      entity_id: climate.thermostat
mode: restart
1 Like