Of course – this could all be down to my age – but I find Zigbee in practice to be both exciting and confusing. I am currently supposed to be reviewing some devices from ZemoSmart.
So, the Zemismart company sent me one of their nice warm/cool E27 lamps and a nice 6-way switch to the UK where I am temporarily working (some might call it playing). So, really, all I had to do was replicate my Spanish Raspberry Pi4 + Node-Red + Zigbee setup which you’ll find referred to elsewhere in this blog channel – several times.
The lamp and switch arrived this week gone – but the HUB (to talk to the Zigbee 3.0 lamp and switch) won’t be here unti December. Life is FAR too short, so I sat down and thought “I have everything here that I have in Spain except for the Zigbee setup” and decided to do a quick install of the Zigbee2MQTT software on my UK RPi4. Easy, yes?
Now bearing in mind that I use RPI-CLONE to get me out of a mess so I can tinker freely with the installation (which controls the house heating and lighting). I knew I’d brought my new Sonoff Zigbee 3.0 USB Dongle Plus with me to the UK, along with a USB extension lead, so that getting the RPi4 to talk to Zigbeen devices should be a snap, right?
I should have know it was going to be a difficult couple of days when, after careful cgecking for mistakes, I put that Zigbee2MQTT link into my Chrome browser and it came back with an error box, can’t connect to this site. I tried another browser (Microsoft Edge) – different box, same error. I contacted a couple of friends on Discord and sent them the link – in both cases it worked. I switched my Vodafone broadband to my mobile phone hotspot, it worked – but I can’t do home control that way as the address range is different).
I made a copy of the main Zigbee2MQTT page and left it in a browser window. The installation instructions are good but for one thing. They want you to press a link to install NODEJS on your computer before proceeding to the next step. It transpires that my months’ old Node-Red installation was using a NodeJS that is no longer supported. The short version to follow is that I did a manual update of Node-Red and am now fully up to date with NODEJS. The end result of that is that I was able to install Zigbee2MQTT. There’s a default configuration on the web page which is JUST sufficiently wrong to stop my Sonoff dongle working. Thankfully I could VPN to my working installation overseas and grab the configuration file from that – almost identical – and that works.
SO, now, with my Sonoff dongle plugged into the RPi4 I could hook up the MQTT nodes and see it doing something. For those of you who might be in a similar sitiation, here is my Zigbee2MQTT configuration file.
homeassistant: false permit_join: true mqtt: base_topic: zigbee2mqtt server: mqtt://localhost user: admin password: xxxxxxxxx serial: port: /dev/ttyUSB0 adapter: auto advanced: rtscts: false log_level: info pan_id: 51966 homeassistant_legacy_entity_attributes: false legacy_api: true experimental: new_api: true frontend: port: 9099 device_options: legacy: true devices: '0x00158d00xxxxxxx': friendly_name: aqara-temp-02 '0x54ef441xxxxxxxxx': friendly_name: tvoc '0xb4e3f9ffxxxxxxxx': friendly_name: zemismart-lamp '0x0c4314ffxxxxxxxx': friendly_name: zemismart-6-button '0x000d6ffffxxxxxxx': friendly_name: tradfree repeater '0xec1bbdfffxxxxxxx': friendly_name: tradfree switch
Clearly I’ve changed the password above to protect the innocent (me). Otherwise that is the eact file that sits in /opt/zigbee2mqtt/data/configuration.yaml
Tempting as it is to drop into Node-Red in a PC browser, I’m having a little issue there, too, thankfully to SOME extent, Zigbee2MQTT is self-sufficient thanks to a great web interface (see new_api above). I went to my RPi via my web browser on port 9099 (you could make that any spare port). Having the dongle confirm it’s existence is all very well but the point is to actually do some control and/or sensing of course. And with that, in the above mentioned web interface, I added some devices, firstly one I know works (a LOVELY Aqara temperature sensor).
What you see above is the browser-based Zigbee2MQTT Dashboard – see the devices called TVOC, AQARA-TEMP-01, ZEMISMART-6-BUTTON and ZEMISMART-LAMP (and more – I keep updating this)
These were added by holding in their respective buttons (one device at a time) while the Dashboard had “Permit JOIN” set. After a few seconds, each device magically appeared on the dashboard,
Is that it? Yes but then you need to DO something with them. The Zemismart-6-button device, when clicked, shows itself but says “not supported” (as does the Ikea switch) so that’s out until I get the Zemismart hub – but to be honest it was disappointing that it does not work with Zigbee2MQTT – which knows it exists but that’s about it. let’s turn to the Zemismart LAMP. My multi-use Aquara wall buttons DO work with Zigbee2MQTT.
If I click on the lamp, then the EXPOSES tab – immediately it all becomes clear – the lamp is giving out info about itself, it’s state and what you can do to it – to turn it on or off (and monitor that state) and to define the brightness, colour temperature (cool to warm) (including the required state at power up -and more – enough to keep a person busy all night just learning but this would be a very long blog as I just discovered this moments ago. Suffice it to say that while the ZemiSmart light is not cheap, it is “typical 60w-equivalent lighting” (maybe a little lower but good for a desktop lamp) – they claim and completely controllable without having to use their “Hub”.
While I’m here, I’ve already covered my Aqara TVOC Air Quality unit and temperature sensor elsewhere so I won’t labour the point- but they worked immediately as did the lamp. Of course – none of these units had sensible names at first, just long IDs – that’s what Zigbee does. For example, a click on the ABOUT tab then edit button allowed me to permanently give the lamp a friendly name. All of this gets stored automatically in that configuration file I mentioned earlier which is now much longer than it was at first.
As off Nov 25, 2021 (when I found my IKEA repeater and added that – not relevant but handy) – thanks to a comment by subscriber Ian Cleghorn and changing LEGACY_API to TRUE as above, The NR nodes now work correctly… I just have the Ikea switch and ZemiSmart multi-switch to sort – feel free to comment….