DeCONZ / Home Assistant: can't get it going with Node Red

Hi,

I've been struggling with this for over a week now, but can't get it running. I'll try to be as complete as possible.

First of all: I have DeCONZ working in Home Assistant now, with a ConBee II USB dongle. This took a mere four days... This means that both the DeCONZ addon and the Phoscon/DeCONZ integration are up and running. I have one Aqara vibration sensor, which works in Home Assistant.

Settings
DeCONZ:
device: >-
/dev/serial/by-id/usb-dresden_elektronik_ingenieurtechnik_GmbH_ConBee_II_DE2220748-if00

40850/tcp deCONZ API backend
5900/tcp deCONZ via VNC
8081/tcp deCONZ WebSocket

I then added the node-red-contrib-deconz nodes in Node Red. It proved to be impossible to get an API key using the Magick get settings button, but I found the key in the log and added it.
After some fiddling, where I kept getting "connection refused" errors, I'm now at a point where I'm getting:

Screenshot_2020-09-07_13-21-10

My settings for the config node are:

Refresh devices doesn't work.

Tail end of the DeCONS addon log (after trying refresh devices):
13:25:02:949 don't close database yet, keep open for 900 seconds
13:25:02:955 Remove websocket 192.168.178.38:40726 after error Unknown error
13:25:02:956 New websocket 172.30.32.1:53924 (state: 3)
13:25:19:763 don't close database yet, keep open for 900 seconds
13:25:19:771 New websocket 192.168.178.38:40752 (state: 3)
13:25:53:933 don't close database yet, keep open for 900 seconds
13:25:53:941 Remove websocket 192.168.178.38:40752 after error Unknown error
13:25:53:943 New websocket 192.168.178.38:40764 (state: 3)
13:25:53:965 Current channel 15
13:25:53:973 Device TTL 3752 s flags: 0x7
13:26:16:297 don't close database yet, keep open for 900 seconds
13:26:16:304 Remove websocket 192.168.178.38:40764 after error Unknown error
13:26:16:960 New websocket 192.168.178.38:40802 (state: 3)
13:26:46:239 don't close database yet, keep open for 900 seconds
13:26:46:248 Remove websocket 192.168.178.38:40802 after error Unknown error
13:26:46:249 New websocket 192.168.178.38:40810 (state: 3)
13:26:46:263 Current channel 15
13:26:46:271 Device TTL 3700 s flags: 0x7

Tail end of the NR log (after trying refresh devices):
7 Sep 13:25:02 - [warn] [deconz-server:ConBee II] WebSocket connection timeout, reconnecting
7 Sep 13:25:19 - [info] [deconz-server:ConBee II] WebSocket opened
7 Sep 13:25:32 - [warn] [deconz-server:ConBee II] WebSocket connection timeout, reconnecting
7 Sep 13:25:53 - [info] [deconz-server:ConBee II] WebSocket opened
7 Sep 13:26:06 - [warn] [deconz-server:ConBee II] WebSocket connection timeout, reconnecting
7 Sep 13:26:15 - [info] [deconz-server:ConBee II] discoverDevices: Using cached devices
[07/Sep/2020:13:26:15 +0200] 200 192.168.178.164, 172.30.32.1(172.30.32.2) GET /deconz/itemlist?controllerID=7440a617.3347e8&forceRefresh=false HTTP/1.1 (Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0)
[07/Sep/2020:13:26:16 +0200] 200 192.168.178.164, 172.30.32.1(172.30.32.2) GET /deconz/itemlist?controllerID=7440a617.3347e8&forceRefresh=true HTTP/1.1 (Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0)
[07/Sep/2020:13:26:16 +0200] 200 192.168.178.164, 172.30.32.1(172.30.32.2) GET /deconz/itemlist?controllerID=7440a617.3347e8&forceRefresh=true HTTP/1.1 (Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0)
7 Sep 13:26:16 - [info] [deconz-server:ConBee II] WebSocket opened
7 Sep 13:26:29 - [warn] [deconz-server:ConBee II] WebSocket connection timeout, reconnecting
7 Sep 13:26:46 - [info] [deconz-server:ConBee II] WebSocket opened
7 Sep 13:27:09 - [warn] [deconz-server:ConBee II] WebSocket connection timeout, reconnecting
7 Sep 13:27:28 - [info] [deconz-server:ConBee II] WebSocket opened
7 Sep 13:27:41 - [warn] [deconz-server:ConBee II] WebSocket connection timeout, reconnecting
7 Sep 13:27:53 - [info] [deconz-server:ConBee II] WebSocket opened
7 Sep 13:28:06 - [warn] [deconz-server:ConBee II] WebSocket connection timeout, reconnecting
7 Sep 13:28:32 - [info] [deconz-server:ConBee II] WebSocket opened

Can anyone help me out here?

Why not just connect Node Red to Home Assistant and work with the relevant entity_id devices it found from deCONZ?

I have Node Red running as an add-on in Home Assistant, so it's connected.

Then I created this flow:
Screenshot_2020-09-09_10-01-34

I used it to setup the server node (screenshot above), then clicked 'Refresh devices' in the Test node:
Screenshot_2020-09-09_10-02-13

But I don't get any devices, logs as shown above.

The Node Red <-> Home Assistant connection is working fine, I have no problem with my ZWave devices, but somehow I don't get any devices from DeCONZ.

What I'm suggesting is to use the HA nodes instead of integrating Node Red to deCONZ. Meaning you would uninstall node-red-contrib-deconz (it would be used by people that don't use HA). Then you can use the events HA nodes to trigger a Node Red flow when the Aqara sensor fires an event.

This means that Node Red only needs to know about HA, and doesn't need to care whether devices are Zigbee, ZWave, Wifi, etc. HA does the work of mapping all of these to entities for you to use in Node Red.

Good tip! I tried this and it works, thanks a lot!