Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Climate] Toon doesn't setup on version 0.87.1 #21010

Closed
maartenpaauw opened this issue Feb 12, 2019 · 88 comments · Fixed by #21186
Closed

[Climate] Toon doesn't setup on version 0.87.1 #21010

maartenpaauw opened this issue Feb 12, 2019 · 88 comments · Fixed by #21186
Assignees

Comments

@maartenpaauw
Copy link

Home Assistant release with the issue: 0.87.1

Last working Home Assistant release (if known): 0.87.0

Operating environment (Hass.io/Docker/Windows/etc.): Docker

Component/platform: https://www.home-assistant.io/components/climate.toon/

Description of problem: Component doesn't work after update.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

toon:
  username: !secret toon_username
  password: !secret toon_password

Traceback (if applicable):

Error during setup of component toon
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/setup.py", line 148, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/toon.py", line 52, in setup
    hass.data[TOON_HANDLE] = ToonDataStore(username, password, gas, solar)
  File "/usr/src/app/homeassistant/components/toon.py", line 70, in __init__
    toon = Toon(username, password)
  File "/usr/local/lib/python3.6/site-packages/toonlib/toonlib.py", line 66, in __init__
    self._login()
  File "/usr/local/lib/python3.6/site-packages/toonlib/toonlib.py", line 123, in _login
    self._authenticate()
  File "/usr/local/lib/python3.6/site-packages/toonlib/toonlib.py", line 81, in _authenticate
    data = response.json()
  File "/usr/local/lib/python3.6/site-packages/requests/models.py", line 897, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/simplejson/__init__.py", line 518, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.6/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Additional information:

screen shot 2019-02-12 at 16 12 29

@MajorGlory78
Copy link

MajorGlory78 commented Feb 12, 2019

Just noticed the same error. After initial update it seemed to be working. After restart of Hassio just now I get the same setup error. Will try to restart Toon first and it could be a problem with the Toon API as well....

Restart of Toon and/or restart of Hassio doesn't work.

@timon71
Copy link

timon71 commented Feb 12, 2019

Same issue here after updating to 0.87.1 on HassOs 2.8.

@hendr00
Copy link

hendr00 commented Feb 12, 2019

Same issue using docker container 0.87.1

@Knol010
Copy link

Knol010 commented Feb 12, 2019

Same issue here after updating hassio. After downgrading to 0.87.0 it is not working anymore.

@aalbul
Copy link

aalbul commented Feb 12, 2019

the same issue here

@daniel360gt
Copy link

I think the problem is with Toon itself.
I'm running HASSIO 0.84.2, same issue.

@timon71
Copy link

timon71 commented Feb 13, 2019

Probably because Eneco stopped supporting the services for iPad en old mobile apps since yesterday? See https://forum.eneco.nl/storingen-en-oplossingen-112/inloggen-toon-op-tablet-werkt-niet-20978

The mobile app on my iPhone still works. So my guess is that the login URL or procedure has changed?

@aalbul
Copy link

aalbul commented Feb 13, 2019

Are there any plans to migrate to https://github.com/costastf/toonapilib ?
seems like it is using official toon API and is a logical continuation of https://github.com/costastf/toonlib as it was deprecated.

@hmmbob
Copy link
Contributor

hmmbob commented Feb 13, 2019

Probably because Eneco stopped supporting the services for iPad en old mobile apps since yesterday? See https://forum.eneco.nl/storingen-en-oplossingen-112/inloggen-toon-op-tablet-werkt-niet-20978

The mobile app on my iPhone still works. So my guess is that the login URL or procedure has changed?

