I’m new to OpenHAB and was happy to be able to get Openhabian running. My plan is to connect to an Aqara Temperature and Humidity Sensor. Therefore I have a CC2531 USB Stick already flashed with Koenkk Z-Stack-firmware (Z-Stack_Home_1.2). I was able to create the openHAB Zigbee Binding and create the thing CC2531EMK Coordinator. This thing shows ONLINE as the status.
Here my problem starts. My idea was to create the thing Temperature Sensor by clicking on the plus dot, selcting the only binding I have (zigbee) and pushing the button on the sensor until the sensor flashes several times. My expectation was that if I let openHAB scan at the same time the sensor would appear to be selected. But this does not happen.
The custom firmware from Zigbee2MQTT can also be used, and has been reported working by some users.
and the link points to here which is the page for Z-Stack_Home_1.2! So the OP is using a firmware that “can also be used”.
There’s no guarantees in any of this, though, so @Guenther if you’re able to you might want to try the other firmware linked from the documentation, or go all in with KoenK and just use Zigbee2MQTT!
Thank you for your input. I understand that if my CC2531 has the Koenkk firmware that this should be used with a MQTT Binding in openhab. So I choosed to try out Zigbee2MQTT according to | Zigbee2MQTT.
When I start zigbee2mqtt the initialization looks ok. The green led on the CC2531 lights up and zigbee2mqtt is trying to connect to a MQTT server.
Zigbee2MQTT:info 2021-01-19 13:37:22: Starting Zigbee2MQTT version 1.17.0 (commit #07cdc9d)
Zigbee2MQTT:info 2021-01-19 13:37:22: Starting zigbee-herdsman (0.13.46)
Zigbee2MQTT:info 2021-01-19 13:37:26: zigbee-herdsman started
Zigbee2MQTT:info 2021-01-19 13:37:26: Coordinator firmware version: ‘{“meta”:{“maintrel”:3,“majorrel”:2,“minorrel”:6,“product”:0,“revision”:20190608,“transportrev”:2},“type”:“zStack12”}’
Zigbee2MQTT:info 2021-01-19 13:37:26: Currently 0 devices are joined:
Zigbee2MQTT:warn 2021-01-19 13:37:26: permit_join set to true in configuration.yaml.
Zigbee2MQTT:warn 2021-01-19 13:37:26: Allowing new devices to join.
Zigbee2MQTT:warn 2021-01-19 13:37:26: Set permit_join to false once you joined all devices.
Zigbee2MQTT:info 2021-01-19 13:37:26: Zigbee: allowing new devices to join.
Zigbee2MQTT:info 2021-01-19 13:37:26: Connecting to MQTT server at mqtt://localhost
Zigbee2MQTT:error 2021-01-19 13:37:36: Not connected to MQTT server!
At that point I added the MQTT Binding and the MQTT Broker in openhab. However zigbee2mqtt still can’t connet to the MQTT server and the MQTT Broker states ERROR COMM. The error message of the MQTT Broker is:
I found out that you can install mosquitto from opnehabian-config. That worked so far as in the openhab UI the thing MQTT Broker could establish a connection. Next step will be to install zigbee2mqtt.
However there is a small disadvantage. After reboot of the raspi mosquitto fails to be started as a background service. Starting from the command line fails. When I install mosquitto from openhabian-config again it is up and running. I installed it from the command line but this did not change anything.
So far I can now continue with zigbee2mqtt and I am very thankful for the support
Installation went ok. Starting from the command line works also. When I pair the sensor I can see the log messages
But:
Recognizing the sensor in openHAB is unsuccsesful. I click on the plus sign to add a thing. I select the only available Binding MQTT Brocker and click on Scan. Nothing happens. In the ssh window where zigbee2mqtt is running I can see the messages from the sensor.
As described before mosquitto fails to start as a service in the background. So I started it from openhabian-config. As long as the raspi is not shut down mosquitto is running.
Also the attempt to start zigbee2mqtt as a service in the background fails.
I would like to resolve topic 1 first. zigbee2mqtt shows
It’s been a while but I catched up again. Mosquitto and zigbee2mqtt are running on startup in the background. The Aqara sensor is connected to zigbee2mqtt. I can see the messages of zigbee2mqtt (in a ssh session logging made visual by sudo journalctl -u zigbee2mqtt.service -f) as:
For mosquitto I opened a second ssh session and started showing the log by
mosquitto_sub -d -t zigbee2mqtt/#
From the log there it looks like mosquitte knows the sensor. But I can’t see any message with the data the sensor is providing. In OpenHAB UI I can create a Generic MQTT Thing with a channel and an item. The item shows always NULL.
There is no error message.
What is necessary to get mosquitto taking over the data provided by zigbee2mqtt and providing to OpenHAB?
At the moment I can’t see any proof that you have a successful connection between zigbee2mqtt and your Mosquitto broker.
Does it? Can you show us this log? Note that you can point mosquitto_sub to any topic you like - it will never tell you that the topic isn’t in use, because some device might suddenly publish to it in the future…
If zigbee2mqtt isn’t communicating properly with Mosquitto then openHAB will definitely not be able to see the sensor!