Hey i am trying to connect 12 DTH 22 sensors on one pi
i am getting the following warning
Updating dht sensor took longer than the scheduled update interval 0:00:30
some of the data is corrupted as well any solution for this?
Hey i am trying to connect 12 DTH 22 sensors on one pi
i am getting the following warning
Updating dht sensor took longer than the scheduled update interval 0:00:30
some of the data is corrupted as well any solution for this?
I have had trouble with this too. My short term solution was to add filter sensors as shown below and ignore the originals. Might not be the best solution, but as a temporary fix it does the job for me. I do still get the errors in the log though.
- platform: dht
name: study_pi_dht
sensor: AM2302
pin: 4
scan_interval: 300
monitored_conditions:
- temperature
- humidity
- platform: filter
name: "Study humidity"
entity_id: sensor.study_pi_dht_humidity
filters:
- filter: outlier
window_size: 4
radius: 2.0
- platform: filter
name: "Study temperature"
entity_id: sensor.study_pi_dht_temperature
filters:
- filter: outlier
window_size: 4
radius: 1.5
I have one test sensor with less than 10cm leads to my pi and I get these warnings all the time. I was hoping the 0.78 update that included:
Upgrade Adafruit-DHT to 1.3.4 (@thomaslian - #16327) (sensor.dht docs)
would fix the issue but it has not.
I too have had to add filtered sensors for the longer (~20m cat5e) runs to my DHT sensors. Even with 3.3.-5V level converters the sensor values spike all over the place.
The shorter runs (~1 to 3m of cat5e) have less data corruption but it is still there.
Iāve just about given up on this component.
I forgot to mention that I use quite a few DHT sensors and the only one I have issues with is the one connected directly to the Pi I use the ESPHomeYAML addon from @OttoWinter and ESP 8266 modules and have not had a single corrupt result from them. The added bonus being I can move them anywhere ( on battery or mains power ) as they communicate back via WIFI
oh wow! that is amazing. Do you have any recommendations on which ESP module to use for the DHT22?
I personally use the nodemcu dev boards ( https://amzn.to/2Rk7VIs ) at the moment, Iām looking to build my own custom board soon once I have decided on an an enclosure. So long term I hope to be able to switch from them to my custom units, but they are rock solid and stable for me so far. I have about 7 of them running at the moment
I think Iāll go for the WEMOS D1 mini. Iāll be able to fit that behind my DHT22 faceplates.
Can you please explain what the filter is doing?
Sure. Have a look at the code below.
- platform: filter
name: 'Rumpus Room Temperature'
entity_id: sensor.dht_rumpus_temperature
filters:
- filter: outlier
window_size: 4
radius: 2.0
- filter: lowpass
time_constant: 2
precision: 1
This is two filters in the one sensor.
As far as I understand it, it works like this:
The first filter, outlier
, will take the median of the last four states and use that to reject any new measurement that is further than the radius setting away. e.g. for the example above, if the median of the last four measurements was 6 then if the next measurement is above 8 or below 4 it will be rejected (and the sensor will not update). You may have to adjust this radius so that you only reject false readings. As the DHT sensor values change quite slowly this low value of 2Ā°C works well for me. Note, the filter sensor at this stage is not displaying the calculated median it is only using this to reject or pass new measurements. This is a great way to reject spikes caused by corrupted data.
The next filter is a low pass, it rounds the edges of step changes. The bigger the time constant the greater the smoothing, but also the longer it takes for the output to change. The precision setting rounds the final value to one decimal place.
does anyone knows the root cause of failure is this the sensor or software issue?
Considering @allan wrote this:
And that a DHT sensor connected to the GPIO logs a lot of āupdating is taking longer than 10 secondsā errors to the log, I would say that the component code is at fault. HA has ssues with the GPIO used as binary sensors too.
i use wemos d1 mini and flash with tasmota firmare to add sensors via mqtt
Do you have any issues with them?
No they are pretty reliable so far
No, and still looking for a fix