-->
Page 1 of 1

ESP8266, DHT22, MQTT, Openhab2

PostPosted: Sat Sep 23, 2017 7:45 pm
by inteus
Hi. I'm brand new to the ESP8266, and pretty much arduino anything. I have a sketch on it working great. It's reading temp/humidity, and publishing to my Mosquitto server. However, I can't for the life of me get Openhab2 to see the temp/hum readings. I have persistence sending every reading to influxDB, but for some reason, it still isn't reading on OH2. I'm definitely not a coder, so any help would be appreciated.

tl;dr: Having trouble with OH2 showing data sent to MQTT from ESP8266/DHT22

The following is my mqtt.cfg:
Code: Select all<broker>.url=tcp://localhost:1883
<broker>.clientId=openhab2
<broker>.user=user
<broker>.pwd=password


mqtt-persistence.cfg:

Code: Select allbroker=openhab2


default.items:

Code: Select allString  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:

Code: Select all    Frame label="Vivarium 1" {
        Text    item=Viv1Temp
        Text    item=Viv1Hum


I've ran mosquitto_sub and see that the sketch is working. It shows:

Code: Select allmosquitto_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

Code: Select allmosquitto_sub -t vivariums/1/sensor/temperature -q 1
26.10