Raspberry Pi DHT22 Sensor monitor from other Rpi

So I am currently running Home Assistant off a VM. I have a bunch of Raspberry Pis around the house using the DHT22 Sensor. The RPis are running Arch Linux. I noticed the HA DHT plugin is made for HA off the Rpi.( i believe) Any plugin to pull in data from other Rpis?

Not sure about plugins, but I just run bash scripts and MQTT to push the current temperature to HA.

Send the data over mqtt.

Thank you. I’ll give it a try

Does anyone have a good script to upload the DHT22 on remote Raspberry Pi to HA via MQTT? I got the Mqtt working but only found a python2 script. I believe I am running python3

Using the AdafruitDHT module,

#!/bin/bash
set -e

CT=$(/usr/local/bin/AdafruitDHT.py 2302 17) &&
CT=$(echo $CT | sed 's/.*Temp=\(.*\)\* .*/\1/') &&

if [[ $CT =~ ^[+-]?[0-9]+\.?[0-9]*$ ]]; then
        mosquitto_pub -h 192.168.10.7 -p 1883 -t "home/livingroom/temperature" -m $CT -u homeassistant -P xxx -r
else
        echo Error: $CT
fi
4 Likes