costastf / toonlib

A library to interact with eneco's "Toon" smart meter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toon seems to be broken

rolfberkenbosch opened this issue · comments

Hi,

The Toon lib seems to be broken suddently, can you look at it. All users are complaining on the home-assistant forum (https://community.home-assistant.io/t/toon-eneco-integration-with-home-assistant/1523/259).

The error message:

Traceback (most recent call last):
File "toon.py", line 5, in
toon = Toon(eneco_username, eneco_password)
File "/home/rolf/.local/lib/python2.7/site-packages/toonlib/toonlib.py", line 66, in init
self._login()
File "/home/rolf/.local/lib/python2.7/site-packages/toonlib/toonlib.py", line 123, in _login
self._authenticate()
File "/home/rolf/.local/lib/python2.7/site-packages/toonlib/toonlib.py", line 81, in _authenticate
data = response.json()
File "/home/rolf/.local/lib/python2.7/site-packages/requests/models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

This implementation is no longer supported (see the note at the top of the readme) and we've known it would fail eventually. The problem is that the default Toon component in home assistant is very old and still uses this library. You might want to take a look at the custom component at ToonHA.

The server responds with

<html><body><h1>503 Service Unavailable</h1>
No server is available to handle this request.
</body></html>

so i guess it was good while it lasted. Please use the component boltgolt mentions above.