Trying to get temperature readings to openHAB3 for the first time. Never used oH before. Seems complicated and most of the tutorials are in German
I believe I have succesfully connected oH and Arduino to Mosquitto. But canât read the info from Mosquitto to oH. Not sure if my Arduino sends it in correct format and âchannel parametersâ or whatever⊠Could anyone have a look?
Is the âArduinotestiâ correct in Arduino code? Should it be some other identifier when you look my oH setup?
client.publish(âArduinotestiâ, temp1Char);
In Arduino code, is it correctly trasformed from float to char and is it really needed? Is it correctly in oH when itâs string and number?
Or am I missing something bigger here or is it just something small?
That might be a good thing to check. A third party tool like mqtt.fx will allow you to get the broker to show you the messages. When you know what your Arduino is sending, you have a better chance of making it send what you want, and then to get openHAB to look at it.
Ok. Installed MQTT.fx now to different machine and got it connected ok to Mosquitto. Subscribed as âArduinotestiâ as set in Arduino code. Seems that temperature reading is sent out correctly, thank you rossko57!
Then I need to figure out how to get the numbers to oHâŠ
Based on what you saw there, youâd need to give your channel a stateTopic to subscribe to.
In the first case, you might make a temporary string type channel to get the whole message, for confidence.
Later, you add another channel, perhaps number type, with any transformations that you might need for your payload.
It is a parameter of an MQTT binding Generic Thingâs channel, and tells the binding which topic to listen to from the MQTT broker, and to use the payload of any messages on that topic to update any openHAB Items linked to that channel.