Deconz for Hass.io

i installed the @marthocoo add-on but in the Hass.io page I have this error:
500 Internal Server Error Server got itself in trouble

So i reinstalled all from 0, but now I have this error with @gjong version too… I don’t know what to do…

could it be a problem with the new 0.67 ha version?

it should not be an issue with the latest hassio version. I’ve installed it and it is running just fine. Where are you seeing the 500 error in the deconz webapp Or in home assistant.

I’ve been running both marthoc add on as well as my own and they both should work fine.

I see the error in home assistant, and l’uso the deconz configure component doens’t work

But the deconz webapp is working? If so it is not a problem with the add on, but more likely with the home assistant component.

If you go to the deconz webapp can you control your groups, lights and see attached sensors.

Yes it’s working.
Then when i configure the deconz component unlocking the gateway, the configuration of the component fails, and when i go to the addons page of home assistant i get that error

Can you paste the full logs perhaps? Also would help if you enable debug per the component instructions

2018-04-15 14:09:31 INFO (MainThread) [homeassistant.setup] Setting up deconz
2018-04-15 14:09:31 INFO (MainThread) [homeassistant.setup] Setup of domain deconz took 0.0 seconds.
2018-04-15 14:09:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=deconz>
2018-04-15 14:09:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: service=deconz, discovered=host=192.168.1.48, port=8080, ssdp_description=http://192.168.1.48:8080/description.xml, name=Philips hue (192.168.1.48) compatible Wireless Light Control Gateway, model_name=Philips hue bridge 2012, model_number=929000226503, serial=00212EFFFF01723C, manufacturer=Royal Philips Electronics, udn=uuid:71594311-5e6d-4a5f-b629-c7ff1d6d8bdc>
2018-04-15 14:09:31 INFO (MainThread) [homeassistant.loader] Loaded configurator from homeassistant.components.configurator
2018-04-15 14:09:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=configurator, service=configure>
2018-04-15 14:09:31 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: entity_id=configurator.deconz, old_state=None, new_state=<state configurator.deconz=configure; configure_id=1862122992-1, fields=[], friendly_name=deCONZ, entity_picture=/static/images/logo_deconz.jpeg, description=
Unlock your deCONZ gateway to register with Home Assistant.

