home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.11k stars 29.79k forks source link

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

Closed maartenpaauw closed 5 years ago

maartenpaauw commented 5 years ago

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

csp1980 commented 5 years ago

weldone frenck !

Better then before!

Jor-Tech commented 5 years ago

Very nice to see Eneco Toon Thermostat working again. Only thing I had to do after setting it up as described on the components page was change the Entity from climate.toon_van_eneco to climate.toon_thermostat and add some new thermostat cards with Configure UI. So that's cool, thanks a lot for making this work again! :-)

Beside that I do notice an other issue which I don't know if it's new or always have been there, but would be very nice if it can be fixed. I can't always change the temperature using Google Home. When I ask Google home to change to a different mode or to a manual temperature it does only work when the Eneco Toon is set to one of the four modes (Auto, Heat, Eco, Cool) but when I've changed it to a manual temperature and ask Google Home again to change it either to a manual temperature or to one of the four modes, Google home replies with: "That mode isn't available for the Toon Thermostat". When it's set to a manual temperature I'm unable to change it to an other temperature or mode.

Also on the Toon components page the first mode is called Performance, in HA UI it's Auto, and Google Home replies with "Changing the Toon Thermostat to Heat Cool"

I'm really grateful for the fix already and hope to see even more improvements regarding to the things I mentioned above.

jpduhen commented 5 years ago

Very pleased, thanks for all your effort Frenck!

hmmbob commented 5 years ago

Beside that I do notice an other issue which I don't know if it's new or always have been there, but would be very nice if it can be fixed. I can't always change the temperature using Google Home. When I ask Google home to change to a different mode or to a manual temperature it does only work when the Eneco Toon is set to one of the four modes (Auto, Heat, Eco, Cool) but when I've changed it to a manual temperature and ask Google Home again to change it either to a manual temperature or to one of the four modes, Google home replies with: "That mode isn't available for the Toon Thermostat". When it's set to a manual temperature I'm unable to change it to an other temperature or mode.

That is an error that is outside of this component, and @frenck even specifically adresses it in the pull request:

This component will, just like the current version, still have the issue in setting a temperature via Google Assistant. In order to fix this, without doing ugly things, requires home-assistant/architecture#22 to be resolved.

Jor-Tech commented 5 years ago

@hmmbob, thanks for pointing out, didn't know that. Good to know now.

Still great work from @frenck

scheric commented 5 years ago

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.

jpduhen commented 5 years ago

@frenck Is there a way to check the burner state via the Toon component? Would be awesome to switch my secondary pump is sync with the burner turning on and off.

hmmbob commented 5 years ago

Did you check your binary sensors? Especially the binary_sensor.burner_status one....

jpduhen commented 5 years ago

Did you check your binary sensors, before asking this question?

Schermafbeelding 2019-03-09 om 08 27 02

@hmmbob I'm using a clean install of 89.1 and I see no binary sensors (or am I missing something here/ doing something wrong)

hmmbob commented 5 years ago

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

jpduhen commented 5 years ago

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 commented 5 years ago

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

jpduhen commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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:

Onandon11 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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 commented 5 years ago

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

Do you guys also have the QuotaViolation Exception?

jpduhen commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

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

Johnyboy1960 commented 5 years ago

Same here

Onandon11 commented 5 years ago

Yep, same here ..

scheric commented 5 years ago

@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 commented 5 years ago

@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 commented 5 years ago

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 commented 5 years ago

@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