Hey guys,
I’m just getting started with MQTT - the ultimate goal is to control my irrigation using a relay switch.
So Openhab running on Raspi Pi with MQTT Broker sends Command via MQTT to NodeMCU which switches the relays on/off. To fully grasp what MQTT is doing I coded the NodeMCU to switch the relay when receiving a command.
On top the NodeMCU generates a “Hello World” Message in a topic.
in openhab I configured an items file with the switch:
Switch mqtt_Test "Testing..." (System) { mqtt=">[MQTT:mqtt/irrigation/relay1:command:ON:1], >[MQTT:mqtt/irrigation/relay1 :command:OFF:0]" }
which is working fine.
I also configured a String item for the "Hello World Message (which could also be Temp sensor in the future) as follows:
String mqtt_status "MQTT:" (System) {mqtt="<[MQTT:mqtt/irrigation/status:state:default]"}
I do get the status updates in my logfile
2018-07-17 00:18:26.110 [vent.ItemStateChangedEvent] - mqtt_status changed from hello world #136 to hello world #137
But my sitemap remains empty
What am I doing wrong?