Linking Xiaomi smart switch to Deconz

Remotes and buttons are only represented as events. If they report battery you can get a battery sensor as well

where and how would i see those events ? Sorry for dumb question

Check the documentation. If that doesn’t help post here again

compionent description?

I managed to make it work. I didn’t see at first that buttons were only represented as events. For the round Xiaomi switch the battery is not reported. (also not for the other Xiaomi components)

There’s no deconz in my events. Is it supposed to show up there?

Thats not exactly the same thing, you see that there are listeners. I guess if you would create an automation that listens for the specific deconz event it would pop up. But you don’t see producers, only consumers

Well how would I know what event belongs to what device? If home assistant listens yo events then it should be able to show them. In the logs? I mean that’s what I assume. Had Tue same issue with the cube . I mean we must be able to read out those events aren’t we?

Yes, they are visible in the logs

1 Like

I managed to find the events with the configuration below. This gives also a lot of unrelated feed.

Does anyone know a better solution?

logger:
  default: warning
  logs:
  homeassistant.components.api: debug

EDIT: For me the solution was command:
$ tail -f home-assistant.log | grep deconz_event

I’m struggling a bit with the Deconz component on Hassio 0.61.1.

I’ve got Deconz (2.05.00) up and running and have connected a couple of motion sensors (Tradfri and Hue), a Tradfri dimmer and two square Aqara wireless switches.

I’ve been using Node-Red to interface these into Hassio connecting to the Deconz API. This is working but is cumbersome to maintain, so I was hoping to use the new Deconz component instead.

After adding deconz: to my config and configuring the API I can see the two motion sensors being added, but they are never updated. Also the dimmer and switches does not generate a ‘deconz_event’. I made tcpdump on the Deconz server when starting Hass, and I saw an initial request to /api/ which is successfull, but after that no further data is sent.

Using Node-Red I can see that the Deconz API is working fine sending the proper data over the websocket.

Is there a way to get debug logging from the Deconz component? I’ve tried to add:

 logger:
   default: warning
   logs:
      homeassistant.components.deconz: debug

But nothing seems to appear in the log.

What if you enable system wide debug?

I tried that as well, and that did generate a lot of output. Unfortunately the only Deconz related was homeassistant loading the component…

Well it is weird if you get the devices set up but no updates.

Would you mind posting the log?

I found the correct syntax to get debug from only the deconz component. Instead of:
homeassistant.components.deconz: debug
I found that this works:
pydeconz: debug

I now see that I get this:

2018-01-27 19:13:39 DEBUG (MainThread) [pydeconz.websocket] Got exception [Errno 110] Operation timed out
2018-01-27 19:13:39 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.
2018-01-27 19:13:54 DEBUG (MainThread) [pydeconz.websocket] Got exception [Errno 113] Host is unreachable
2018-01-27 19:13:54 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.
2018-01-27 19:16:16 DEBUG (MainThread) [pydeconz.websocket] Got exception [Errno 110] Operation timed out
2018-01-27 19:16:16 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.
2018-01-27 19:17:34 DEBUG (MainThread) [pydeconz.websocket] Got exception [Errno 113] Host is unreachable
2018-01-27 19:17:34 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.
2018-01-27 19:17:50 DEBUG (MainThread) [pydeconz.websocket] Got exception [Errno 113] Host is unreachable
2018-01-27 19:17:50 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.
2018-01-27 19:18:05 DEBUG (MainThread) [pydeconz.websocket] Got exception [Errno 113] Host is unreachable
2018-01-27 19:18:05 DEBUG (MainThread) [pydeconz.websocket] Reconnecting to deCONZ in 15.

Full deconz debug output here: https://pastebin.com/raw/jr91Ewz0

So the websocket doesn’t start for some reason. How is your system set up?

It’s a Pi running hass.io (0.61.1), so there’s not really much customization possible. Anything in particular you were thinking about?

Are you running deconz on the same pi? Is the 443 port freely available?

Deconz is running on a separate Pi.

I have Node-Red running as an addon on the Hass.io machine, and it connects to the Deconz websocket and receives updates. I’ve also connected to the the Deconz websocket from other machines and seen updates.