Closed outrun0506 closed 7 years ago
Hi Lukas, Thank you for your message. The output is correct and the MQTT message is received by Home Assistant (it works for the temperature). There is probably a problem when HA tries to extract the humidity from the payload of the MQTT message. I can not test anything now, but you should find some help at the bottom of this page.
Are you using the same topic for the humidity sensor?
sensor 1:
platform: mqtt
state_topic: 'office/sensor1'
name: 'Temperature'
unit_of_measurement: '°C'
value_template: '{{ value_json.temperature }}'
sensor 2:
platform: mqtt
state_topic: 'office/sensor1'
name: 'Humidity'
unit_of_measurement: '%'
value_template: '{{ value_json.humidity }}'
Best regards, Sam
Hi Sam, I'm using this sketch and there is no problem. I have two dht22 sensors. One of them always shows humidity 1. This sensor is the same in a different sketch. I guess the humidity sensor is broken. I would recommend using a different sensor or try it with a test sketch (without mqtt, only serial monitor).
Hi Lukas, Thank you for this work. I use Sensor_dht22, light, light_with_brightness sketchs. I will use other sketch :) See you...
Hi Sam,
thanks for helping me out on this Topic,
Heres my HA-Config for this Sensor:
- platform: mqtt
state_topic: 'sensor/esszimmer/dht22'
name: "Temperatur Esszimmer"
unit_of_measurement: '°C'
value_template: '{{ value_json.temperature }}'
- platform: mqtt
state_topic: sensor/esszimmer/dht22'
name: "Luftfeuchte Esszimmer"
unit_of_measurement: '%'
value_template: '{{ value_json.humidity }}'
In my Mosuitto-DB i have following entry:
esszimmer_dht22 sensor/esszimmer/dht22 *{"temperature":"18.90","humidity":"40.60"}
So it looks like your Sketch reports Values from DHT correctly but HA is not able to read the Topic.
I'll do some research on this, or do you have a tip to point me in the right direction?
Since it looks like, your Sketch is working fine, i think we can close the issue.
Thanks for help, and your awesome work with your Sketches, providing to all of us!
BR
Lukas
Oh my god...
Sorry guys for taking your Time.
I just found the issue -- it was my fault.
I had a missing ' in my sensor.yaml in the state_topic for the humidity. I just looked on it about 1000 times and did not see it...
Really sorry Guys.
@mertenats Thanks for your great work and sorry for inconvenience.
BR
Lukas
Hi,
i flashed your Sketch, and it seems to work.
After my setup in Home Assistant, humidity keeps saying unknow.
Heres the Output from the IDE-Serial Monitor:
Temperature works fine.
Thanks for help
BR
Lukas