What this does (and does not) do
- rtl_433 listens with an RTL-SDR dongle and decodes the packets of many 433.92 MHz devices. The README describes it as a generic receiver mainly for the 433.92 MHz, 868 MHz, 315 MHz, 345 MHz and 915 MHz bands. It receives only. It does not transmit.
- It publishes decoded readings to MQTT. A helper script then publishes Home Assistant MQTT discovery messages so entities appear automatically.
- It only supports devices it has a decoder for. Check the supported-device list in the README before buying sensors. You can also run it in the same place for a while to see what is on the air near you.
- An RTL-SDR USB dongle and a small antenna suitable for 433 MHz.
- A small always-on Linux host or container (a Raspberry Pi works) on the same network as your MQTT broker. Put the dongle on a short USB extension, away from noisy USB 3 devices.
- An MQTT broker (such as Mosquitto) with a username and password for rtl_433, and Home Assistant's MQTT integration with discovery enabled.
- Compatible sensors. Many generic 433 MHz sensors are one-way and unencrypted, so the readings can be seen by anyone with a receiver.
Install rtl_433 from your distribution's package or build from source (see the README), then run it with no options:
Code: Select all
rtl_433
Step 2: Publish to MQTT
The example configuration file documents the MQTT output: -F mqtt://host:port,options. By default the user and password come from the MQTT_USERNAME and MQTT_PASSWORD environment variables, which keeps the password out of the process list and the command history. Use SI units with -C si, which the HA helper script strongly recommends.
Code: Select all
export MQTT_USERNAME=rtl433
export MQTT_PASSWORD='your-password'
rtl_433 -C si -F mqtt://YOUR_BROKER_IP:1883,retain=0
For anything permanent, put the options in an rtl_433 config file (the example config in the repository documents every option, including convert si and the output lines) and run it as a service (systemd or a container) so it restarts on boot.
Step 3: Home Assistant discovery
The repository's examples/rtl_433_mqtt_hass.py script subscribes to the rtl_433 events and publishes discovery topics so Home Assistant creates the entities. Its header notes that:
- it needs the Python paho-mqtt library;
- it can run as a daemon and republishes the configuration roughly every 10 minutes, or you can use MQTT retain so it only needs to run when things change;
- if you changed rtl_433's topic structure you must pass the same topic to the script with -T;
- you can test against a different discovery prefix first to avoid cluttering Home Assistant with stray entities, because transient devices and false positives linger until their config topic is cleared.
Code: Select all
export MQTT_USERNAME=rtl433
export MQTT_PASSWORD='your-password'
python3 rtl_433_mqtt_hass.py -H YOUR_BROKER_IP -r
Tidy-up and tips
- Use the script's ID filter if you only want specific sensors, so neighbours' devices do not become entities.
- Sensors with unreliable batteries, or that report only on change, may look "stale". The script has an option to force updates and one to expire values.
- Do not rely on 433 MHz sensors for anything safety-critical.
- rtl_433 only listens, but your MQTT broker should still need authentication. Do not expose it to the internet.
Question for the group: has anyone built a whole-house sensor set on rtl_433? Which sensors (or weather station) work well in Australia, and which decoders were missing?