Im having an issue with ZbBridge running tasmota. I have a number of devices registered to the bridge but they all send updates on the same MQTT publish path.
When it publishes on this path
tele/tasmota_zbGateway1/SENSOR = {“ZbReceived”:{“0x7294”:{“Device”:“0x7294”,“Name”:" Office_Temp",“Temperature”:23.88,“Humidity”:65.49,“Endpoint”:1,“LinkQuality”:157}}}
I get my temperature updated in openhab and it works fine until another device updates.
tele/tasmota_zbGateway1/SENSOR = {“ZbReceived”:{“0xFF6C”:{“Device”:“0xFF6C”,“Name”:" Wardrobe_PIR",“Illuminance”:6,“Occupancy”:1,“Endpoint”:1,“LinkQuality”:13}}}
At this point the first temp value goes to null as it received an update on the published path but there was no entry for the temperature so in openhab they all go blank.
My Items are as follows any help would be great as there are no errors listed in the logs.
Number ZbWardrobe_Occupancy “Wardrobe PIR [%d]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0xFF6C.Occupancy)]" }
Number ZbWardrobe_Illuminance “Wardrobe PIR Illuminance [%d]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0xFF6C.Illuminance)]" }
Number ZbWardrobe_LinkQA “Wardrobe PIR Link Quality [%d]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0xFF6C.LinkQuality)]" }
Number ZbWardrobe_BatteryVoltage “Wardrobe PIR Battery Volts [%.2f V]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0xFF6C.BatteryVoltage)]" }
Number ZbWardrobe_BatteryPercentage “Wardrobe PIR Battery [%d %%]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0xFF6C.BatteryPercentage)]" }
Number ZbOffice_Temp “Office Temp [%.1f C]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0x7294.Temperature)]" }
Number ZbOffice_Humidity “Office Humidity [%.2f %%]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0x7294.Humidity)]" }
Number ZbOffice_LinkQA “Office Link Quality [%d]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0x7294.LinkQuality)]" }
Number ZbOffice_BatteryVoltage “Office Temp Battery Volts [%.2f V]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0x7294.BatteryVoltage)]" }
Number ZbOffice_BatteryPercentage “Office Temp Battery [%d %%]” { mqtt="<[DOCKERMQTT:tele/tasmota_zbGateway1/SENSOR:state:JSONPATH($…0x7294.BatteryPercentage)]" }
It looks like you are using the V1 MQTT binding, rather than V2. Did you mean to do that? If you’re just starting you should use V2, as for configuration will then be valid for the upcoming openHAB 3.
Yes im using V1 binding but i cant see how V2 will fix this issue, Is this working as expected? If a Json message does not include a value for an item does OPENHAB then change it to null?
No it doesn’t.
I don’t think it would actually move us any further forward, but the ‘void’ state for an Item is either NULL or UNDEF.
NULL usually signifies the Item has been reinitialized for some reason, while UNDEF is generally what a binding should set to indicate “unknowable” because there was bad comms or suchlike. So it can be useful distinguishing which exactly.
However I would not like to assume v1 MQTT binding follows these guidelines. Your events.log should show you what is really going on, but I don’t think it helps.
The number of people who will be able to help with MQTT v1 issues left is small and getting smaller by the day. But I do know that the MQTT 1 binding config supports an optional REGEX filter you can define at the end of the config. If the message doesn’t match the REGEX the message will be ignored for that Item.
The link hafniumzinc posted is how to achieve the same thing in the 2.x version of the binding.
It used to be the case that if the JSONPATH didn’t match anything it would return the whole JSON String. I don’t know if that is still the case.
Thank you guys, after many hours of migrating V2 of MQTT does look like its fixed the issue. My Things file is 180 lines long which is why i think i was putting it off.
Hi, i have tried adding the REGEX to my transforms but still get errors in the logs when anything updates.
can you please confirm the character between the ) and the JSON also?
Good news is TASMOTA has changed some stuff in the new release so you can change things in tasmota to make it easier. You will no longer need the regex to check
SetOption89
Configure MQTT topic for Zigbee devices (also see SensorRetain)
0 = single tele/%topic%/SENSOR topic (default)
1 = unique device topic based on Zigbee device ShortAddr
Example: tele/Zigbee/5ADF/SENSOR = {“ZbReceived”:{“0x5ADF”:{“Dimmer”:254,“Endpoint”:1,“LinkQuality”:70}}}
SetOption100
remove Zigbee ZbReceived value from {“ZbReceived”:{xxx:yyy}} JSON message
0 = disabled (default)
1 = enabled