mosquitto_sub -h localhost -t β#β -v gives the following output
tuya/gateway/dps/state {β1β:11}
tuya/gateway/dps/1/state 11
tuya/gateway/dps/state {β1β:11}
tuya/gateway/dps/1/state 11
tuya/gateway/dps/state {β2β:804}
tuya/gateway/dps/2/state 804
tuya/gateway/dps/state {β2β:804}
tuya/gateway/dps/2/state 804
tuya/gateway/dps/state {β1β:204}
tuya/gateway/dps/1/state 204
tuya/gateway/dps/state {β1β:204}
tuya/gateway/dps/1/state 204
tuya/gateway/dps/state {β2β:326}
tuya/gateway/dps/2/state 326
tuya/gateway/dps/state {β2β:326}
tuya/gateway/dps/2/state 326
This neither looks like humidity nor temperature data. Has anyone else configured these Tuya Zigbee temperature and humidity sensors to be read and displayed on OpenHAB 3?
Just some wild guesses:
Syntax error in devices.conf
?
Restart tuya-mqtt
after modifying devices.conf
.
Are you sure that tuya-mqtt
does support tuya-Zigbee devices (it isnβt obvious to me)?
Please note that tuya-mqtt
is in βmaintainance [sic] modeβ.
Read on if getting rid of the Tuya-Zigbee gateway is an option:
Your devices might be supported by the Zigbee Binding or by Zigbee2MQTT (cf. TuYa ZTH01 control via MQTT | Zigbee2MQTT) - of course, one cannot be sure. You would have to buy a Zigbee coordinator to find out (my recommendation: https://itead.cc/product/zigbee-3-0-usb-dongle/ - supported by the Zigbee Binding and by Zigbee2MQTT (experimental, but rock solid in my Zigbee2MQTT setup - YMMV)).
1 Like
OP here, some progress.
I added the gateway ip adress and version to devices.conf and that seems to have made the trick, like so:
name: 'Gateway',
id: 'xxxxxxxxxxxxxxxxxxxxxxx',
key: 'yyyyyyyyyyyyyyyy',
ip: '192.168.zzz.qww',
version: '3.3',
Now
mosquitto_sub -v -h localhost -t β#β
results in the following output:
tuya/gateway/status online
tuya/gateway/dps/state {β1β:200}
tuya/gateway/dps/1/state 200
tuya/gateway/dps/state {β2β:292}
tuya/gateway/dps/2/state 292
tuya/gateway/dps/state {β1β:192}
tuya/gateway/dps/1/state 192
tuya/gateway/dps/state {β2β:278}
tuya/gateway/dps/2/state 278
tuya/gateway/dps/state {β1β:195}
tuya/gateway/dps/1/state 195
tuya/gateway/dps/state {β2β:282}
tuya/gateway/dps/2/state 282
tuya/gateway/dps/state {β1β:208}
tuya/gateway/dps/1/state 208
tuya/gateway/dps/state {β2β:265}
tuya/gateway/dps/2/state 265
tuya/gateway/dps/state {β1β:205}
tuya/gateway/dps/1/state 205
tuya/gateway/dps/state {β2β:261}
tuya/gateway/dps/2/state 261
tuya/gateway/dps/state {β1β:-4}
tuya/gateway/dps/1/state -4
tuya/gateway/dps/state {β2β:803}
tuya/gateway/dps/2/state 803
tuya/gateway/dps/state {β1β:134}
tuya/gateway/dps/1/state 134
tuya/gateway/dps/state {β2β:269}
tuya/gateway/dps/2/state 269
tuya/gateway/dps/state {β1β:200}
tuya/gateway/dps/1/state 200
tuya/gateway/dps/state {β2β:291}
tuya/gateway/dps/2/state 291
tuya/gateway/dps/state {β1β:192}
tuya/gateway/dps/1/state 192
tuya/gateway/dps/state {β2β:277}
tuya/gateway/dps/2/state 277
Comparing the values to the values in the Android app I found out that the numbers correspond to the values measured by the sensors.
For example:
tuya/gateway/dps/state {β1β:-4}
tuya/gateway/dps/1/state -4
tuya/gateway/dps/state {β2β:803}
tuya/gateway/dps/2/state 803
Corresponds to the outdoor sensor that currently measures -0,4C and 80,3% humidity. There are 4 lines per sensor in the output and values need to be divided by 10. Apparently all my zigbee sensors are now recognized. The sensor IDs are missing, still.
Next question is how to get the sensors identified AND how to draw them into a nice graph in OpenHAB?
It seems like the Tuya Zigbee gateway just forwards the topic values from the subunits without labeling the values at all.
Is there a way to use for example devices.conf to create recognizable labels to the topic values, to identify which sensor is being reported?
So instead of:
tuya/gateway/dps/state {β1β:200}
tuya/gateway/dps/1/state 200
tuya/gateway/dps/state {β2β:271}
tuya/gateway/dps/2/state 271
tuya/gateway/dps/state {β1β:-3}
tuya/gateway/dps/1/state -3
tuya/gateway/dps/state {β2β:814}
tuya/gateway/dps/2/state 814
It would report
tuya/gateway/dps/state {β1β:200}
tuya/gateway/dps/1/state 200 Garage Temperature
tuya/gateway/dps/state {β2β:271}
tuya/gateway/dps/2/state 271 Garage Humidity
tuya/gateway/dps/state {β1β:-3}
tuya/gateway/dps/1/state -3 Outdoor Temperature
tuya/gateway/dps/state {β2β:814}
tuya/gateway/dps/2/state 814 Outdoor Humidity