In a previous post, I shared my home automation setup, and I’m back with a short adventure with RTL_433, SDR (Software Defined Radio) and some 433MHz humidity sensors.
Just as a quick recap, I have HA (Home Assistant) running in a Hyper-V VM on a Beelink EQ12.
My wife wanted to get some humidity sensors for our bathrooms to see if we needed dehumidifiers after showers. Naturally, I was curious to see if there were devices that could integrate in to HA.
Several users recommended these AcuRite 06044M wireless temperature and humidity sensors along with an SDR receiver that could be tuned to 433MHz.
433MHz is an ISM (Industrial, Scientific, Medical) band where sensors like this transmit. There are other things besides my humidity sensors that transmit around 433MHz. Which is an interesting topic for another day.
The SDR receivers can usually be tuned between 25MHz-1700MHz. I got lost for a day playing with SDR# and scanning over the available frequencies. FM radio stations can be picked up and listened to, and some OTA TV stations can be as well.
The sensors I got emit a signal every few seconds with information like temperature, humidity and battery level.
Here’s what those pulses look like in SDR#
Each of those blips is a sensor pulse.
A software package called rtl_433 can decode messages for devices it’s aware of and splits out the decoded message like so:
Cool! Now, how do I log that information?
There are some integrations with HA that can consume data from rtl_433, however Hyper-V STILL doesn’t do USB device pass through for some reason.
I looked at writing my own software in C#, but unfortunately, there’s not a lot of demodulation/decoding frameworks out there, and I gave up on that idea.
Fortunately for me, rtl_433 already has MQTT built-in and HA has a MQTT add-on. After a bit of a struggle getting the software to communicate nicely, I made it work!
I run rtl_433 as a service on Windows with this configuration:
output json
output mqtt://[replace-ha-ipaddress],user=[replace-your user],pass=[replace-your pass],retain=0,events=rtl_433[/model][/id]
report_meta time:utc
protocol 40
Rtl_433 can then be run with this command rtl_433-rtlsdr.exe -c ha.config
. The [/model][/id]
are placeholders that will automatically be substituted for the model and ID of the sensor (you can see that in the previous image). You should replace the IP address, user and password with whatever matches your configuration. "protocol 40" is what my particular sensors are. You can add multiple protocol lines if you need to.
In my home assistant configuration.yaml file, I then added blocks like so:
mqtt:
sensor:
- name: Acurite Temperature 1
device_class: temperature
unit_of_measurement: "°C"
value_template: "{{ value_json.temperature_C | round(1) }}"
state_topic: rtl_433/Acurite-Tower/1
unique_id: acurite_temperature_1
- name: Acurite Humidity 1
device_class: humidity
unit_of_measurement: "%"
value_template: "{{ value_json.humidity }}"
state_topic: rtl_433/Acurite-Tower/1
json_attributes_topic: rtl_433/Acurite-Tower/1
unique_id: acurite_humidity_1
Once the data starts to stream in, HA can display some lovely graphs.
I intend to put some triggers in place if the humidity stays above a certain point for too long, which could mean that the vent or dehumidifier isn’t running.
If you’re interested in more information about my setup or would like to see more posts like this, please let me know in the comments!
Comments
You can also comment directly on GitHub.