Hi! I’ve been trying to streamline my 433MHz sensor setup in Home Assistant, and ended up creating two simple add-ons that work together to get data from rtl_433 into HA thru MQTT with automatic discovery. So now, whenever I turn on a new Acurite temperature sensor, it automagically shows up as a device under the MQTT integration, with separate entities for temperature, humidity and battery status. And the whole thing runs under the Home Assistant OS supervisor - no need to babysit separate scripts anymore.
This add-on launches rtl_433 with your configuration file in a container under Home Assistant OS. You configure it to listen to whatever frequencies/devices you need and to publish the data into MQTT.
This add-on helps Home Assistant ingest and interpret the rtl_433 data by periodically publishing MQTT discovery topics based on the device and event information coming from rtl_433.
The script looks for specific bits of data in rtl_433’s output to figure out what kind of sensor the data is coming from and to help Home Assistant handle it appropriately.
More specifically, this script looks for the following keys in rtl_433’s event data:
Hi, tomorrow I will try this addon.
I already have a question: how did you solve the problem of dynamic sensor id, as it changes randomly after replacing the sensor batteries?
Thank you,
Piero
Not sure - I haven’t seen that problem yet. I have two Acurite 592TXs and a Kerui motion sensor, and they seem to keep their IDs between battery changes - just did a quick test. I guess it depends on the sensor’s hardware implementation.
If you have one sensor of a particular kind/model/brand, then I’d look at the scripts to try and hardcode an ID and ignore what sensor returns. If you have several, some more complicated scheme might be necessary, where you could hardcode unchanging IDs and find a way to assign the random IDs back to the stable ones during battery changes… Sounds complicated.
Sorry for the beginner question - I have not yet implemented any 433Mhz sensors into Home Assistant but have been looking at rtl_433, RFLINK & Sonoff RFBridge.
Will these add-ons allow me to use a Realtek RTL2832 USB dongle and have the 433Mhz sensors appear in Home Assistant via MQTT?
Yup, that’s the idea. I’m using a Nooelec Nesdr dongle connected to the Raspberry Pi running Home Assistant OS, works great with rtl_433. Check rtl_433’s “supported hardware” page here: https://triq.org/rtl_433/HARDWARE.html
Ah I see, thanks for the pointer. Maybe it makes sense to fork rtl_433_mqtt_hass.py and let people add custom logic like what AhmadK was suggesting to override friendly_names with a mapping…
Hi, mind posting a screenshot with the contents of that “…-WD” topic? Then I’ll check HA source code to see what kind of support it has for windspeed and what keys it might be expecting.
thanks for this great addon. Thanks to him, I can measure the amount of water in the well.
I would like to ask what should I add to the configuration file so that the addon runs with all protocols?
If I enter rtl_433 -G 4 then the addon will not start properly.
output mqtt://core-mosquitto:1883,user=homeassistant,pass=xxx
frequency 433.92M
rtl_433 -G 4
Thank you for answer. Unfortunately, if I add to the configuration file register_all true, then the addon does not work.
If I delete this line, it will start correctly right away.
Can you please see where the error is?
Log:
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting rtl_433 -c /config/rtl_433/rtl_433.conf
rtl_433 version 20.11-66-gc2124fa6 branch master at 202102071317 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Publishing MQTT data to core-mosquitto port 1883
Publishing device info to MQTT topic "rtl_433/9b13b3f4-rtl433/devices[/type][/model][/subtype][/channel][/id]".
Publishing events info to MQTT topic "rtl_433/9b13b3f4-rtl433/events".
Publishing states info to MQTT topic "rtl_433/9b13b3f4-rtl433/states".
Use -G for testing only. Enable with -G 4 if you really mean it.
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
Configuration file :
output mqtt://core-mosquitto:1883,user=homeassistant,pass=XXX
frequency 433.92M
register_all true
Looking at rtl_433’s source code, I’m not seeing a way to specify “-G 4” via a config file. You have a couple of options:
Explicitly specify all protocols that you need, one per line in the config file, something like this:
protocol 1
protocol 2
protocol ...
...
This is tedious, but do you really need all 100+ protocols enabled? Full list can be found here.
2. Fork my addons repository on GitHub, pass “-G 4” on the command line to rtl_433 in run.sh, and install the add-on from your GitHub fork instead of mine.
3. Copy the add-on to your Home Assistant server’s addons file share (as described in the dev documentation), and change run.sh to pass “-G 4” to rtl_433.