1. [Go to deCONZ system settings](http://192.168.1.48:8080/edit_system.html)
2. Press "Unlock Gateway" button

[deCONZ platform documentation](https://home-assistant.io/components/deconz/)
, submit_caption=I have unlocked the gateway @ 2018-04-15T14:09:31.580391+02:00>>
2018-04-15 14:09:35 INFO (SyncWorker_13) [homeassistant.components.tado] Querying mytado.com for zone 1 Zona Giorno
2018-04-15 14:09:35 INFO (SyncWorker_13) [homeassistant.components.tado] Querying mytado.com for device 126576 Casa
2018-04-15 14:09:46 INFO (SyncWorker_4) [homeassistant.components.tado] Querying mytado.com for zone 1 Zona Giorno
2018-04-15 14:09:46 INFO (SyncWorker_4) [homeassistant.components.tado] Querying mytado.com for device 126576 Casa
2018-04-15 14:09:53 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 82.50.159.251 (auth: False)
2018-04-15 14:09:54 INFO (MainThread) [homeassistant.components.http.view] Serving /api/themes to 82.50.159.251 (auth: True)
2018-04-15 14:09:54 INFO (MainThread) [homeassistant.components.http.view] Serving /api/translations/en to 82.50.159.251 (auth: True)
2018-04-15 14:09:55 INFO (MainThread) [homeassistant.components.http.view] Serving /api/cloud/account to 82.50.159.251 (auth: True)
2018-04-15 14:09:57 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/app-es5/hassio-app.html to 82.50.159.251 (auth: False)
2018-04-15 14:09:57 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/build-temp/util.js to 82.50.159.251 (auth: False)
2018-04-15 14:09:58 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/supervisor/info to 82.50.159.251 (auth: True)
2018-04-15 14:09:58 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/app-es5/index.html to 82.50.159.251 (auth: False)
2018-04-15 14:09:58 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/host/info to 82.50.159.251 (auth: True)
2018-04-15 14:09:58 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/homeassistant/info to 82.50.159.251 (auth: True)
2018-04-15 14:09:58 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/build-temp/util.js to 82.50.159.251 (auth: False)
2018-04-15 14:09:58 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/supervisor/info to 82.50.159.251 (auth: True)
2018-04-15 14:09:58 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/host/info to 82.50.159.251 (auth: True)
2018-04-15 14:09:58 INFO (MainThread) [homeassistant.components.http.view] Serving /api/hassio/homeassistant/info to 82.50.159.251 (auth: True)
2018-04-15 14:09:59 INFO (MainThread) [homeassistant.components.http.view] Serving /api/websocket to 82.50.159.251 (auth: False)
2018-04-15 14:10:12 INFO (MainThread) [homeassistant.components.http.view] Serving /api/config/entity_registry/configurator.deconz to 82.50.159.251 (auth: True)
2018-04-15 14:10:17 INFO (SyncWorker_1) [homeassistant.components.tado] Querying mytado.com for zone 1 Zona Giorno
2018-04-15 14:10:17 INFO (SyncWorker_1) [homeassistant.components.tado] Querying mytado.com for device 126576 Casa
2018-04-15 14:10:23 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=configurator, service=configure, service_data=configure_id=1862122992-1, fields=, service_call_id=1968058576-20>
2018-04-15 14:10:23 DEBUG (MainThread) [pydeconz.utils] Sending {'auth': None, 'data': b'{"devicetype": "pydeconz"}'} to http://192.168.1.48:8080/api
2018-04-15 14:10:23 DEBUG (MainThread) [pydeconz.utils] HTTP request response: [{'success': {'username': '7DF593F64E'}}]
2018-04-15 14:10:23 INFO (MainThread) [pydeconz.utils] API key: 7DF593F64E
2018-04-15 14:10:23 DEBUG (MainThread) [homeassistant.components.deconz] deCONZ config {'host': '192.168.1.48', 'port': 8080, 'api_key': '7DF593F64E'}
2018-04-15 14:10:23 DEBUG (MainThread) [pydeconz.utils] Sending {} to http://192.168.1.48:8080/api/7DF593F64E
2018-04-15 14:10:23 ERROR (MainThread) [homeassistant.core] Error executing service <ServiceCall configurator.configure: configure_id=1862122992-1, fields=>
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1002, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/configurator.py", line 224, in async_handle_service_call
    call.data.get(ATTR_FIELDS, {}))
  File "/usr/lib/python3.6/site-packages/homeassistant/components/deconz/__init__.py", line 168, in async_configuration_callback
    result = await async_setup_deconz(hass, config, deconz_config)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/deconz/__init__.py", line 99, in async_setup_deconz
    result = await deconz.async_load_parameters()
  File "/usr/lib/python3.6/site-packages/pydeconz/__init__.py", line 58, in async_load_parameters
    data = await self.async_get_state('')
  File "/usr/lib/python3.6/site-packages/pydeconz/__init__.py", line 109, in async_get_state
    response_dict = await async_request(session, url)
  File "/usr/lib/python3.6/site-packages/pydeconz/utils.py", line 54, in async_request
    response = await session(url, **kwargs)
  File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 208, in _request
    raise RuntimeError('Session is closed')
RuntimeError: Session is closed
2018-04-15 14:10:23 INFO (MainThread) [homeassistant.core] Bus:Handling <Event system_log_event[L]: timestamp=1523794223.8892875, level=ERROR, message=Error executing service <ServiceCall configurator.configure: configure_id=1862122992-1, fields=>, exception=Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/core.py", line 1002, in _event_to_service_call
    await service_handler.func(service_call)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/configurator.py", line 224, in async_handle_service_call
    call.data.get(ATTR_FIELDS, {}))
  File "/usr/lib/python3.6/site-packages/homeassistant/components/deconz/__init__.py", line 168, in async_configuration_callback
    result = await async_setup_deconz(hass, config, deconz_config)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/deconz/__init__.py", line 99, in async_setup_deconz
    result = await deconz.async_load_parameters()
  File "/usr/lib/python3.6/site-packages/pydeconz/__init__.py", line 58, in async_load_parameters
    data = await self.async_get_state('')
  File "/usr/lib/python3.6/site-packages/pydeconz/__init__.py", line 109, in async_get_state
    response_dict = await async_request(session, url)
  File "/usr/lib/python3.6/site-packages/pydeconz/utils.py", line 54, in async_request
    response = await session(url, **kwargs)
  File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 208, in _request
    raise RuntimeError('Session is closed')
