pmorris1
(Philip)
August 28, 2019, 9:15am
1
Hi
I have successfully used ESPHome and a dht11 sensor with hassio to display humidity and temperature on the lovelace page. However i have noticed that it only displays changes of temperature as whole degrees eg 23.0 deg C or 24.0 deg C. It never displays, say, 23.7 deg C. This is also what is displayed if I look at any graphs such as in the History, any changes are in whole degrees.
Does anyone have any idea why this is?
thanks
Phil
Because the accuracy is ± 2 Degrees:
tom_l
August 28, 2019, 9:29am
3
That is not the reason. There is a difference between ‘accuracy’ and ‘resolution’.
@pmorris1 what does the ESPhome logger show?
What does your ESPhome config look like?
1 Like
pmorris1
(Philip)
August 28, 2019, 10:58am
4
Hi Tom
thanks for this.
ESP logger shows
[11:55:15][C][logger:140]: Hardware UART: UART0
[11:55:15][C][dht:017]: DHT:
[11:55:15][C][dht:018]: Pin: GPIO4 (Mode: INPUT)
[11:55:15][C][dht:022]: Model: DHT11
[11:55:15][C][dht:027]: Update Interval: 20.0s
[11:55:15][C][dht:029]: Temperature ‘NodeMCU Temperature’
[11:55:15][C][dht:029]: Unit of Measurement: ‘°C’
[11:55:15][C][dht:029]: Accuracy Decimals: 1
[11:55:15][C][dht:029]: Icon: ‘mdi:thermometer’
[11:55:15][C][dht:030]: Humidity ‘NodeMCU Humidity’
[11:55:15][C][dht:030]: Unit of Measurement: ‘%’
[11:55:15][C][dht:030]: Accuracy Decimals: 0
[11:55:15][C][dht:030]: Icon: ‘mdi:water-percent’
[11:55:15][C][ota:029]: Over-The-Air Updates:
[11:55:15][C][ota:030]: Address: nodemcu_dht11.local:8266
[11:55:15][C][api:103]: API Server:
[11:55:15][C][api:104]: Address: nodemcu_dht11.local:6053
[11:55:29][D][dht:048]: Got Temperature=25.0°C Humidity=54.0%
[11:55:29][D][sensor:092]: ‘NodeMCU Temperature’: Sending state 25.00000 °C with 1 decimals of accuracy
[11:55:29][D][sensor:092]: ‘NodeMCU Humidity’: Sending state 54.00000 % with 0 decimals of accuracy
ESPHome config is
esphome:
name: nodemcu_dht11
platform: ESP8266
board: nodemcuv2
wifi:
ssid: “xxxxxx”
password: “xxxxxxxxx”
Enable logging
logger:
Enable Home Assistant API
api:
ota:
sensor:
platform: dht
pin: D2
temperature:
name: “NodeMCU Temperature”
humidity:
name: “NodeMCU Humidity”
update_interval: 20s
model: DHT11
Thanks
Phil
Add this:
accuracy_decimals: 2
pmorris1
(Philip)
August 28, 2019, 11:33am
6
Hi
I have changed config to read
sensor:
BUT unfortunately it has not worked. Output now just reads 25.00 deg C
Seems like the DHT11 sensor only output integers and not decimals.
https://www.mouser.com/ds/2/758/DHT11-Technical-Data-Sheet-Translated-Version-1143054.pdf
pmorris1
(Philip)
August 28, 2019, 11:42am
8
Oh Right!
thanks for this info - it was just puzzling me.
Phil
SteveDinn
(Steve Dinn)
November 15, 2019, 7:51pm
9
Why do the same sensors output non-integer values when attached to a TASMOTA device then?
tom_l
November 15, 2019, 11:47pm
10
According to the datasheets the DHT22 reports fractions but the DHT11 does not.
SteveDinn
(Steve Dinn)
November 16, 2019, 12:29am
11
That’s weird. I just moved a DHT-11 from a NodeMCU running tasmota to an Esp32 on ESPHome and it went from reporting fractions to whole degrees.
tom_l
November 16, 2019, 12:54am
12
That is odd. I wonder how Tasmota does it considering it should not be supported?
SteveDinn
(Steve Dinn)
November 16, 2019, 3:46am
13
You can see in the graph where I changed the sensor from Tasmota to esphome
tom_l
November 16, 2019, 3:48am
14
I believe you, it’s just strange that Tasmota can do that considering what the datasheet says.
mannte
(Mante)
January 3, 2020, 11:20am
15
The topic is a bit old but it is still relevant. I had the same question what I found is that there is a new datasheet for the DHT11, which includes the first decimal. They already implemented it in the dev version of ESPhome: https://github.com/esphome/esphome/pull/861
I just tested it. In HassIO you can run both the dev and final version alongside each other, or just wait a little till it is released.
1 Like
pmorris1
(Philip)
January 3, 2020, 2:23pm
16
Hi. Thanks for this. Useful information