Refactored Honeywell evohome custom_component (EU-only)


#61

ok, so I have the following files;

in the config directory, I have
/custom_components/evohome.py
/custom_conponents/climate/evohome.py
/custom_conponents/climate/honeywell.py

configuration.yaml
logger:
logs:
custom_components.climate.evohome: debug
custom_components.evohome: debug

evohome:
username: !secret evohome_username
password: !secret evohome_password
scan_interval: 60
high_precision: true
use_heuristics: true
use_schedules: true
location_idx: 0

I’m getting the following error message, which suggests that something is missing in the the basic loading

2018-09-04 13:59:49 ERROR (MainThread) [homeassistant.components.hassio] Testing configuration at /config
Failed config
General Errors:
- Component not found: evohome
Successful config (partial)


#62

Just got the following

2018-09-04 14:28:53 ERROR (SyncWorker_17) [homeassistant.loader] Error loading custom_components.evohome. Make sure all dependencies are installed
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/loader.py”, line 94, in get_component
module = importlib.import_module(path)
File “/usr/local/lib/python3.6/importlib/init.py”, line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File “”, line 994, in _gcd_import
File “”, line 971, in _find_and_load
File “”, line 955, in _find_and_load_unlocked
File “”, line 665, in _load_unlocked
File “”, line 678, in exec_module
File “”, line 219, in _call_with_frames_removed
File “/config/custom_components/evohome.py”, line 24, in
from homeassistant.custom_components.evohome import (
ModuleNotFoundError: No module named ‘homeassistant.custom_components’
2018-09-04 14:28:53 ERROR (SyncWorker_17) [homeassistant.loader] Unable to find component evohome


#63

I’m working through pretty much the same in that I’m running HA in a Docker Container. So I added a custom_components (and climate) directory to config, copied the honeywell.py from climate (in the container) to ./config/custom_components/climate/ along with the two evohome.py files. Also edited the import path to include custom_ with the result:
" Error loading custom_components.evohome. Make sure all dependencies are installed"
The tracebook has a last line:
ImportError: cannot import name ‘HTTP_TOO_MANY_REQUESTS’
which I can see in the import list in the code. I have also seen there being a mention of additional functionality to allow for backing off if too many requests. So perhaps something else needs to be updated? const.py does have HTTP entries but not the one mentioned above…
I may need to create another VM to try HA & Evohome without Docker (although I do quite like the containerisation). Keen to get this new Evohome component working and do some testing as the existing Honeywell component is a bit limited.


#64

Yep, i’m getting the http_too_many_requests error also now.

Question: when submitting a component for inclusion in HA, does that entail it being configured for Hassio? I.e. should I just wait until that happens?


#65

Ok do you have an example of the json for setting that?


#66

@jonboy is on the money. HTTP_TOO_MANY_REQUESTS and HTTP_SERVICE_UNAVAILABLE are not in your homeassistant/const.py (but they are in mine).

I will change it back for now, so just pull the latest from github (there were a lot of changes today).


#67

I can’t see why not - if not, I’ll do the necessaries.

I am very close to submitting a PR, so all testing is great and any bug reports will be gratefully received!

I run my two in a ubuntu VM, and an LXC container - I do not have time to test more, sorry!

Actually, I think the PR is going to take a while, There are reasons for this, including a need fro architectural changes to HA that will be prompted by my component.


#68

@Isablend

I guess you have read: https://developers.home-assistant.io/docs/en/creating_component_loading.html

Have you mixed up the two evohome.py files? The larger one should be in <config>/custom_components, and the smaller in <config>\custom_components\climate.

Inside the smaller one will be a line of code like:

from homeassistant.components.evohome import (

I 99% sure this will need changing to:

from custom_components.evohome import (

#69

Just pulled the evohome.py files again and modified as suggested (i.e. “from custom_components.evohome import”). All started up correctly. Too late now to look further but looking good so far.
Whilst my setup is an Ubuntu VM on VMware ESXi using Docker, this is similar to Hass.io in that HA is run in a Docker Container. So to run in Hass.io, hopefully:

  1. in the config directory (i.e. where your configuration.yaml lives) create a directory called custom_components
  2. pull the (bigger) evohome.py file into the custom_components directory
  3. create a directory inside custom_components called climate
  4. pull the (smaller) evohome.py file into the climate directory
  5. edit the (smaller) evohome.py file to import from “custom_components.evohome”
  6. copy* the original honeywell.py to the climate directory and edit to read "REQUIREMENTS = [‘evohomeclient==0.2.7’, "
  • I did this by opening a bash shell inside the container and scp’ing the file out - I’m sure there are easier ways!
    @zxdavb - thanks for your work on this. Will spend some time playing and feedback any issues (or positives).

#70

Fantastic!

I’d be grateful if the community could help each other get up and running while I concentrate on getting the component’s PR accepted into HA.


#71

Thank you!

Following this I am now seeing the evohome entities on my Hassio.


#72

Hi all, just a question not directly related to the custom component but with the evohome system in general.

Do I need to leave internet access to the gateway all the time or can I close it to avoid data transfer with the cloud?

I know it may seems paranoid but I would like to be sure that my climate system will works also without internet.
I’ve heard weird stories on cloud based solutions.

Thank you in advance


#73

I’ve heard a lot of weird stuff over the years - the classic is the webcam/baby cam story, where people don’t realise the whole world can see inside their bedrooms.

Turns out those people never changed their passwords.

Anyway, there are usually better places to have those discussions, but specifically for evohome…

I believe the system will work fine without Internet access, but it will not get the outside air temperature (most evohome systems do not have a hard-wired weather sensor). The system probably uses this for it’s smart start/smart stop feature, but may also adjust its TPI.

In addition, you will not be able to manage the system from your mobile phone (e.g. switch from Away to Auto mode when driving back from a 3-day holiday).

And this custom component will definitely not work if your evohome system cannot access the Internet.

DB


#74

@zxdavb & @jonboy
Have implemented the change as directed and can confirm that it’s working!!

Very much appreciate you sticking with this, fantastic job.


#75

@zxdavb Sorry one thing have noticed since this started reporting and it seems common with what @bc1871 reported. One of the sensors status is not being picked up and is reported as undefined. I checked the logs and the impacted thermostat does not appear to be picked up by the api. All other room sensors are reported in the logs except for the one which remains undefined. The common element with my implementation and that of @bc1871 is that all 12 of the zones are used, is there a limitation in the routine calling the api? i.e. there should be effectively 13 zones, 12 rooms plus the hot water?


#76

OK team:

There is a new version of the component, and it is a ‘native’ custom_component, for installation instructions, see:

I will keep this up to date with the HA version. If someone could install it, and tell me how that went, Id be grateful.

It has better logging of errors/warnings, so we should be able to get to the bottom of the unavailable bug.


#77

@Isablend Can you download the new custom_component, and send me some logs? We’ll get it fixed!


#78

I’ve loaded the latest version and enabled logging, done a restart and captured the logslog.yaml (572.5 KB)
I had to rename the file as .yaml to enable it to be loaded here (hope that doesn’t cause a problem).


#79

@Isablend I’ve looked at your logs, and we have (edited):

2018-09-07 07:56:18 DEBUG   (SyncWorker) [custom_components.climate] setup_platform(): Found Zone device: id: 999 [Laundry], type: temperatureZone
2018-09-07 07:56:25 DEBUG   (SyncWorker) [custom_components.evohome] update(111), self._status = {'systemId': '111', 'zones': '...', 'dhw': '...', 'activeFaults': [], 'systemModeStatus': {'mode': 'Auto', 'isPermanent': True}}
2018-09-07 07:56:37 DEBUG   (SyncWorker) [custom_components.evohome] update(999), self._status = {}
2018-09-07 07:56:38 WARNING (MainThread) [custom_components.evohome] available(999) = False, debug code = 0x02, self._status = {}

The 3rd line is the most interesting, but the answer would have been in the 2nd line, except I’d removed some of that data (the ‘…’).

I have updated the code, and if you could install the latest version from github, we’ll then have the answer.

Probably no need to send me the whole log, just execute:

grep 'self._status' home-assistant.log | head

#80

Attached the reduced log file from the latest code. log.yaml (170.7 KB)