In that topic and other topics related to it, it is discussed that Eneco took down an older backend service (which apparently was used by the Toon Climate component for HA) and that service for this older backend will not be restored. Eneco points out that services wanting to use this information, need to use the new API (docs at https://developer.toon.eu/toonapi/apis).

That would mean that....

Are there any plans to migrate to https://github.com/costastf/toonapilib ?
seems like it is using official toon API and is a logical continuation of https://github.com/costastf/toonlib as it was deprecated.

.... would likely fix this issue. I am definitely not a coder, but happen to read some Dutch at the Eneco forums....

@frenck
Copy link
Member

frenck commented Feb 15, 2019

I've started working on a replacement implementation.
Let's see if I can manage to get something out.

@scheric
Copy link
Contributor

scheric commented Feb 15, 2019

@frenck
There is already an updated version for this component at https://github.com/costastf/toonapilib
It uses the new official API.
Only one issue has to be resolved: krocat/ToonHA#40. After that it can be migrated directly.

@Knol010
Copy link

Knol010 commented Feb 15, 2019

So it will be solved in the new update from HA?

@frenck
Copy link
Member

frenck commented Feb 15, 2019

@scheric Yeah I have based it on that. I'm also doing generic upgrades (async) and add in all the new bells and whistles (configuration from the UI).

Got a POC working yesterday, will continue on working on it and try to see if I can make it in time for the 0.90 release.

@Knol010 No, Home Assistant 0.89 has been frozen already (already in beta).

@hmmbob
Copy link
Contributor

hmmbob commented Feb 15, 2019

@frenck Do you think it would be possible to let the build-in component support Rooted Toons as well, in the same package? Those don't use the Eneco API, but a local API in the Thermostat itself.

@frenck
Copy link
Member

frenck commented Feb 15, 2019

@hmmbob No that is not possible, that logic would differ completely and should really be implemented as a separate component.

@frenck
Copy link
Member

frenck commented Feb 15, 2019

@scheric I read your comment again and was incorrect in my response (or can be confusing). I'm using the toonapilib by costastf, but am not basing it off the krocat component version.

While I use the krocat version myself as well (at this moment), it is not up to par with the latest and greatest best practices of HA. Hence I've started on an implementation from scratch. Implementing, async, config entries, data entry flows (Integrations from UI), entity registry, device registry, supports areas, also added in support for multiple devices (in the same or different accounts).

Current state: Finished with basic component setup. Configuration from UI works (includes authentication from the UI), Toon display selections and the Toon devices get registered and are showing up nicely including firmware information and such.

Next steps would be setting up the specific platforms (climate, binary_sensors, sensors, switches, and lights).

@timon71
Copy link

timon71 commented Feb 15, 2019

@frenck Will there also be a binary sensor for “burner status” as well? There wasn’t one in the offical component. I use a custom component for “toon” where i could use this sensor as a trigger. If it is usefull i will add the toon.py as attachment.

@frenck
Copy link
Member

frenck commented Feb 15, 2019

@timon71 Thanks, but not needed. Got the data... Working on the representation.
Burner status will be in there... but not sure if that would be a binary sensor or an attribute of the climate component.

In case of it being an attribute, you can always use a simple template to turn it into a binary sensor (no hacking needed).

@jpduhen
Copy link

jpduhen commented Feb 15, 2019

Can't wait ;-)

@frenck
Copy link
Member

frenck commented Feb 16, 2019

Current state:
2019-02-16 18 49 47

Starting with sensors now.

@hmmbob
Copy link
Contributor

hmmbob commented Feb 16, 2019

That's pretty cool. Now I feel even more jealous for not having the official integration.....

@timon71
Copy link

timon71 commented Feb 16, 2019

Nice job Frenck. Hardly can't wait for the release. Keep up the good work.

@frenck
Copy link
Member

frenck commented Feb 17, 2019

Got most stuff up and running. Still needs work in quite a few departments, but it is running smoothly.

I'm thinking about not implementing Light support. Since the Toon only supports Philips Hue and well, that is natively supported by Home Assistant. IMHO it makes not much sense to support it on this component.

The Switches & Smoke sensors are kinda the same story...?

What do you guys think about Light, switches and smoke sensors?

@aalbul
Copy link

aalbul commented Feb 17, 2019

I think that for the first flice they are definitely not needed :)

@hmmbob
Copy link
Contributor

hmmbob commented Feb 17, 2019

I agree. I'd only expect the Toon Climate control and specific Toon sensors ("metersensors") to be present in the component.

Switches etc are better done directly integrated in HA.

@frenck
Copy link
Member

frenck commented Feb 17, 2019

Ok, current state in that case:

image

image

Some sensor values still need some calculations/adjustments,

@Knol010
Copy link

Knol010 commented Feb 17, 2019

Great work

@timon71
Copy link

timon71 commented Feb 17, 2019

That’s much more then there ever was. Looking great.

@jpduhen
Copy link

jpduhen commented Mar 9, 2019

Not sure if binary sensors would show up there. Can you find them here?

https://joshmccarty.com/wp-content/uploads/2017/08/home-assistant-dev-states-link.png

@hmmbob I do not see any other binary sensors then these three:

Schermafbeelding 2019-03-09 om 08 52 48

@scheric
Copy link
Contributor

scheric commented Mar 9, 2019

How does your intergrations tab look like when you click on it.

@jpduhen
Copy link

