Hue Light Bar, Hue Go and Domoticz and Zigbee2MQTT

Hue Light Bar, a Christmas present. And a Hue Go V2. New lamps, welcome in the family. Bluetooth and Zigbee.

Bluetooth, a (bit unfriendly and limited) app. OK, but not what I want. Zigbee, to add to Domoticz.

Turned out to be a challenge.

Pairing. How to get this Hue to get into pairing mode? No button, no ‘magic’ on/off sequence. The official documentation talks about the Hue Bridge or Dimmer, which I do not have (or want to have). Bluetooth control worked fine, but there also no (working) way to enter Zigbee pairing
So check the wonderful Zigbee2MQTT documentation and there Touchlink is documented. I had already setup the Zigbee2MQTT frontend (see the documentation, an addition to the config file) at port 9090.
There you find a Touchlink tab.
– Select Scan while having the Light Bar switched on close to the controller.
– After some scan time the Light Bar and Go appeared.
– Now press Factory Reset button at the  right at the device line. Also allow devices to join (in the front end and in Domoticz settings just to be sure).

Update Zigbee2MQTT was required in the pairing step. My one year old Zigbee2MQTT did not do the pairing, after a quick update (see again the zigbee2MQTT documentation) to the latest version paring succeeded and the device showed up in Domoticz. Actually two, the On/Off is the one you want, the effects one is less interesting.

Restart everything to make sure all is working and I have the Light Bar  and Gov added to the Domoticz world.

Note that I am still on the 2021.1 latest official Domoticz version and therefore and the last version of the plugin Zigbee2MQTT that supports that (see the GITHUB page for that). The latest does not run on stable and requires beta, which I do not want to run of course. I can live for now with the not so relevant errors in parsing Zigbee MQTT info, it works fine.


Zigbee and Domoticz

Part 2 of the Domoticz project: Zigbee devices added.
The living room now has 4 Domoticz Zigbee lights!


Zigbee and Domoticz

After the installation and configuration for Domoticz with RFLINK and P1 Smartmeter and Bresser Weatherstation hr real home automation started with adding Zigbee devices to the system.

On my wish list were of course light switches and environment sensors like temperature, humidity, presence/movement detection, light (lux).
Now there are many high quality and affordable Zigbee devices on the market, so far so good. A reliable system which gains popularity fast.

Domoticz support for Zigbee devices is not native, it requires plugins and more. The MQTT system has to be used, with an MQTT broker and the Zigbee2MQTT software.
MQTT (Mosquitto is the preferred product on a Raspberry Pi) is the backbone for many home automation solutions, not limited to Zigbee, I may need it for Tasmota integration also.

Zigbee integration has to be done with Zigbee2MQTT, software combined with hardware to access the Zigbee mesh network as Coordinator. Also widely used in home automation, mostly with a Zigbee USB stick as hardware, making it manufacturer independent, no need for limited bridges etc by Zigbee manufacturers as Philips Hue etc.
The list of supported Zigbee devices is limited in Zigbee2Mqtt, but most popular ones are there.

Getting the Zigbee devices into Domoticz uses a plugin called Zigbee2MQTT – Domoticz Python Plugin
The list of supported Zigbee devices is even more limited in Zigbee2Mqtt, a severe limitation!
CHECK THIS LIST FIRST BEFORE BUYING Zigbee hardware. Support of the plugin is one mans evening hobby and therefore slow and limited!
I made the ‘error’ of buying the (quite unique) AduroSmart ERIA smartplug dimmer, supported in Zigbee2Mqtt, but not in Zigbee2MQTT – Domoticz Python Plugin. I made a github issue for support the ‘new device’, but it may take long or never to get support.

Step 1: MQTT Mosquitto

Install following this guideline.
Do also the tests. Note that this installs Mosquitto without much security! Fine for local usage.

Step 2: zzh! CC2652R Multiprotocol RF Stick

I choose the modern zzh! CC2652R Multiprotocol RF Stick, a tiny “USB stick” form-factor development board for multiprotocol RF tinkering! Designed and sold on Tindie by Electrolama in United Kingdom. Easy to add firmware, no special programmer hardware, excellent range.

First step is to add the hardware to a Zigbee network from the Pi. The excellent zzh! CC2652R Multiprotocol RF Stick does the job nicely.

Install the firmware folllowing the Flash Guide and the Coordinator Firmware

First on the Raspberry Pi perform the next command:

ls /dev

and note the ttyUSBx devices. The P1 Smartmeter was ttyUSB0.
Now insert the USB Zigbee stick in the Raspberry Pi (power off and insert the stick, then power on) and do this again:

