Update Honeywell thermostat component to new API

Hi everyone,

looking into a way to set the “mode” for a Honeywell Evohome thermostat with 4 zones, I noticed that the underlying evohomeclient 0.2.5 library implements two distinct API versions, v1 and v2.

The current Honeywell component uses the old v1, that has less functionalities and in my understanding can be deprecated anytime. The new API v2 is already implemented in the library, but not used by the component.

I’m not a Python developer, but if anyone is willing to take the task of updating the library I’ll do my best to test and debug. The needed task are:

  • Update the current functionalities with the same function calls in v2 (minor differences). This should also make it more robust, as it uses newer web services from Honeywell.

  • Implement the “set system mode change” functionality from the library (a single function call, can it be integrated in the honeywell Climate component or should it be in a new Switch component? )

  • Implement a way to read the system mode (maybe @dansarginson already did it in https://github.com/home-assistant/home-assistant/pull/8756 ?)

  • remove the “away mode workaround” used in the component because the v1 api did not expose the real thermostat system mode

The library documentation is available at http://evohome-client.readthedocs.io/en/latest/api2/index.html

Thanks in advance,

Nicholas

I did some homeworks, got some result and came to the end of my capabilities.

Done, I have changed all the references in the honeywell component from the evohomeclient API v1 to v2. The temperature read and set are working correctly.

Done, I also changed the “faked” away mode to the real away mode of the thermostat. Disabling “away” set the system to its “normal” mode.

I had to temporarily comment the change from Dan, as the Device object in v2 is different from v1, and I didn’t find an equivalent property to read.
AFAIK the value is returned by the webservice, maybe for this an update of the evohomeclient library is needed.

{
  "locationId": "17449",
  "gateways": [
    {
      "gatewayId": "10853",
      "temperatureControlSystems": [
        {
          "systemId": "31896",
          "zones": [
            {
              "zoneId": "31895",
              "temperatureStatus": {
                "temperature": 23.5,
                "isAvailable": true
              },
              "activeFaults": [],
              "setpointStatus": {
                "targetHeatTemperature": 18.0000,
                "setpointMode": "FollowSchedule"
              },
              "name": "Living room"
            }
          ],
          "activeFaults": [],
          "systemModeStatus": {
            "mode": "Auto",
            "isPermanent": true
          }
        }
      ],
      "activeFaults": []
    }
  ]
}

This for me is a challenge. In the library is a single function call client.set_status_xxxx(), but I’m not into HA enough to understand what could be the correct implementation of the UI.
Moreover, currently setting the Away mode is not reflected to all the zones in HA that is treating each zone as an independent thermostat. The system mode should be a unique property for the system and not for the single zone.

I shared the updated version on https://github.com/namadori/honeywell

Hey @namadori,

I’ve had a look over the evohomeclient v2 code, and I’m pretty sure that it’s a second (improved) implementation of the v1 API. If the v1 API is less stable and could be deprecated over time we need a new library that wraps the v2 API.

I’m happy to do this work when I get the chance. This would be made much faster if the person you contacted at Honeywell is able to actually give us any docs. Have you heard any more?

Cheers,

Dan

Hi Dan,

the evohome library already implements both v1 and v2 API. It was just the honeywell component still using the v1.

By the way, with this change I also got the error described in https://github.com/home-assistant/home-assistant/issues/8554 . I suspect this is related to API request throttling or Auth token not refreshed, as it begins exactly 1 hour after HA restart.

The guy that answered me from Honeywell is Joe Zwack, I found it commenting on this issue https://github.com/home-assistant/home-assistant/issues/3468 .

I know some time has passed but you found a solution for the problem of the component stop working after 1 hour?
Or a solution in general that let us use the honeywell components?
Thank you.

There is some life on my other thread. Please check out here:

Maybe we could close this thread. There is a link to an improved (albeit buggy) custom component in the other thread.