DeCONZ, ZHA and Zigbee components and compatible hardware

Do they update value in deconz software? I’ve read that certain sensors doesn’t update unless values, e.g. temperature change.

1 Like

Yes they do change in Deconz. Home Assistant can run for 4 days without the values updating in Home Assistant, but they do update in deconz.

Can you enable debug through the logger component and collect some logs?

1 Like

Sure, how do I do that specifically?
From Logger - Home Assistant :

service: logger.set_level
data:
homeassistant.deconz : debug

Or what is the component named?
Thanks!

You can find multiple names from this log

1 Like

I would try to debug first by setting, in configuration.yaml:

logger:
  default: critical
  logs:
    pydeconz: debug
    homeassistant.components.deconz: debug

Then restart Home Assistant, log into your box over SSH, change to your config dir, and type:

tail -f home-assistant.log

The logger options will quiet your logs except for deconz related activity. The tail command will print the log output to your terminal console. Now I’d watch the output: when the sensor updates in the deconz web GUI, do you get any output from pydeconz on the home Home Assistant console? If you don’t, it might be the case that the deconz websockets plug-in isn’t sending an update when it should, which would be an issue to raise on the deconz rest API repo. If you do see output from pydeconz, then @Robban will likely need the log output to help debug further.

1 Like

OK, thanks guys I think we are on to something here. Do you know what might cause this?

e[36m2018-02-15 14:28:48 DEBUG (MainThread) [pydeconz.websocket] Got exception [Errno 110] Connection timed oute[0m
e[36m2018-02-15 14:28:48 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.e[0m

https://pastebin.com/cqmQaTHV

That would mean the port for your web socket is wrong. It is automatically reported by deconz to the component so there is no configuration option here. You can see in the config response from deconz during setup what web socket port is reported.

How are you running deconz?

1 Like

I figured out the issue. Websocket was running on port 443. I am running deconz in a ubuntu server vm, with firewall enabled. Had to open the port in the vm’s firewall and now it’s working! Thank you!

e[36m2018-02-15 14:09:56 DEBUG (MainThread) [pydeconz.utils] Sending {} to http://192.168.1.93:8080/api/**e[0m
e[36m2018-02-15 14:09:56 DEBUG (MainThread) [pydeconz.utils] HTTP request response: {‘config’: {‘UTC’: ‘2018-02-15T13:09:56’, … ‘websocketnotifyall’: True, ‘websocketport’: 443,

1 Like

Great that it worked out for you!

Are there any possibilities/plans to have hass detect new/modified devices from deconz without restarting? I have a fairly large setup (45 lights + 10 sensors or so), and I keep running into issues that device are ‘lost’ as they were not turned on whenever deconz was restarted for example. Once the devices power on, deconz finds them no problem, but that information is never propagated to hass (and homebridge-homeassistant for that matter).

I’ve been digging in the hass deconz module source code a bit, but don’t really see a place where this could be added? The deconz websocket does seem to ‘emit’ these type of events, but instead of device state, it’s propagated as an event like this:

{
  "e": "deleted",
  "id": "7",
  "r": "sensors",
  "sensor": {
    "id": "7"
  },
  "t": "event"
}

Hmm. Just discovered that the payload differences are an artifact of the fact I was using the dc_eventlog util to look at websocket events. Original question still stands though :slight_smile:

The way the Wink component handles this (as an example) is to provide a service that can be called to fetch new devices, refresh devices, etc. Something similar could be added to deconz pretty easily I think.

Ive been thinking about it for a few weeks and will probably add support for it. There is just a few other things I need to get done at home first. Then when I start to add new lights I will make sure to fix this as well.

I think that deconz sends out a added signal when a new device gets added.

I will probably need to register a new callback to pydeconz that can receive signals on new web socket data.

Yes, deconz does emit an event on the websocket if a new device shows up.

In other news, just upgraded to 0.64.3 from 0.63. As a result, none of the deconz managed lights show up in the web interface. Automations still work though. The log file is littered with entries liek this:

Mar 04 09:14:42 raspy3 hass[25377]: AttributeError: 'DeconzLight' object has no attribute 'deconz_id'
Mar 04 09:14:42 raspy3 hass[25377]: 2018-03-04 09:14:42 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Mar 04 09:14:42 raspy3 hass[25377]: Traceback (most recent call last):
Mar 04 09:14:42 raspy3 hass[25377]:   File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
Mar 04 09:14:42 raspy3 hass[25377]:     result = coro.send(None)
Mar 04 09:14:42 raspy3 hass[25377]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 266, in _async_add_entity
Mar 04 09:14:42 raspy3 hass[25377]:     yield from entity.async_added_to_hass()
Mar 04 09:14:42 raspy3 hass[25377]:   File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
Mar 04 09:14:42 raspy3 hass[25377]:     res = func(*args, **kw)
Mar 04 09:14:42 raspy3 hass[25377]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/light/deconz.py", line 66, in async_added_to_hass
Mar 04 09:14:42 raspy3 hass[25377]:     self.hass.data[DATA_DECONZ_ID][self.entity_id] = self._light.deconz_id

I scanned the readme for required changes, but couldn’t find anything related.

Ideas?

Have the dependency been properly installed? It should be v30.

That did the trick. Thanks.

I’ve had several issues since upgrading to 0.66.0. One of them is that I’m no longer seeing any button events for my Xiaomi Cubes and Xiaomi WIreless Remotes.

My temp Xiaomi temp sensors are still sending and my IKEA Trådfri lights are working. Anyone else having similar issues?

All devices are reachable.