tl;dr: Having trouble with OH2 showing data sent to MQTT from ESP8266/DHT22
The following is my mqtt.cfg:
<broker>.url=tcp://localhost:1883
<broker>.clientId=openhab2
<broker>.user=user
<broker>.pwd=password
mqtt-persistence.cfg:
broker=openhab2
default.items:
String Viv1Temp "Temperature [%.0f]C" <temperature> { mqtt="<[mosquitto:vivariums/1/sensor/temperature:state:default]" }
String Viv1Hum "Humidity [%.0f]%" <humidity> { mqtt="<[mosquitto:vivariums/1/sensor/humidity:state:default]" }
default.sitemap:
Frame label="Vivarium 1" {
Text item=Viv1Temp
Text item=Viv1Hum
I've ran mosquitto_sub and see that the sketch is working. It shows:
mosquitto_sub -t vivariums/1/sensor/humidity -q 1
31.60
50.00
54.70
49.00
47.00
45.70
44.40
43.10
and
mosquitto_sub -t vivariums/1/sensor/temperature -q 1
26.10