rtl_433 with MQTT, Graphite, InfluxDB, …
The ISM-band decoder (433.92 MHz, 915 MHz – in America, 868 MHz – actually SRD-band) rtl_433 can output events and data to network easily. Here is a short guide.
The rtl_433 program is capable of network output, it turns radio data into plain text network packets.
Run rtl_433 with
-F syslog e.g.
rtl_433 -F syslog:127.0.0.1:1514
and you’ll get the JSON data in syslog format on UDP port 1514.
To quickly inspect this, try e.g.
socat udp-listen:1514 -
The output options of rtl_433 can be freely combined, you can add CSV, KV, and plain JSON as needed together with Syslog output.
Bridges, MQTT, Graphite
Use some small program to receive the lines, strip the syslog header and process the JSON as needed. There are some sample scripts in rtl_433_relay repo The rtl_433_graphite_relay.py and rtl_433_mqtt_relay.py should be quite useful for time-series logging or forwarding to a message broker. (Note that you need to change port numbers and host addresses.)
These small scripts should be easy to adapt to other kinds of output, like SQLite, or some other DB, preferable InfluxDB. You can trigger custom actions like pinging you by Jabber message (see the SleekXMPP library).
The scripts and rtl_433 can just be started, maybe in the background, the scripts can even be enhanced to run as daemon. It is advisable to just run the plain programs under a supervisor program though. You get free restarts, solid control and status output.
E.g. with Supervisord add blocks like these to the control file or put them in individual files on their own.
The paths, your username and especially the device numbers of interest (-R x) will vary.
rtl_433 will gain the ability to natively output MQTT soon, for all other consumers and if you need post processing of events it will always be a good option to use the UDP transport and a bridge script.