Toon (eneco) integration with Home Assistant

Hello,

I’ve tried several times to get Toon to work, but I can’t get it to work.

In developper toon I put in the Callback URL http://192.168.1.**:8123/auth/external/callback

But nothing makes it so it sends me back to an error of the type: 500 Internal Server Error
Server got itself in trouble

Thank you for your help

Logger: aiohttp.server
Source: components/toon/oauth2.py:134 
First occurred: 15:28:30 (2 occurrences) 
Last logged: 15:29:00

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 418, in start
    resp = await task
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_app.py", line 458, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.7/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/real_ip.py", line 39, in real_ip_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 73, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 136, in get
    return await super().get(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 92, in get
    result = await self._flow_mgr.async_configure(flow_id)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 201, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/helpers/config_entry_oauth2_flow.py", line 259, in async_step_creation
    token = await self.flow_impl.async_resolve_external_data(self.external_data)
  File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 104, in async_resolve_external_data
    return await self._token_request(data)
  File "/usr/src/homeassistant/homeassistant/components/toon/oauth2.py", line 134, in _token_request
    resp.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 946, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 404, message='Not Found', url='https://api.toon.eu/token
1 Like

I’ve got the same callback error when trying to connect with Toon!

Any updates on the integration? Should it work fine and am I doing anything wrong or are there still issues persisting?

It works for me, but I had to do a couple of tries before the configuration completed all the way. I had the same error message: Server got itself in trouble.

What worked for me was two callback URLs in the Toon developer app settings, separated by a comma: https://192.168.1.x:8123/auth/external/callback as well as https://my_external_url:8123/auth/external/callback. (I’m not sure if this second one was actually needed, but it didn’t hurt.)

Then I used https://192.168.1.x:8123 to access the HA user interface and run the Toon configuration.

Hope this helps!.

Tried it but does not work, Home Assistant just says “Afgebroken”. I tried creating a new app and adding both urls to the callback but nothing seems to work.

Also I have to mention that I only have a subscription with Toon and not get electricity from Eneco. (Eneco creates different account settings for Toon only accounts)

I cannot create an account on Toon api https://developer.toon.eu/user/register
I think something is wrong in their side. Has anyone managed to create an account recently?

Does anybody know how to setup this integration. I can use the API and all in postman. But when I try to setup the integration the requested redirect_uri does not match any of the whitelisted redirect_uris on the Toon developer page. I’m currently using https://192.168.1.231:8123/auth/external/callback as callback url. Any suggestions on how to make this work?

1 Like