jpduhen commented Mar 9, 2019

Like this:
Schermafbeelding 2019-03-09 om 09 03 26

And when I show all:
Schermafbeelding 2019-03-09 om 09 03 38

I don't see these guys:
Schermafbeelding 2019-03-09 om 09 07 59

@Onandon11
Copy link

I have the same, toon module working amazing! However no burner status.. with the old custom component I had a working burner status binary sensor.

@hmmbob
Copy link
Contributor

hmmbob commented Mar 9, 2019

Is the Toon operating in OpenTherm mode (versus on/off mode)? On my rooted one I need to select that in the settings at the Toon itself, I do not know if that is possible on an original one.

@jpduhen
Copy link

jpduhen commented Mar 9, 2019

My Toon has indeed not "OpenTerm" but "on/off":
IMG_8268
But then I would like to know if the on-off-switching is usable as a sensor in HA.
I don't have my Toon rooted, so perhaps that is the couse? Would be a pity.
I remember @frenck mentioning he himself did not have a rooted Toon either...

@scheric
Copy link
Contributor

scheric commented Mar 9, 2019

I do not have a rooted toon. It works for me.
My toon is connected to a EMS-OT converter. After that you may need to manually change the mode in you toon settings. So it is working with OpenTherm.

@hmmbob
Copy link
Contributor

hmmbob commented Mar 9, 2019

My Toon has indeed not "OpenTerm" but "on/off":
IMG_8268

I don't have my Toon rooted, so perhaps that is the couse? Would be a pity.
I remember @frenck mentioning he himself did not have a rooted Toon either...

Try setting it to open therm and restart home Assistant. You don't need to root your Toon - this integration is for the official Toon. I just didn't know if the original ones also had this option.

So, try changing the setting at your Toon and then restart home Assistant, see if that works. As long as your boiler (ketel) supports OpenTherm, you should be good. Burner status information is part of the OpenTherm information.

@scheric
Copy link
Contributor

scheric commented Mar 9, 2019

If you do not have an OpenTherm boiler I'm am interested to see if you do have some boiler status if you use https://github.com/krocat/ToonHA

@timon71
Copy link

timon71 commented Mar 9, 2019

Probably you have a nefit boiler which does not support the default opentherm standard. I use this opentherm converter https://wifithermostaten.nl/nefit-opentherm-converter.html to communicate with toon. But also to use modulation instead of on/of.

@hmmbob
Copy link
Contributor

hmmbob commented Mar 9, 2019

First try setting the setting to OpenTherm in your Toon, it is not auto-sensing. However, your boiler does need to support it indeed, but most modern ones do.

@hmmbob
Copy link
Contributor

hmmbob commented Mar 9, 2019

The changes aren’t that ugly. There only needs to be an extra mode if the toon is in manual mode.
See: https://github.com/krocat/ToonHA only STATE_OFF Is added.
The states are already messed up so why not make it a tiny bit worse for extra compatibility with the google assistant.

There need to be more people who accept this change otherwise it will only be usable after the architecture fix is merged.

Interesting. Are you saying that with modifying that code, Google Assistant will be able to set Toon to heating mode again after manually setting a temperature?

@scheric
Copy link
Contributor

scheric commented Mar 9, 2019

@hmmbob
Yes. You are right. The Krocat/ToonHA master works with the home Assistant.
Look at krocat/ToonHA#45 to see some more information on what is different.

@jpduhen
Copy link

jpduhen commented Mar 9, 2019

Probably you have a nefit boiler which does not support the default opentherm standard. I use this opentherm converter https://wifithermostaten.nl/nefit-opentherm-converter.html to communicate with toon. But also to use modulation instead of on/of.

That's what I need, I think, because I own a NEFIT Topline.
Now I have the original Toon supplied on/off Toon-CV interface module:
IMG_8269

And this is only connected to the green connector ("on/off" switch) at the NEFIT heater:
IMG_8270

I guess this is why I can't set the Toon Display to "OpenTerm".
The module @timon71 suggests, replaces the Toon-CV interface I think and should be connected to the orange connector on the NEFIT?

