Hey guys, I’ve created a custom component to interact with my Toon thermostat from Eneco. It’s kind of similar to integration that opdoffer created, but the component allows for an easier set-up and I like having a real climate device better over scenes and switches.
Don’t know if you guys want more errors but this is what I just saw in the log:
17-05-01 22:03:03 ERROR (Thread-10) [toonlib.Toon]
Status Code :500
Text :{ "success": false, "reason": "Cannot retrieve common name for client: 7dd9b04a-60a2-4c20-91ca-80509bad082d", "errorCode": "500" }
17-05-01 22:03:03 ERROR (Thread-10) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 167, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
17-05-01 22:09:05 ERROR (MainThread) [homeassistant.core] Error doing job: Fatal read error on SSL transport
Traceback (most recent call last):
File "/usr/lib/python3.4/asyncio/selector_events.py", line 825, in _read_ready
data = self._sock.recv(self.max_size)
File "/usr/lib/python3.4/ssl.py", line 730, in recv
return self.read(buflen)
File "/usr/lib/python3.4/ssl.py", line 619, in read
v = self._sslobj.read(len or 1024)
OSError: [Errno 113] No route to host
That is the api not responding. I am currently testing code that changes the way we query the api and so far it looks much better and with a much better refresh rate. Hold on to your hats… At some point you should get an error like this but for a deauthentication and then I would guess you will not get any updated values any more with continuous errors and you will have to restart. That message, i am very interested in… Let’s see who gets there first
However, I’m still updating, so it seems. I get a lot of these:
17-05-02 09:20:31 ERROR (Thread-8) [toonlib.Toon]
Status Code :500
Text :{ "success": false, "reason": "Cannot retrieve common name for client: 88e23b32-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "errorCode": "500" }
And then some of these:
17-05-02 09:20:31 ERROR (Thread-8) [toonlib.Toon] Could not get answer from service.
Traceback (most recent call last):
File "/home/homeassistant/.homeassistant/deps/toonlib/toonlib.py", line 168, in _state
state.update(self._get_data('/client/auth/retrieveToonState'))
TypeError: 'NoneType' object is not iterable
I am guessing this is a load balancing issue on their part. As to the other ones the code I am currently testing is running for an hour and a half with no messages so far. I will keep you updated.
i am only getting warnings for slow responses, no errors so far.
17-05-02 13:20:31 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.dryer is taking over 10 seconds.
17-05-02 13:22:34 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.power_current is taking over 10 seconds.
17-05-02 13:24:38 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.power_current is taking over 10 seconds.
17-05-02 13:27:44 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.dryer is taking over 10 seconds.
17-05-02 13:33:56 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.power_current is taking over 10 seconds.
17-05-02 13:41:10 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.power_current is taking over 10 seconds.
17-05-02 14:20:56 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.power_current is taking over 10 seconds.
17-05-02 14:20:56 WARNING (MainThread) [homeassistant.helpers.entity] Update of switch.dryer is taking over 10 seconds.
I have just one of those for the entire day:
17-05-02 13:04:19 WARNING (MainThread) [homeassistant.helpers.entity] Update of sensor.power_today is taking over 10 seconds.
30 seconds! Now we’re talking. This will be better than the real api once we’re finished
I am very confident for the resiliency of the code so far. I am waiting to hit the deauthentication so I can tackle that too and then off to the mainline How are you doing with reading up on the process @krocat? Do you need any help with anything? By the way if the library responds well do you mind having another talk about the initialization of the component?
Hi @costas, always happy to discuss that. I just don’t want a component that you have to restart three times before it works I’ve created a new housekeeping branch with some of the stuff out of your cookiecutter repo. ToonHA now also has a version number. By looking back at what we’ve done, I figure we’re at 0.5. I also included a Tox.ini but that doesn’t get me any further as I would need a setup.py of some sorts, which might be difficult in an HA component. Can you perhaps take a look at the testing part, they seem pretty strict with what they accept and do not accept in terms of coding. In the meanwhile, I’m working on getting the documentation for the home-assistant.io site ready.
@krocat there is no way that this does not work excellent when we are done with it, or i am not going to be done with it, don’t worry! I am happy to take a look tomorrow at that branch
I replied to the email notification and apparently it does not integrate. Sorry, have not looked much into it. I am a bit busy the next few days so won’t have much time.
However on https://home-assistant.io/developers/development_checklist/ it mentions :
The .coveragerc file is updated to exclude your platform if there are no tests available or your new code uses a third-party library for communication with the device, service, or sensor
which is the case with this component. There is no testing because it uses a third party library, toonlib so I guess we are fine with just the appropriate documentation.