Hi everyone,
As the title says. I was scouring the internet for a convenient way to connect my DHT22 sensor to home assistant. While I did find a couple of solutions which I could run on my raspberry pi, none of them featured all four components that I was looking for:
- A dockerized solution, which will not clutter my host os with libraries and scripts lying around.
- An MQTT client to connect to HAs’ own MQTT integration.
- Support for Home assistants’ discovery protocol for a more seamless integration.
- Outlier filtering.
About 4), you could apply some post-processing in HA, but it requires using templates and is not as flexible.
Some unmentioned benefits to this approach are:
- Lightweight container, around 50mbs unpacked.
- Using the newer adafruit-circuitpython-dht library.
- Fully configurable. You can turn on or off any of the features: MQTT, HA discovery or the outlier filtering.
So anyway, here is the link to it with some supplementary information in how it works and a list of the configurable parameters for the curious: dht22mqtt-homeassistant-docker.
Full disclosure:
I have not tested this with a dht11 or am2302 sensors, since I only have a dht22 one, but if you end up using it with either I’ll appreciate the feedback.