[SOLVED] Reading MQTT item

I have followed this great guide Reading a DHT11/22 on a raspberry and send the results by MQTT to set up my DHT22 sensor but can not get it to show up in openhab and not sure why my config is as follows

dht.sh
/home/openhabian/mqtt.dhtsensor.py ‘house/temperature1’ ‘house/humidity1’ 4 50

Items file

Number GF_Hallway_Heating “Home temperature [%.1f °C]” (GF_Hallway, gHeating) {mqtt="<[mosquitto:house/temperature1:state:default]"}
Number GF_House_humidity “Home humidity [%.0f %%]” (GF_Hallway, gHumidity) {mqtt="<[mosquitto:House/humidity1:state:default]"}

copied from mqttlens msg so looks like the reading is ok
16.6000003815

51

Time

3:44:11

Topic

house/humidity1

QoS

0

Message:

56.5

is there a simple mistake i have made that you can see ?

Many thanks Stuart

Check that all topics are identical.

What output or errors do you have in the logs?

Your broker works and the value is received.

Your item looks a little strange though, there are no square brackets for the mqtt option if I recall correctly. Could you look up some other examples to verify?

And make sure you have mqtt1 installed and not mqtt1 actions or mqtt2.

have checked logs and there is no errors

couldn’t see another example for this but will have another search

Thanks for taking a look

openHAB will not log an error for something that is not configured or not installed. Make also sure you have defined a broker in a “mqtt.cfg”. If that is all too tedious for you (it is!) then use the new MQTT 2 binding instead. There is a blog post and extensive documentation on how to add necessary Things and Channels on paper UI or via text files.

Cheers,
David

mqtt.cfg

broker.url=tcp://192.168.1.144:1883
#broker.user=stu
#broker.pwd=stu

do i need to add to this ?

You need to remove the comments # like below if using a user and password.

`broker.url=tcp://192.168.1.144:1883

broker.user=stu

broker.pwd=stu`

Also you have the broker named mosquitto in the items above and in the cfg it’s named broker

Your item change.

Number GF_Hallway_Heating “Home temperature [%.1f °C]” (GF_Hallway, gHeating) {mqtt="<[broker:house/temperature1:state:default]"}
Number GF_House_humidity “Home humidity [%.0f %%]” (GF_Hallway, gHumidity) {mqtt="<[broker:house/humidity1:state:default]"}

brilliant thank you working now :slight_smile: knew it would be something simple like me lol

next up is rules to turn heating on and off with a set point some more reading to do and its a steep learning curve but a lot of help from all users hear makes it fun

Thank you

Glad you have it working.:+1:

Please mark the topic as solved by clicking the square box on the post that provided the solution. Also edit the title to start with [Solved].

Thanks