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
74.08k stars 31.09k forks source link

Toon integration stops working every couple of days #115290

Open alleknalle opened 7 months ago

alleknalle commented 7 months ago

The problem

Every couple of days my Toon integration stops working. In Home Assistant it just shows that it can't setup the integration. The only way to make it work again is to delete the integration and create it again with the exact same configuration. Then it works for a couple of days, but then it stops again.

I've used the integration for years without issues, but on March 14th it stopped working for the first time. After some searching on the internet I've deleted my Toon configuration and created a new app on developer.toon.eu. Then I added the configuration with the new keys and then it worked again. This was March 27th. So in 13 days it never 'automatically' came back to work. Then on April 6th it stopped working again. Then I only deleted the integration and re-added it again after which it was working again. But then today (April 9th) it stopped working again. I've done the same things as on April 6th and now it works again I don't want to fix the integration every couple of days, so I hope someone can help me fix this :-)

I always keep my Home Assistant up-to-date, so I guess the first time it stopped working was in core-2024.3.0 or core-2024.3.1.

The error in my log file of today:

2024-04-09 17:07:22.777 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry XXXXXXXXX for toon
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/__init__.py", line 93, in async_setup_entry
    await coordinator.toon.activate_agreement(
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 161, in activate_agreement
    await self.agreements()
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 182, in agreements
    agreements = await self._request(
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 79, in _request
    self.token = await self.token_refresh_method()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/coordinator.py", line 38, in async_token_refresh
    await session.async_ensure_token_valid()
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 523, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token
    new_token = await self._async_refresh_token(token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 116, in _async_refresh_token
    new_token = await self._token_request(data)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 135, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1060, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not found', url=URL('https://api.toon.eu/token')

What version of Home Assistant Core has the issue?

core-2024.4.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Toon

Link to integration documentation on our website

https://www.home-assistant.io/integrations/toon/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

2024-04-09 17:07:22.777 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry XXXXXXXXX for toon
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/__init__.py", line 93, in async_setup_entry
    await coordinator.toon.activate_agreement(
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 161, in activate_agreement
    await self.agreements()
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 182, in agreements
    agreements = await self._request(
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 79, in _request
    self.token = await self.token_refresh_method()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/coordinator.py", line 38, in async_token_refresh
    await session.async_ensure_token_valid()
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 523, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token
    new_token = await self._async_refresh_token(token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 116, in _async_refresh_token
    new_token = await self._token_request(data)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 135, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1060, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not found', url=URL('https://api.toon.eu/token')

Additional information

No response

home-assistant[bot] commented 7 months ago

toon documentation toon source

emarcelcom commented 7 months ago

I have the same issue.

godzillaerikj commented 7 months ago

here the same issue

My log

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/init.py", line 93, in async_setup_entry await coordinator.toon.activate_agreement( File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 161, in activate_agreement await self.agreements() File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 182, in agreements agreements = await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry ret = await target(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry ret = await target(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 79, in _request self.token = await self.token_refresh_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/coordinator.py", line 38, in async_token_refresh await session.async_ensure_token_valid() File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 523, in async_ensure_token_valid new_token = await self.implementation.async_refresh_token(self.token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token new_token = await self._async_refresh_token(token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 116, in _async_refresh_token new_token = await self._token_request(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 135, in _token_request resp.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1060, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not found', url=URL('https://api.toon.eu/token')

casimirextreme commented 7 months ago

Same here

Cheffed86 commented 7 months ago

Same error same problems

Wolk9 commented 7 months ago

same error, same problems.

`Logger: homeassistant.config_entries Source: config_entries.py:551 First occurred: 08:33:18 (3 occurrences) Last logged: 08:42:02

Error setting up entry [my address] for toon Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/init.py", line 93, in async_setup_entry await coordinator.toon.activate_agreement( File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 161, in activate_agreement await self.agreements() File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 182, in agreements agreements = await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry ret = await target(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry ret = await target(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 79, in _request self.token = await self.token_refresh_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/coordinator.py", line 38, in async_token_refresh await session.async_ensure_token_valid() File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 523, in async_ensure_token_valid new_token = await self.implementation.async_refresh_token(self.token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token new_token = await self._async_refresh_token(token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 116, in _async_refresh_token new_token = await self._token_request(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 135, in _token_request resp.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1070, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not found', url=URL('https://api.toon.eu/token') `

JaapJoo commented 7 months ago

Same here

wim-bart commented 7 months ago

Exact the same problem, starting in march, and suddenly it works again, very strange, now it is now working, working, not working. getting crazy about it.

wim-bart commented 7 months ago

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 551, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/init.py", line 93, in async_setup_entry await coordinator.toon.activate_agreement( File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 161, in activate_agreement await self.agreements() File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 182, in agreements agreements = await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry ret = await target(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry ret = await target(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 79, in _request self.token = await self.token_refresh_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/coordinator.py", line 38, in async_token_refresh await session.async_ensure_token_valid() File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 523, in async_ensure_token_valid new_token = await self.implementation.async_refresh_token(self.token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token new_token = await self._async_refresh_token(token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 116, in _async_refresh_token new_token = await self._token_request(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 135, in _token_request resp.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1070, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not found', url=URL('https://api.toon.eu/token')

keyaertc commented 7 months ago

Same here, the integration doesn't work anymore since a few weeks :'(

Airyphyla commented 7 months ago

@keyaertc Sadly you have to redo the config all over again, as the problem proceeds

keyaertc commented 7 months ago

@keyaertc Sadly you have to redo the config all over again, as the problem proceeds

In the integration, toon, I clicked on Add Entry, I selected "Engie Electrabel Boxx via Configuration.yaml", re-authenticate and everything started to work again.

Thx for pointing me into that direction :-)

bpmb82 commented 7 months ago

I have the same problem every now and again. I have to remove the integration and add it again to get it work once more. Anyone find a permanent solution to this?

gigatech73 commented 7 months ago

same issue using toon and eneco.

boboost commented 7 months ago

Same issue today

eerwinn commented 7 months ago

Same here. removing - adding the integration solves the problem.

mlangendoen commented 6 months ago

Yes Same here. Removing and adding helpt

wim-bart commented 6 months ago

Here it gets worse, i don't have energy with Eneco, only i pay every month for Toon. Now i want to re-add it and it does not work. I used to use an api key, but somehow that does not work anymore. Now i get redirected to the Eneco site and my account gets blocked. So no more Toon working....

Airyphyla commented 6 months ago

Looks to get worse here too, even readding the Toon intergration plays up problems and looks to be buggy. Is anyone working/looking at this?

bpmb82 commented 6 months ago

I setup a small piece of automation to send me a notification whenever the Toon status becomes 'Unavailable' and I see the 404's a lot more often than I suspected. It usually restores itself after 30 seconds or so but every now and again, it doesn't and I need to re-add the integration to get it to work once more. The 404 puzzles me a bit, I'm running HA in docker, do we all have that in common maybe? Or could the problem be on the Toon api endpoint so external to HA?

wim-bart commented 6 months ago

Today again it happened, Home Assistant seems more and more getting useless. Now with all zha issues here my gf says i have to ditch the thing and get something else. I want HA but with every 3 or 4 days having to reconnect the whole integration over and over again.....

It might be an issue at the endpoint, but I don't know what changed there. And my python knowledge is to limited to help here.

wim-bart commented 6 months ago

I think i found the issue, somehow it looks that homeassistant does not react on port 8123 when a callback takes place. after i do the commands (in powershell):

test-netconnection homeassistant.local -port 8123

and do a reload, then it works.

eerwinn commented 6 months ago

How often did this issue occurs because I made a note and mine's running fine since the 1st May (if failed during the night 03:30 AM). Not sure what changed but this is the first time it is working for a longer period of time. In the meantime I kept Home Assistant up to date so there were also some restarts in between.

I'll keep track on the integration and let's see how long it will take this time to fail. 404 errors it the are still the trigger for me to reinstall the integration.

FrankHoogmans commented 6 months ago

@eerwinn For me, it still happens regularly. Have tried setting up the integration again, but to no avail. Have not found a single way of reliably restoring functionality, reloading, rebooting, reconfiguring does all not seem to work, but it does somehow just start working sometimes.

I also noticed the logs look identical to issue #93984, both are a 404 during authentication if I read it correctly.

It's quite annoying since it messes up both my energy overview, and breaks a curl task for uploading my solar to pvoutput, which then shows gaps and stuff.

Is there anything I can setup logging wise in my home assistant to help debug this issue?

MLE010 commented 6 months ago

yupp, same problem here. Have to reinstall to get it working again.

eerwinn commented 6 months ago

@FrankHoogmans mine failed yesterday again. I decided to remove the integration completely this time. At the developer page I also removed the app, and created a new one.

After the reboot of HA i updated the clientID and secret stored in my configuration.yaml. When I tried to install Toon integration I did this using in-private browsing. I did many attempts and suddenly it started working again. Maybe this has something to do with API endpoints not responding for a period of time,

@wim-bart Did you have any outages after your message in this thread?

wim-bart commented 6 months ago

@eerwinn yes I had one last weekend. Toni’s now happening on a week base for my feeling.

I did buy an other P1 device so I have reliable measurements from my Utility meters. And planning to ditch Toon as a whole and make it a local (no internet) device. Maybe I find a nice thermostat what is ha compatible and does work without need of cloud and internet.

wim-bart commented 6 months ago

@eerwinn no I did not, somehow everything looks stable. But I found some issues what might be the cause of the issue.

At home I have a split-dns server, where I resolve homeassistant.mydomain.nl. HA uses two DNS servers, my internal dns server and as fallback the external dns from my provider.

When I inspect the logs of my opnsense I did see request to the external interface what is not open/forwarded/natted. And then in debug logs of HA I found that sometimes HA uses the second DNS server and there is where everything goes wrong.

Now I removed the second DNS server and made a fallback entry in hosts file pointing to ha internal IP. And HA is now unbelievable fast. And many issues are solved now.

wim-bart commented 6 months ago

And Toon is broken again:

`Logger: homeassistant.config_entries Bron: config_entries.py:575 Eerst voorgekomen: 17:53:46 (1 gebeurtenissen) Laatst gelogd: 17:53:46

Error setting up entry [xxxxx] for toon Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup result = await component.async_setup_entry(hass, self) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/init.py", line 93, in async_setup_entry await coordinator.toon.activate_agreement( File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 161, in activate_agreement await self.agreements() File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 182, in agreements agreements = await self._request( ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry ret = await target(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry ret = await target(args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 79, in _request self.token = await self.token_refresh_method() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/coordinator.py", line 38, in async_token_refresh await session.async_ensure_token_valid() File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 523, in async_ensure_token_valid new_token = await self.implementation.async_refresh_token(self.token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 94, in async_refresh_token new_token = await self._async_refresh_token(token) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 116, in _async_refresh_token new_token = await self._token_request(data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 135, in _token_request resp.raise_for_status() File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1070, in raise_for_status raise ClientResponseError( aiohttp.client_exceptions.ClientResponseError: 404, message='Not found', url=URL('https://api.toon.eu/token')`

When i access the url with curl from HA it works without any issue.

keyaertc commented 6 months ago

yesterday, we received an email from Engie mentioning that starting July 1St, the BoXXX (Engie's toon thermostat) will not be supported anymore, and they encourage us to move to another thermostat, like a nest or similar

tizzen33 commented 6 months ago

Same here. Integration stopped working every now and then. After the mail from Engie, I tried to root the device with success and have integrated it now locally in HA. A lot more stable and faster.

keyaertc commented 6 months ago

Same here. Integration stopped working every now and then. After the mail from Engie, I tried to root the device with success and have integrated it now locally in HA. A lot more stable and faster.

Hello, Could you explain how you rooted the device ? Could you share that with us ?

emarcelcom commented 6 months ago

Same here. Integration stopped working every now and then. After the mail from Engie, I tried to root the device with success and have integrated it now locally in HA. A lot more stable and faster.

Hello, Could you explain how you rooted the device ? Could you share that with us ?

I second that :)

tizzen33 commented 6 months ago

Follow this guide Root-A-Toon

I used a Raspberry Pi with RaspAP installed for the hotspot. Make sure to use a Raspberry Pi OS based on Debian Buster for the scripts to work.

I also had to perform the factory reset as mentioned in the doc because my Toon was on 6.X version.

After the rooting, I made some adaptations to the payload file to upgrade the Toon back to the version I had before. (I'll add those later, can't find it now)

And finally I installed these through HACS:

https://github.com/cyberjunky/home-assistant-toon_climate

https://github.com/cyberjunky/home-assistant-toon_smartmeter

WvEtten commented 6 months ago

What helped for me with Toon is to remove the integration and reinstall it. The integration proved to be working on the Developer site and was still active. However after the re-installation of the integration, you also need to logon to Eneco (for me) and activate the integration there as well. It looks like that this token was expired, because after the reactivation all worked again and even though the integration was reinstalled all created automation's worked again. Hope this helps for you as well

emarcelcom commented 6 months ago

Hi tizzen33, after rooting toon, are you loosing any of its functionality, I know that cloud data is gone.

fweersing commented 6 months ago

What helped for me with Toon is to remove the integration and reinstall it. The integration proved to be working on the Developer site and was still active. However after the re-installation of the integration, you also need to logon to Eneco (for me) and activate the integration there as well. It looks like that this token was expired, because after the reactivation all worked again and even though the integration was reinstalled all created automation's worked again. Hope this helps for you as well

Where can I find to activate the integration in the eneco page?

tizzen33 commented 6 months ago

Hi tizzen33, after rooting toon, are you loosing any of its functionality, I know that cloud data is gone.

The weather tile on the display doesn't work anymore. But I still have the basic functionalities and electricity, gas, water, temperature and humidity sensor data,

stevejmt commented 6 months ago

Hi tizzen33, after rooting toon, are you loosing any of its functionality, I know that cloud data is gone.

The weather tile on the display doesn't work anymore. But I still have the basic functionalities and electricity, gas, water, temperature and humidity sensor data,

Hello tizzen33, can you still turn on the heating remotely? (I assume via Home Assistant now)

Thanks,

FrankHoogmans commented 5 months ago

So, after resetting the integration (configuring it again), it worked for exactly 28 days (to the hour), and we are now back at needing a reset. Error seems to be the same as the stacktraces above. Not sure if 28 days matches any kind of authentication token length expiry (refresh token maybe)?

The reset does work and alleviate the issue for 28 days (i assume), but if you don't spot it soon, it still makes your energy use view screwed up since it logs multiple days in the first hour it's back online.

kroese commented 5 months ago

@FrankHoogmans I had the issue return as quick as 24 hours. So it doesnt seem related to token expiry at all, since other times it worked for a couple of months. There seems no fixed pattern in the duration it keeps working.

jerre78 commented 5 months ago

I have the same problem with a boxx from Engie. After uninstalling and reinstalling everything works again for now but for how long of course.

superbabesliders commented 5 months ago

I noticed that I'm loosing the connection to Toon (Eneco) every time when I update Home Assistant Core and/or Operating System. I don't know if there is a relationship between the Toon Integration service and HA update. Maybe something to track here.

sdeveer commented 5 months ago

the redirect URL seems to have changed, but thats not it..

alexstaal commented 4 months ago

I have the same persistent issue. The original bugreport was 2 months ago.. who is the code owner of this component?

Wolk9 commented 4 months ago

I am currently experiencing connectivity issues. What solutions are available to resolve this problem, or is there no single solution that fits all cases?

Logger: homeassistant.config_entries
Source: config_entries.py:586
First occurred: 10:37:41 (1 occurrences)
Last logged: 10:37:41
....etc etc..... 

Ehm... your home address is in this log... I would anonymize this if I were you...

gielk commented 4 months ago

I am currently experiencing connectivity issues. What solutions are available to resolve this problem, or is there no single solution that fits all cases?

Logger: homeassistant.config_entries
Source: config_entries.py:586
First occurred: 10:37:41 (1 occurrences)
Last logged: 10:37:41

Error setting up entry [my address] for toon
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/__init__.py", line 93, in async_setup_entry
    await coordinator.toon.activate_agreement(
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 161, in activate_agreement
    await self.agreements()
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 182, in agreements
    agreements = await self._request(
                 ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/backoff/_async.py", line 151, in retry
    ret = await target(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/toonapi/toon.py", line 79, in _request
    self.token = await self.token_refresh_method()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/coordinator.py", line 38, in async_token_refresh
    await session.async_ensure_token_valid()
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 531, in async_ensure_token_valid
    new_token = await self.implementation.async_refresh_token(self.token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 103, in async_refresh_token
    new_token = await self._async_refresh_token(token)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 116, in _async_refresh_token
    new_token = await self._token_request(data)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 135, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/aiohttp/client_reqrep.py", line 1070, in raise_for_status
    raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 404, message='Not found', url=URL('https://api.toon.eu/token')
FrankHoogmans commented 3 months ago

@gielk The only remediation I know of is deleting the integration and re-adding it. This is reasonably quick to do, but annoying since everytime you notice you have data gaps.

I don't have the python and/or home assistant knowledge to figure this out unfortunately

Airyphyla commented 3 months ago

It’s such a mess, the integration keeps crashing, I’m curious who’s managing and overseeing this.

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: Frank Hoogmans @.> Sent: Thursday, August 29, 2024 7:49:12 AM To: home-assistant/core @.> Cc: Airyphyla @.>; Comment @.> Subject: Re: [home-assistant/core] Toon integration stops working every couple of days (Issue #115290)

@gielkhttps://github.com/gielk The only remediation I know of is deleting the integration and re-adding it. This is reasonably quick to do, but annoying since everytime you notice you have data gaps.

I don't have the python and/or home assistant knowledge to figure this out unfortunately

— Reply to this email directly, view it on GitHubhttps://github.com/home-assistant/core/issues/115290#issuecomment-2316764710, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGXI7IS4EZ42LFQW2V7RXFLZT2Y5RAVCNFSM6AAAAABF62LH2OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMJWG43DINZRGA. You are receiving this because you commented.Message ID: @.***>

gielk commented 3 months ago

Just wanted to give an update from my side regarding the Toon integration. After dealing with the constant issues and paying €4 a month for an API that just doesn't work well with this integration anymore, I decided to stop my Toon subscription. It didn’t make sense to keep paying for something that wasn’t reliable.

I ended up sending my Toon to someone on Marktplaats who could root it for me. Within a week, I had it back, fully rooted and reconnected to my Home Assistant setup. Now, everything works perfectly with the Toon integration available through HACS that supports rooted devices. It’s been much more stable—no more restarts or dependencies on unreliable services.

Before rooting, I also noticed that the Toon servers seemed to go down every night for a few hours, which was incredibly annoying. I’m not sure if it was an API issue or something with my internet, but everything else was working fine, so I’m guessing it was the API.

With the rooted Toon, I now have access to more sensors and way more customization options. It’s definitely worth it, and I highly recommend rooting your Toon to avoid all these issues.