Ecobee State (Heating/Cooling) Not Changing

I’m trying to set-up AppDaemon to swap my Ecobee’s heating and cooling states. I can’t get away with just using YAML. The whole process is complex; factoring in things like different sensors and different times of day and averaging results. All that is working great, but as soon as it gets to doing the actual state change, the Ecobee seems to be ignoring my efforts. I dicked around with set_state for a while before figuring out that this is just a changing it in HA, and not telling the Ecobee to change. This is confusing since get_state() tells me the state of an entity, I assumed set_state() would change the state of an entity.

I think I’m supposed to use call_service(). From the HA Developer Tools page I can change the mode with this:

{
  "entity_id": "climate.home",
  "operation_mode": "heat"
}

So I tried to make that conform to the docs on call_service():

self.call_service(entity_id='climate.home', operation_mode='heat')

But this isn’t doing anything either.

Ah wait, I finally figured it out. For anyone else that gets stumped by this, the trick is to split up the call target with a /. So in HA’s Dev Tools it looks like:

Service:
  climate.set_operation_mode
Entity:
  climate.home

So the correct way to call_service is by splitting the climate.set_operation_mode as climate/set_operation_mode. I got it working with this:

self.call_service('climate/set_operation_mode', entity_id='climate.home', operation_mode='heat')

correct. thats also exactly as it is described in the docs :wink: