Hello together,
First, let me say, that ESPeasy is really great.
I configured my ESP to use the openhab MQTT protocol and set up openhab with Mosquitto MQTT broker.
I can switch a LED on and off as explained in the example in the wiki but the question is how I can read the sensor values of my DHT22? In the configuration of the ESP I can see that the sensor is working but I cannot receive anything in openhab.
My item looks as follows:
Number MQTTTEMP "Temperature [%.1f °C]" {mqtt="<[localbroker:/openhabdemo/DHT/Temperature:state:default]"}
localbroker is my MQTT broker, openhabdemo the name of the ESP and DHT the name of the Task in whitch I configured the DHT22.
In the sitemap file I want to make the value viewable by:
Text item=MQTTTEMP
But I never receive a value. How should the binding look like?
openhab example for reading DHT22 sensor
Moderators: grovkillen, Stuntteam, TD-er
Re: openhab example for reading DHT22 sensor
Hello Niklas,
I have exactly the same question, and I'm searching for over a week now...
Can someone tell me (us) how the line in the item-file will look like?
regards,
Ronny
I have exactly the same question, and I'm searching for over a week now...
Can someone tell me (us) how the line in the item-file will look like?
regards,
Ronny
Re: openhab example for reading DHT22 sensor
.sitemap file
.items file
Code: Select all
sitemap demo label="ESP Easy MQTT"
{
Frame label="Sensors" {
Text item=SlpkPhil_temp
Text item=SlpkPhil_temp2
Text item=SlpkPhil_press
Text item=Bureau_temp
Text item=Bureau_temp2
Text item=Bureau_press
/* Text item=Flukso_power */
Text item=Switch1
Switch item=Relay1 mappings=[ON="Go!"]
}
Code: Select all
Group All
Group Weather (All)
Group Sensors (All)
/*Sensors */
Group Sensors
Number SlpkPhil_temp "Slaapkamer Philippe temperatuur [%.2f °C]" <temperature> (temperature, Sensors) {mqtt="<[localbroker:/ESPEasy01/DS18B20_1/Temperature:state:default]"}
Number SlpkPhil_temp2 "Slaapkamer Philippe temperatuur2 [%.2f °C]" <temperature> (temperature2, Sensors) {mqtt="<[localbroker:/ESPEasy01/BMP085_1/Temperature:state:default]"}
Number SlpkPhil_press "Slaapkamer Philippe luchtdruk [%.2f mbar]" <pressure> (pressure, Sensors) {mqtt="<[localbroker:/ESPEasy01/BMP085_1/Pressure:state:default]"}
Number Bureau_temp "Bureau temperatuur [%.2f °C]" <temperature> (temperature, Sensors) {mqtt="<[localbroker:/ESPEasy02/DS18B20_1/Temperature:state:default]"}
Number Bureau_temp2 "Bureau temperatuur2 [%.2f °C]" <temperature> (temperature2, Sensors) {mqtt="<[localbroker:/ESPEasy02/BMP085_1/Temperature:state:default]"}
Number Bureau_press "Bureau luchtdruk [%.2f mbar]" <pressure> (pressure, Sensors) {mqtt="<[localbroker:/ESPEasy02/BMP085_1/Pressure:state:default]"}
/* Number Flukso_power "Flukso huidig vermogen [%.2f W]" <power> (power, Sensors) {mqtt="<[flukso:/sensor/ea7f86e230989e980c39efec3ab38218/gauge:state:default]"} */
Number Switch1 "Door Status [MAP(switch.map):%d]" <garagedoor> (Sensors) {mqtt="<[mqttbroker:openhab/garage/switch1:state:default]"}
Switch Relay1 "Garage Door" <garagedoor> (All) {mqtt=">[mqttbroker:openhab/garage/relay1:command:ON:GO]"}
- Attachments
-
- garagedoor.zip
- (970 Bytes) Downloaded 375 times
Re: openhab example for reading DHT22 sensor
Hi there,
is this problem already solved ??? I got a solution !
is this problem already solved ??? I got a solution !
Who is online
Users browsing this forum: No registered users and 0 guests