[SOLVED] Need help with getting zigbee2mqtt data into openhab items

Hi,
I’m struggling on the last step to get the actual data to the sitemap of openhab, after everything else is working…went through the configs and tutorial several times, cannot find the mistake…
I have 3 xiaomi aqara sensors (square)

what is done:
-mosquitto installed and running
-zigbee2mqtt installed and running
-mqtt binding installed in OH 2.5
-devices paired with zigbee2mqtt and showing data in the logs (temperature,humidity,battery…)
-mqtt.things and mqtt.items created following the “new way” no transformations


-mosquitto_sub -d -t zigbee2mqtt/# shows reading from sensors

my things:

Bridge mqtt:broker:mosquitto [host="localhost", secure=false]
{
Thing topic SensorLiving "SensorLiving" @ "Muneera Doma" {
   Channels:
   Type number: LivingTemperature "Living Temperature [%d mV]"  [stateTopic="zigbee2mqtt/SensorLiving/temperature"]
   Type number: LivingHumidity "Living Humidity [%d mV]"        [stateTopic="zigbee2mqtt/SensorLiving/humidity"]
   Type number: LivingPressure "Living Pressure [%d mV]"        [stateTopic="zigbee2mqtt/SensorLiving/pressure"]
   Type number: LivingBattery "Living Battery [%d mV]"          [stateTopic="zigbee2mqtt/SensorLiving/battery"]
   Type number: LivingLink "Living Link Quality [%d mV]"        [stateTopic="zigbee2mqtt/SensorLiving/linkquality"]
}
Thing topic SensorKids "SensorKids" @ "Muneera Doma" {
   Channels:
   Type number: KidsTemperature "Kids Temperature [%d mV]"  [stateTopic="zigbee2mqtt/SensorKids/temperature"]
   Type number: KidsHumidity "Kids Humidity [%d mV]"        [stateTopic="zigbee2mqtt/SensorKids/humidity"]
   Type number: KidsPressure "Kids Pressure [%d mV]"        [stateTopic="zigbee2mqtt/SensorKids/pressure"]
   Type number: KidsBattery "Kids Battery [%d mV]"          [stateTopic="zigbee2mqtt/SensorKids/battery"]
   Type number: KidsLink "Kids Link Quality [%d mV]"        [stateTopic="zigbee2mqtt/SensorKids/linkquality"]
}
Thing topic SensorBalcony "SensorBalcony" @ "Muneera Doma" {
   Channels:
   Type number: BalconyTemperature "Balcony Temperature [%d mV]"  [stateTopic="zigbee2mqtt/SensorBalcony/temperature"]
   Type number: BalconyHumidity "Balcony Humidity [%d mV]"        [stateTopic="zigbee2mqtt/SensorBalcony/humidity"]
   Type number: BalconyPressure "Balcony Pressure [%d mV]"        [stateTopic="zigbee2mqtt/SensorBalcony/pressure"]
   Type number: BalconyBattery "Balcony Battery [%d mV]"          [stateTopic="zigbee2mqtt/SensorBalcony/battery"]
   Type number: BalconyLink "Balcony Link Quality [%d mV]"        [stateTopic="zigbee2mqtt/SensorBalcony/linkquality"]
}
}

my items:

Number LivingTemperature "Living Temperature [%.1f °C]"  <temperature>  {channel="mqtt:topic:mosquitto:SensorLiving:temperature"}
Number LivingHumidity "Living Humidity [%.1f °C]"  <humidity>  {channel="mqtt:topic:mosquitto:SensorLiving:humidity"}
Number KidsTemperature "Kids Temperature [%.1f °C]"  <temperature>  {channel="mqtt:topic:mosquitto:SensorKids:temperature"}
Number KidsHumidity "Kids Humidity [%.1f °C]"  <humidity>  {channel="mqtt:topic:mosquitto:SensorKids:humidity"}
Number BalconyTemperature "Balcony Temperature [%.1f °C]"  <temperature>  {channel="mqtt:topic:mosquitto:SensorBalcony:temperature"}
Number BalconyHumidity "Balcony Humidity [%.1f °C]"  <humidity>  {channel="mqtt:topic:mosquitto:SensorBalcony:humidity"}

zigbee2mqtt log

zigbee2mqtt.service - zigbee2mqtt
   Loaded: loaded (/etc/systemd/system/zigbee2mqtt.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2020-08-15 16:29:01 +04; 2min 52s ago
 Main PID: 482 (node)
    Tasks: 23 (limit: 2068)
   CGroup: /system.slice/zigbee2mqtt.service
           ├─482 npm
           ├─625 sh -c node index.js
           └─626 node index.js

Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorKids/humidity', payload '62.7
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorLiving/humidity', payload '68
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorBalcony/humidity', payload '6
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorKids/pressure', payload '984.
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorLiving/pressure', payload '98
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorBalcony/pressure', payload '9
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorKids/linkquality', payload '4
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorLiving/linkquality', payload
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/SensorBalcony/linkquality', payload
Aug 15 16:29:17 knx npm[482]: Zigbee2MQTT:info  2020-08-15 16:29:17: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"version"

SensorLiving,SensorKids,SensorBalcony are the friendly names of devices defined in
/opt/zigbee2mqtt/data/configuration.yaml

All defined items have status NULL and do not get updated

If you see the mistake, for the love of God let me know :slight_smile:

thanks

You’re missing an opening { in your things file, after your bridge definition…

What do your OpenHAB logs show when saving your things file?

In your items, do you need the word mosquitto? And you haven’t actually used the channel name. Try

{channel="mqtt:topic:SensorLiving:LivingTemperature"}

yeah that was it…as seen in debug log of the binding

2020-08-15 18:14:00.739 [DEBUG] [qtt.generic.AbstractMQTTThingHandler] - Channel mqtt:topic:mosquitto:SensorBalcony:BalconyTemperature received REFRESH but no value cached, ignoring

i do need word mosquitto as it is broker name, but my channel name was wrong

thanks, all works now!
now it seems that CC2531 signal is weak for the Balcony sensor, i will have to get some other device in the network to amplify the signal (like smart plug…)

I had to put my CC2531 on a USB extension cable, so that it could be located away from my Raspberry Pi - much better connections then.

yeah, I have it on usb hub 1 meter away from rpi, but still…i think metalized glass of the balcony is blocking all signals…however, Nortek GoControl stick was able to connect to the outside sensor, but native zigbee binding did not work well for me (these sensors just reported temperature once and went to sleep. so I removed it and decided to go down the zigbee2mqtt route…

I do not see a mistake, but there was a bug in the early mqtt2 binding, the binding needed a restart after configuration changes. Did you restart openHAB after creating the configuration?

Hi,
yes I restarted it, but issue was wrong channel name, solved now, thx

Ah, now i see as well. The channel name you used in the items is far better than the one defined in the things. You shouldn’t code the thing inside the channel again.