ls /dev

and note the newly ttyUSBx device, ttyUSB0 ea=nd ttyUSB1, the USB Zigbee stick or the P1 SMartmeter.
If more than one ttyUSBx is attached the Raspberry Pi will randomly give it a sequence number at boot, so ttyUSB0 can become ttyUSB1 and prevent your home system from working.
Therefore find out the id of the port.

ls-l /dev/serial/by-id

and copy the part belonging to the USB stick, for me: usb-1a86_USB_Serial-if00-port0 for the next step.

Step 3: Zigbee2MQTT

Zigbee2MQTT is the toolset required.
With the correct serial port in use identified, edit your Zigbee2mqtt configuration.yaml with that information (scroll down in the editor, the instructions are a bit unclear here!

  port: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0

You see the USB Zigbee stick working if you followed the instruction guide to the letter.

Step 4: Zigbee2MQTT – Domoticz Python Plugin

Python plugin for Domoticz to add integration with zigbee2mqtt project. This the part where Domoticz gets the Zigbee devices.

Install following the instructions on the github page and reboot Domoticz (better restart from Domoticz, so you know it works after a reboot!).
In Domoticz you now get an extra tab, called Custom, with Zigbee2MQTT as page and a new Hardware type Zigbee2MQTT. Check the settings, if no security and local MQTT then leave most fields.

(May 11 2021) I had to restore to an older version, before the commits to humidity/temperature/pressure which also broke the WSDCGQ11LM sensors.

git reset --hard b708fc4

Step 5: Add Zigbee devices, pairing

Now power on Zigbee hardware, in a process called pairing. Get the Zigbee device in factory mode, as it is after first ever power on, or pressing buttons. See the docuumentation, every device does it differently.
Allow new hardware on the Settings page “Accept new Hardware Devices Allow for 5 Minutes”
Zigbee devices are entered into Zigbee2MQTT automatically if you check “Allow new zigbee devices to join” on the Domoticz Zigbee2MQTT page, keep that page open!

Refesh and Zigbee hardware will appear in the list. Click in this list on a newly added Zigbee hardware and see the devices you can add to Domoticz devices. This process is really different from native Hardware and Device Domoticz support and not automatic, so look and choose carefully.

From now on it is standard Domoticz, Zigbee devices are available.

(May 11 2021) I had to restore the plugin to an older version before the commits to humidity/temperature/pressure which broke the WSDCGQ11LM sensors.

cd domoticz/plugins/zigbee2mqtt
git reset --hard b708fc4

and restart the system.

Zigbee devices

Philips Hue white A60 bulb E27
Philips Hue Go
Aquara Temperature/Humidity/Pressure sensor
WSDCGQ11LM. Very small, affordable, reasonably correct sensor values.
Replace batteries immediately, one was already empty, the other bad. CR2032 type.
Aqara human body movement and illuminance sensor
RTCGQ11LM. Lux and movement. Small, affordable, reasonably correct sensor values. Temperature (very inaccurate), Lux and movement.

BASICZBR3 Zigbee smart switch
No problems, works fine. Easy to pair, safe to attach wires. Router. Sold for Euro 12,50 at Tinytronics Eindhoven.

Sonoff SNZB-03 – Motion Sensor

CR2450 battery. Small PIR sensor. End device. Performs well.

Domoticz, Arduino, Raspberry, Weatherstation, Smartmeter

My new Home Automation System, to see power usage, weather conditions, doorbells and later on switches!

Domoticz, Smartmeter, RFlink and Bresser weatherstation

A combination of Raspberry Pi and Arduino: my Domoticz system.

Domoticz is a Home Automation system design to control various devices and receive input from various sensors. Open source and free!

I wanted a local home automation system to see:

  • P1 Smartmeter power information
  • The Solar Goodwe Inverter controlling the  12 Solar panels on the roof
  • Weather information of the sensors around the house and nearby
  • RF 433 MHz devices like the KlikAanKlikUit doorbell, weather sensor, switches
  • Notification if doorbell pushed on phonoe and PC with camera snaphot
  • Weather information of the Bresser 5 in 1 Weatherstation
  • control Zigbee devices (Philips Hue)
  • control Tasmota (Sonoff and diy) devices via Wifi
  • Not being dependent of cloud computing on switching on lamps, local database
  • Whatever I may design or build later on

So I did some research and found with Domoticz I could do all this. This page tells how it currently looks like/
Not realized yet is the Zigbee part, and I have not started on converting my Sonoff’s to Tasmota. The other wishes are operational!
The dashboard of Domoticz system is out of the box not very appealing, that will be next.

A Home Automation system will be 24/7 running and, with all the sensors attached, quite busy updating the database. So low power, enough computing power, enough and dfast reliable storage and reliability are key.

  • A Raspberry 4 with 2 GB is the central CPU. A SSD of 120 GByte with RPi boot supported AMS 51xx IC USB 3 adapter as storage. No SD card!
  • A RFLink as sold by Nodo to receive and send via 433 MHz, Arduino Mega2560 via USB serial and an Aurel 433 MHz module
  • A P1 Smartmeter cable, serial USB FTDI basedfor my ESRM5 Smartmeter
  • Ethernet and Wifi via onboard Raspberry Pi
  • In the ‘meterkast’, meter cupboard, close to the Smartmeter and the Internet route/switch
  • A CCC2652RB Zigbee USB stick, which are Out of Stock at the moment
    • Domoticz

      Domoticz is easy to setup on a Raspberry Pi. Install Raspberry Pi Lite with Raspberry Pi Imager (press CTRL-Shift-X to set the SSH and password!).
      Do the usual Raspberry Pi Operating system configurration, with Ethernet connected, with raspi-config with Putty for local time setting (important!) , Wifi settings, hostname, boot order.
      Write down the used IP addresses for Ethernet and Wifi!
      Just follow the installation guide on the Domoticz wiki for setting up Domoticz, again via SSH and copy the commands from the Wiki into the SSH session.

      Place the Raspberry in the meter cupboard and startup, and see Domticz in your browser. Check Ethernet and Wifi access.
      Look at settings like Login without password for Local Networks (no username/password), automatic backups etc.

      Dutch DSMR smart meter with P1 port
      I bought the USB P1 Smartmeter cable for my Smartmeter ESMR5 type from Smartmeterdashboard.
      Every Smartmeter seems a bit different (open collector, inversed data), and this cable works for my ESRM5
      The USB part is a FTDI based USB serial adapter, the P1 side a RJ11 connector for the Smartmeter.

      P1 Smartmeter is supported out of the box in Domoticz and give many devices with the power information. Electicity and Gas usage.

      Goodwe Solar Power Inverter readout
      My solar panels are connected to a Goodwe inverter. The inverter sends the data collected to the SEMS Portal, which has an API.
      So A Goodwe SEMS Portal hardware device is available in Domoticz. Easy to add, and gives all information on the Solar inverter.

      I have two cheap Chinese camera’s, good quality, ONVIF support, not much documentation, so what is the snapshot image url required for Domoticz??

      After some searching I found the answer on the Domoticz forum, use the ONVIFER application

      • Install ONVIF IP Camera Monitor (Play Store, Android for me)
      • Find the camera and make it work with the user and admin of the camera
      • Scroll down and see the snapshot image url
      • Fill this in Add Camera

      For my camera’s it was: http://192.168.x.y/web/auto.jpg?-usr=&-pwd=&

      RFlink for 433 MHz devices
      I had to make a choice for a device to receive and transmit RF 433 MHz signal. Two hardware solutionas are available, RFXCOM and RFLink.
      The choice became easier when I found out the RFXCOM is perhaps the better solution, but quite expensive and sold out.

      So it was RFlink, an Arduino ATmega2560 with a RFlInk shield for the low level 433 MHz transceiver. I bought a DIY kit from Nodo shop and soldered it together, easy job! The package consists of a gateway RFlink PCB (comes with 433 MHz Transceiver Aurel and an I2C connector), an Arduino Mega Compatible, 433Mhz antenna and USB cable. Load (alas closed) RFLInk firmware witht eh Arduino IDe and connect.

      So far the RFLink has detected two outdoor temperature/humidity sensors and my KlikAanKlikuit doorbell as devices.

      The doorbell has now notifications!


      I have implemented notifications for pushing the doorbell with:

      • Email
      • PushSafer (with image, use the camera URL as shown above)
      • PushBullet

      Buienrader, the ducth weather site has an API for weather information, available in Domoticz.
      Easy to add, just make sure you have right Station ID (list here in the forum)

      Bresser 5-in-1 weatherstation, Weather Underground

      A weatherstation with outdoor and indoor sensors for temperature, humidity, wind direction, wind strength, pressure.

      A simple and affordable system, with the ability to upload to Weather Undergroud and Weathercloud. The last has a nice brwoser view of the weather data of your own weatherstation.

      Weather Underground has an API and an API key if you have a Personal Weather Station. Add the Hardware and you get several devices with the weatherstation information.