So if I understand it correctly:

  • If I order this alternative module (https://wifithermostaten.nl/nefit-opentherm-converter.html) and I replace the original white Toon-CV module (photo above) 1-on-1, I can select "OpenTerm" setting on the Toon Display? And use the binary sensor burner_state in HA?
  • Can I use the same 2-wire connection from the Toon-display to this new module, or do i have to modify this connection also. (Would be a "bit" of work )

@Onandon11
Copy link

Onandon11 commented Mar 9, 2019

My Toon has indeed not "OpenTerm" but "on/off":
IMG_8268
But then I would like to know if the on-off-switching is usable as a sensor in HA.
I don't have my Toon rooted, so perhaps that is the couse? Would be a pity.
I remember @frenck mentioning he himself did not have a rooted Toon either...

I do not have a rooted Toon either, and my toon shows the same screen as yours. It is unclear if it is working in on,off mode or Openthem. Nevertheless, with the Krocat module I had a binary sensor showing the operation of the burner.

I also have anither problem occuring very frequently, see image below...
image

It looks like the API blocks the request (Because of the QuotaViolation)

@timon71
Copy link

timon71 commented Mar 9, 2019

@jpduhen it does not replace the toon module. You have to install it between your nefit and toon module. There is a manual available in the toon forum i believe. For install steps see this dutch forum:
https://forum.eneco.nl/aan-de-slag-met-toon-160/hoe-sluit-ik-de-ketelmodule-aan-17355

@scheric
Copy link
Contributor

scheric commented Mar 9, 2019

A question to everyone who have boiler modulation

When I look at the boiler modulation level I came to the conclusion that the status is not right.
I have a consistent delta of 3 %

HA gives API gives Boiler gives
89 89 92
78 78 80

Who has a difference in modulation level?
Is the difference 3% too?


note: I have a nefit Trendline.

@jpduhen
Copy link

jpduhen commented Mar 9, 2019

@jpduhen it does not replace the toon module. You have to install it between your nefit and toon module. There is a manual available in the toon forum i believe. For install steps see this dutch forum:
https://forum.eneco.nl/aan-de-slag-met-toon-160/hoe-sluit-ik-de-ketelmodule-aan-17355

@timon71 Thanks 4 the info, diving into it!

@Onandon11
Copy link

@timon71, Indeed thanks! I ordered one :).

Do you guys also have the QuotaViolation Exception?

@jpduhen
Copy link

jpduhen commented Mar 9, 2019

@timon71 Also ordered one!
@Onandon11 I have no errors. I had some when I was experimenting with 2 raspberry Pi's this morning, both using the toon component, but now I upgraded my "live" HA Pi and shut-down the experimental Pi. No more errors. Perhaps you also have multiple instances using the toon-component?

@Onandon11
Copy link

@jpduhen, Hmm... I don't have a second instance running, just checked. Like I said I had the custom component before 0.89 but removed all the files and directories of it...

@Knol010
Copy link

Knol010 commented Mar 10, 2019

Since yesterday my power cost is showing 0. Everything else is good. More people with this issue?

@Johnyboy1960
Copy link

Same here

@Onandon11
Copy link

Yep, same here ..

@scheric
Copy link
Contributor

scheric commented Mar 10, 2019

@Knol010, @Johnyboy1960, @Onandon11

The power cost Will always be 0 in the weekends. This is the fault of the toon API.
The toon servers only calculate the day cost from the tariff1 power usage.


I have already send them an email (1 or 2 weeks ago) but no reaction back. You could send them an email to. Maybe they are only solve problems if more people request a change.

@Onandon11
Copy link

@scheric, alright that's clear at least.

However the QuataViolation are running me mad, it looks like the API gets hit for every sensor separately, maybe that's the cause...

@scheric
Copy link
Contributor

scheric commented Mar 10, 2019

QuataViolation

Some information from the toondevapi website https://developer.toon.eu/developer-journey

To protect our quality of service we have set a quotum of 10 calls per minute per display. To discourage the implementation of longer lasting continuous interaction a quotum of 100 calls per display per days applies on top of this. But to give you more flexibility during development you are allowed to consume 60 calls per minute and 500 calls per day per display to make sure you can play around as desired.

This explains a bit but there is no information on what kind of quotum you have.

The krocat/ToonHA version uses the same api and the api is only polled with one request for all sensors. So the strange part is that it has worked perfectly with the krocat/ToonHA version.

@frenck
Copy link
Member

frenck commented Mar 11, 2019

@scheric This component does the same, it is just built differently. The toonapilib handles the caching of calls in this case. Effectively, the number of calls are nearly equal.

In general, this issue had been closed. If you have generic support on setting up your boiler, please use Discord or our community forums.

If you have issues with the Toon Component, please create a new GitHub issue.

Regarding the API rate limiting, the discussion will continue in #21825

@home-assistant home-assistant locked as off-topic and limited conversation to collaborators Mar 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.