Category Archives: Uncategorized

Zigbee2MQTT on HomeAssistant in Docker with Supervisor and custom Devices.js

As usual with anything even remotely related to Linux – nothing is ever simple. I recently got a Raspberry Pi 4 8GB and wanted to install Home Assistant. I believe I did successfully install Home Assistant at least 4 different ways before deciding that the ‘Officially Unsupported’ ‘Supervised’ Raspbian install was what I was looking for. This allowed me to continue using the Raspbian GUI, but also allowed for Supervised Home assistant.

That install has been working fine, however, I’ve just bought a Tuya Zigbee Thermostatic Radiator Valve (TRV) from EBay and wanted to try to integrate it with Home Assistant. The one I bought doesn’t appear to be currently supported by Zigbee2MQTT library, however there are plenty of other Tuya TRVs which are.

So, I believe I need to set up a custom devices.js file. Which there are a lot of instructions for, none of which described my home assistant set up exactly. So – down the rabbit hole we go.

Ok – After many hours of browsing, attempting different configurations and general head banging – it turns out that there’s a bug in the latest version of Zigbee2MQTT (1.16.1) which causes it not to read the ‘devices.js’ file correctly. Which means the first way I tried would have worked, had I known there was a bug… Oh well. This is the second time a bug in HA/addons has royally confused me for hours before realising it wasn’t me

So, now the steps appear to be relatively simple – at least for the moment.

Step 1

Uninstall Zigbee2MQTT and install the ‘Edge’ version which is the latest dev version

Step 2

Create a ‘YOURDEVICENAME.js’ file in /usr/share/hassio/share/zigbee2mqtt (this is easy if you’ve already got SAMBA enabled, then it’s just \share\zigbee2mqtt) and copy the contents from one of the example files here (you can also follow the instructions from here from now I believe)

Step 3

Add the following to your Zigbee2MQTT Configuration:

  log_level: debug

Restart Zigbee2MQTT

Step 4

Go to the Zigbee2MQTT Log and read the messages, you’ll probably see something like:

Zigbee2MQTT:debug 2020-11-30 22:50:28: Received MQTT message on 'zigbee2mqtt/bridge/config' with data '{"commit":"15d04ed","coordinator":{"meta":{"maintrel":3,"majorrel":2,"minorrel":6,"product":0,"revision":20180507,"transportrev":2},"type":"zStack12"},"log_level":"debug","network":{"channel":11,"extendedPanID":"0xdddddddddddddddd","panID":6754},"permit_join":true,"version":"1.16.1-dev"}'
Zigbee2MQTT:info  2020-11-30 22:50:28: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"commit":"15d04ed","coordinator":{"meta":{"maintrel":3,"majorrel":2,"minorrel":6,"product":0,"revision":20180507,"transportrev":2},"type":"zStack12"},"log_level":"debug","network":{"channel":11,"extendedPanID":"0xdddddddddddddddd","panID":6754},"permit_join":true,"version":"1.16.1-dev"}'
Zigbee2MQTT:debug 2020-11-30 22:50:30: Received Zigbee message from '0x5c0272fffef143a4', type 'commandSetTimeRequest', cluster 'manuSpecificTuya', data '{"payload":[],"payloadSize":0}' from endpoint 1 with groupID 0
Zigbee2MQTT:warn  2020-11-30 22:50:30: Received message from unsupported device with Zigbee model 'TS0601' and manufacturer name '_TZE200_fhn3negr'
Zigbee2MQTT:warn  2020-11-30 22:50:30: Please see:
Zigbee2MQTT:debug 2020-11-30 22:50:36: Received Zigbee message from '0x5c0272fffef143a4', type 'commandSetTimeRequest', cluster 'manuSpecificTuya', data '{"payload":[],"payloadSize":0}' from endpoint 1 with groupID 0
Zigbee2MQTT:warn  2020-11-30 22:50:36: Received message from unsupported device with Zigbee model 'TS0601' and manufacturer name '_TZE200_fhn3negr'
Zigbee2MQTT:warn  2020-11-30 22:50:36: Please see:

Above you’ll see that it’s recognising a device called the TS0601, which appears to be a generic name for Tuya compatible devices. This and the manufacturer name are useful information for you to be able to ‘fingerprint’ the device.

Step 5

I started to follow the instructions on this page for adding a Tuya device. However, with their example device configuration I got an error on the tuya.SetTime line, so I commented it out for now

    onEvent: tuya.setTime, // Add this if you are getting no converter for 'commandSetTimeRequest'
ReferenceError: tuya is not defined

This allowed the Zigbee2MQTT plugin to finally start up with my custom configuration and start giving me the debug info I need to follow the instructions for setting up a new Tuya device

Failed Attempt #3

Step 1 (read Step 2 first)

Install Portainer according to these instructions (first time I ran the command it didn’t work, tried again, and it worked…)]

Once installed, navigate to http://YOURIP:9000 to load up the Portainer interface

Step 2

Find my Zigbee2mqtt docker container ‘data’ directory by browsing through my portainer Containers, and to Zigbee2MQTT. Mine was located at /usr/share/hassio/addons/data/7ad98f9c_zigbee2mqtt. So perhaps you could skip step 1 and try navigating to here directly.

Step 3

Identified the correctly compatible version of a donor ‘devices.js’ file by following the instructions here

Navigated to /usr/share/hassio/addons/data/7ad98f9c_zigbee2mqtt and Ran wget

to copy the devices.js file in to my data directory. Gave up here – this didn’t do what I expected, and then after more researching, found it was a bug in Zigbee2MQTT – see instructions above

FIXED: Windows 10 Logitech MK850/M720 Triathlon Mouse Freeze/Unresponsive

I have just bought a new Logitech MK850 keyboard and mouse combo – primarily for the multiple device support – and so far so good (The keyboard is a little mushy though – especially the backspace key, but hoping I’ll get used to it).

However – one problem I did find was that when sometimes, when my PC was either heavily loaded or reading a lot of data from internal disk, the mouse would and keyboard would freeze and become unresponsive.

I’m using the Unifying receiver in this case, and have it plugged into a USB 3.0 Hub port on the front of my PC. Searching online appeared showed a thread where someone had a similar issue, and suggested making sure it’s plugged in to a USB 2.0 not USB 3.0 port on the PC. I’ve just moved the port, at this appears to fix it!

TLDR; Plug into a USB 2.0 port, not a USB 3.0 port!

UPDATE 03/09/2020
My freezing and unresponsive issues seem to have returned, but I don’t know what I’ve changed. I’ve now tried moving the unifying dongle from the USB port in the front hub to the rear instead, but that doesn’t appear to have fixed the issue.