This is a great piece of contribution by z9th3. I am able to configure Zigbee2MQTT broker by following the exact steps. I am able to connect two door and window contact sensors from Xiaomi Aqara and can see the activity/change of state in terminla window using “mosquitto_sub -d -t zigbee2mqtt/#” command.
One thing I am not able to figure out is (or I might have missed it here): How can I find a new Zigbee Thing (using Zigbee2MQTT broker) in Paper UI instead of terminal window.
I wish to change my current zigbee2mqtt coordinator (CC2531) to a RF TO USB (CC2530 CC2591) RF switch - as a new coordinator. What would be a painless way to do this without losing all the zigbee connections made?
Excellent step by step tutorial - it works as described - many thanks.
This works with the TI development board LAUNCHXL-CC1352P-2. Firmware as reported by zigbee2mqtt: zStack3x0 revision: 20191106
1st serial port /dev/ttyACM0 is correct (this device reports 2 serial ports over USB).
You can skip after step 1 in ‘openHAB Configuration’ (as transformations are no longer necessary). Keep on reading for thing and item configuration.
I have several power switches working fine over MQTT (flashed with Tasmota). Now I have an Xiaomi Power Socket and paired it with Zigbee2MQTT.
Thing config:
Channels:
Type switch : state “state” [ stateTopic = “zigbee2mqtt/socket”, transformationPattern=“JSONPATH:$.state”, commandTopic=“zigbee2mqtt/socket/set” ]
Type number : power “power” [ stateTopic = “zigbee2mqtt/socket”, transformationPattern=“JSONPATH:$.power” ]
Type number : voltage “voltage” [ stateTopic = “zigbee2mqtt/socket”, transformationPattern=“JSONPATH:$.voltage” ]
Type number : consumption “consumption” [ stateTopic = “zigbee2mqtt/socket”, transformationPattern=“JSONPATH:$.consumption” ]
Type number : linkquality “linkquality” [ stateTopic = “zigbee2mqtt/socket”, transformationPattern=“JSONPATH:$.linkquality” ]
All values are correct, but when I change the switch in my sitemap, my power socket doesn’t turn on or off (allthough I see in the logs the my items changes state)
When I manually publish ON or OFF to zigbee2mqtt/socket/set, my power socket changes state correctly. What am I missing?
Can you subscribe to the MQTT broker on the same topic (or use MQTT Explorer or similar) and watch as you flip the switch in openHAB? Is the broker getting the correct string?
The broker doesn’t receive anything… When I switch the socket manually, the state topic changes.
I use MQTT Explorer and use both raw en json with simply ON or OFF.
I already tried it, but I also use Zigbee2Mqtt Assistant, and for full functionality, this required also enabling the homeassistant feature, wich doesn’t work together with the attribute value (only json)
2020-07-19 21:18:11.671 [ome.event.ItemCommandEvent] - Item ‘mi_socket_state’ received command ON
2020-07-19 21:18:11.734 [nt.ItemStatePredictedEvent] - mi_socket_state predicted to become ON
2020-07-19 21:18:11.745 [vent.ItemStateChangedEvent] - mi_socket_state changed from OFF to ON
publishing topic
2020-07-19 21:19:40.146 [vent.ItemStateChangedEvent] - mi_socket_state changed from OFF to ON
When I change the switch in Paper UI, the set topic toggles between 1 and 0, this isn’t correct offcourse. I’ll add a transformation file.
Just noticed that this is also the case when I toggle in sitemap, a restart pushed me in the right direction…
edit: solved! the answer was actually on the first post of this topic…
Hello. I use zigbee2mqtt with CC2531. But there is one problem, after restarting the raspberry pi, all zigbee devices have the offline status.I have to press the pairing button for 1 second every time and everything becomes OK. It feels like the devices are in sleeping mode, and I have to press the pairing button to wake them up.
are these main powered or battery devices? The devices normally reconnect after some time without you doing something and send with their normal heartbeat rate. Battery powered devices normally have a longer heartbeat than main powered.
I have only battery powered devices. May be i need to send them birth-message from MQTT-brocker or something else? Status of these devices in topic “availability” - offline.