RuntimeError: Session is closed
, source=components/deconz/__init__.py>
2018-04-15 14:10:26 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/components/light/hue.py", line 162, in async_update_items
    await api.update()
  File "/usr/lib/python3.6/site-packages/aiohue/api.py", line 12, in update
    raw = await self._request('get', self._path)
  File "/usr/lib/python3.6/site-packages/aiohue/bridge.py", line 58, in request
    async with self.websession.request(method, url, json=json) as res:
  File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 783, in __aenter__
    self._resp = await self._coro
  File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 208, in _request
    raise RuntimeError('Session is closed')
RuntimeError: Session is closed
2018-04-15 14:10:26 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/components/light/hue.py", line 162, in async_update_items
    await api.update()
  File "/usr/lib/python3.6/site-packages/aiohue/api.py", line 12, in update
    raw = await self._request('get', self._path)
  File "/usr/lib/python3.6/site-packages/aiohue/bridge.py", line 58, in request
    async with self.websession.request(method, url, json=json) as res:
  File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 783, in __aenter__
    self._resp = await self._coro
  File "/usr/lib/python3.6/site-packages/aiohttp/client.py", line 208, in _request
    raise RuntimeError('Session is closed')
RuntimeError: Session is closed

This is the log, when I try to configure deconz using the configurator, the are many more error like these.
if I disable discovery: and configure manually deconz, then it works. But i lose the hass.io page where can i manage add-ons in home assistant.

It seems that HASS web session never gets created, or gets closed. Since the component depends on that to communicate with deconz. It works to generate the key but doesn’t when setting up the component. Never seen this before…

so what can I do?

Cant you manually configure deconz without disabling discovery?

Something seems weird with session being closed, I guess you can try to disable components to see if that behavior improves

If you disable auto discovery it should not remove the hassio option in the menu. I have never Used the discover feature.

If you disable discovery on Hass.io (by removing discovery: from configuration.yaml), then you must also add hassio: to configuration.yaml or the Hass.io menu option will not appear). :+1:

But I agree with @Robban, you can manually configure deconz without disabling discovery.

Ok I have added again discovery: with deconz configured manually and it’s all ok now.

thank you all for support

1 Like

Hi
Thank you for your support. Time to report :slight_smile:

After a lot of hours, I got deconz-hassio working ok. This is what I did:

  • upgraded conbee / deconz by putting conbee in my windows machine (upgrade firmware etc not working in hassio-addon). Then put the stick back in my hassio NUC.
  • Before successful connection, I tried to connect after a lot of tries per gadget. Most gadgets i got a working connection by using old webinterface (deconz) using touchlink + simultaneously using phoscon app to add them.
  • I had to reset, then trigger the devices by using different buttons/triggers. For example xiaomi water leak sensor, I had to put in water (it didnt work to just press button).

Now using as addon to my knx setup: conbee +

  • Multi-sensors (aqara)
  • IKEA tradfri remote
  • motion-sensors (aqara)
  • water leak sensors (aqara)
  • switch buttons (aqara gen 1 and gen 2)
  • fire/smoke detectors (Honeywell/xiaomi)

Best
/PH

I was fiddling around with some other stuff in the component and saw that it is closing the session when done getting the api key… I made a change to the code but forgot to remove that part…

I will create a fix for this tomorrow.

Great, thank you

PR is up: https://github.com/home-assistant/home-assistant/pull/13960

Aaaaand it’s done.

thanks Robban.

How should I update the component?

Just wait for next hass release, or go to beta channel https://rc.home-assistant.io/blog/2018/04/20/release-68/

Bump deCONZ requirement to v36 (@Kane610 - #13960) (deconz docs)

I have the same issue with the 500 internal server error. How do I manually configure deconz?