Issue of the topic: Send and receive multiple data between ESP8266 and MQTT
I’m currently following “mksmarthouse” guides about openhab and I’m trying to send two variables from ESP8266 to openhab server but I don’t know how to do it.
ESP8266 Firmware contain this line for sending data to openhab server:
" client.publish(outTopic, "CLOSED"); "
And in openHABian this is the line for receiving data:
@MWB if your new to mqtt I would suggest starting with a known firmware like Esp Easy or Tasmota. Looking at the example items above your using mqtt 1.x binding so I will post an example of one Esp8266 with Esp Easy firmware and BPM-280 sensor as an example.
Number Esp2_BMP_Temp "Esp8266 Temp [%.1f °F]" <temperature>
{ mqtt="<[pibroker:/Esp2/BMP/Temp:state:default]" }
Number Esp2_BMP_Humid "Esp8266 Humid [%.1f %%]" <humidity>
{ mqtt="<[pibroker:/Esp2/BMP/Humid:state:default]" }
Number Esp2_BMP_Pressure "Esp8266 Pressure [%.1f mbar]" <pressure>
{mqtt="<[pibroker:/Esp2/BMP/Pressure:state:default"}