7$ USD 433 mhz sensor reader to MQTT

Nope, hereā€™s what I did, after installing the latest Raspbian Lite:
(Most of this is all taken directly form the github page)

  1. sudo apt-get install libtool libusb-1.0.0-dev librtlsdr-dev rtl-sdr cmake
  2. git pull https://github.com/merbanan/rtl_433.git
  3. cd rtl_433/
  4. mkdir build
  5. cd build
  6. cmake ../
  7. make
  8. sudo make install

Here is the exact RTL-SDR Iā€™m using.

Iā€™m currently testing the software, in a non-permanent fashion, in a screen session, with the following command: sudo rtl_433 -F json -G | mosquitto_pub -t outdoor/rtl_433 -l -h 192.168.x.x

Ran out of time to see if sudo was absolutely necessary, it may not be. The user running the command, may just need to be in the dialout group, not sure yet, will investigate tonight.

2 Likes

That device is tidy!

Sure is! Works great as well.
I plan on embedding the RTL-SDR with the Raspberry Pi Zero, into some kind of 3D-printed, all-in-one case; Iā€™ll design it once I get the software all figured outā€¦ So itā€™s basically a remotely managed, 433 -> MQTT bridgeā€¦ Should be fun! :wink:

1 Like

So did u manage to figure out the software bud?

So I got my device and installed as per your instructions. However when I run sudo rtl_433 -F json -G | mosquitto_pub -t outdoor/rtl_433 -l -h 192.168.0.8

I get connection refused. Here is my log:

pi@raspberry:~ $ sudo rtl_433 -F json -G | mosquitto_pub -t outdoor/rtl_433 -l -h 192.168.0.8
Connection Refused: not authorised.
Registering protocol [1] "Silvercrest Remote Control"
Registering protocol [2] "Rubicson Temperature Sensor"
Registering protocol [3] "Prologue Temperature Sensor"
Registering protocol [4] "Waveman Switch Transmitter"
Registering protocol [5] "Steffen Switch Transmitter"
Registering protocol [6] "ELV EM 1000"
Registering protocol [7] "ELV WS 2000"
Registering protocol [8] "LaCrosse TX Temperature / Humidity Sensor"
Registering protocol [9] "Template decoder"
Registering protocol [10] "Acurite 896 Rain Gauge"
Registering protocol [11] "Acurite 609TXC Temperature and Humidity Sensor"
Registering protocol [12] "Oregon Scientific Weather Sensor"
Registering protocol [13] "Mebus 433"
Registering protocol [14] "Intertechno 433"
Registering protocol [15] "KlikAanKlikUit Wireless Switch"
Registering protocol [16] "AlectoV1 Weather Sensor (Alecto WS3500 WS4500 Ventus W155/W044 Oregon)"
Registering protocol [17] "Cardin S466-TX2"
Registering protocol [18] "Fine Offset Electronics, WH2 Temperature/Humidity Sensor"
Registering protocol [19] "Nexus Temperature & Humidity Sensor"
Registering protocol [20] "Ambient Weather Temperature Sensor"
Registering protocol [21] "Calibeur RF-104 Sensor"
Registering protocol [22] "X10 RF"
Registering protocol [23] "DSC Security Contact"
Registering protocol [24] "Brennenstuhl RCS 2044"
Registering protocol [25] "GT-WT-02 Sensor"
Registering protocol [26] "Danfoss CFR Thermostat"
Registering protocol [27] "Energy Count 3000 (868.3 MHz)"
Registering protocol [28] "Valeo Car Key"
Registering protocol [29] "Chuango Security Technology"
Registering protocol [30] "Generic Remote SC226x EV1527"
Registering protocol [31] "TFA-Twin-Plus-30.3049 and Ea2 BL999"
Registering protocol [32] "Fine Offset Electronics WH1080/WH3080 Weather Station"
Registering protocol [33] "WT450"
Registering protocol [34] "LaCrosse WS-2310 Weather Station"
Registering protocol [35] "Esperanza EWS"
Registering protocol [36] "Efergy e2 classic"
Registering protocol [37] "Inovalley kw9015b, TFA Dostmann 30.3161 (Rain and temperature sensor)"
Registering protocol [38] "Generic temperature sensor 1"
Registering protocol [39] "WG-PB12V1"
Registering protocol [40] "Acurite 592TXR Temp/Humidity, 5n1 Weather Station, 6045 Lightning"
Registering protocol [41] "Acurite 986 Refrigerator / Freezer Thermometer"
Registering protocol [42] "HIDEKI TS04 Temperature, Humidity, Wind and Rain Sensor"
Registering protocol [43] "Watchman Sonic / Apollo Ultrasonic / Beckett Rocket oil tank monitor"
Registering protocol [44] "CurrentCost Current Sensor"
Registering protocol [45] "emonTx OpenEnergyMonitor"
Registering protocol [46] "HT680 Remote control"
Registering protocol [47] "S3318P Temperature & Humidity Sensor"
Registering protocol [48] "Akhan 100F14 remote keyless entry"
Registering protocol [49] "Quhwa"
Registering protocol [50] "OSv1 Temperature Sensor"
Registering protocol [51] "Proove"
Registering protocol [52] "Bresser Thermo-/Hygro-Sensor 3CH"
Registering protocol [53] "Springfield Temperature and Soil Moisture"
Registering protocol [54] "Oregon Scientific SL109H Remote Thermal Hygro Sensor"
Registering protocol [55] "Acurite 606TX Temperature Sensor"
Registering protocol [56] "TFA pool temperature sensor"
Registering protocol [57] "Kedsum Temperature & Humidity Sensor"
Registering protocol [58] "blyss DC5-UK-WH (433.92 MHz)"
Registering protocol [59] "Steelmate TPMS"
Registering protocol [60] "Schrader TPMS"
Registering protocol [61] "LightwaveRF"
Registering protocol [62] "Elro DB286A Doorbell"
Registering protocol [63] "Efergy Optical"
Registering protocol [64] "Honda Car Key"
Registering protocol [65] "Template decoder"
Registering protocol [66] "Fine Offset Electronics, XC0400"
Registering protocol [67] "Radiohead ASK"
Registering protocol [68] "Kerui PIR Sensor"
Registering protocol [69] "Fine Offset WH1050 Weather Station"
Registering protocol [70] "Honeywell Door/Window Sensor"
Registering protocol [71] "Maverick ET-732/733 BBQ Sensor"
Registering protocol [72] "RF-tech"
Registering protocol [73] "LaCrosse TX141TH-Bv2 sensor"
Registering protocol [74] "Acurite 00275rm,00276rm Temp/Humidity with optional probe"
Registering protocol [75] "LaCrosse TX35DTH-IT Temperature sensor"
Registering protocol [76] "LaCrosse TX29IT Temperature sensor"
Registering protocol [77] "Vaillant calorMatic 340f Central Heating Control"
Registering protocol [78] "Fine Offset Electronics, WH25 Temperature/Humidity/Pressure Sensor"
Registering protocol [79] "Fine Offset Electronics, WH0530 Temperature/Rain Sensor"
Registering protocol [80] "IBIS beacon"
Registering protocol [81] "Oil Ultrasonic STANDARD FSK"
Registering protocol [82] "Citroen TPMS"
Registering protocol [83] "Oil Ultrasonic STANDARD ASK"
Registering protocol [84] "Thermopro TP11 Thermometer"
Registering protocol [85] "Solight TE44"
Registering protocol [86] "Wireless Smoke and Heat Detector GS 558"
Registering protocol [87] "Generic wireless motion sensor"
Registering protocol [88] "Toyota TPMS"
Registering protocol [89] "Ford TPMS"
Registering protocol [90] "Renault TPMS"
Registering protocol [91] "inFactory"
Registered 91 out of 91 device decoding protocols
Found 1 device(s):
  0:  Realtek, RTL2838UHIDIR, SN: 00000001

Using device 0: Generic RTL2832U OEM
Found Fitipower FC0012 tuner
Exact sample rate is: 250000.000414 Hz
Sample rate set to 250000.
Bit detection level set to 0 (Auto).
Tuner gain set to Auto.
Reading samples in async mode...
Tuned to 433920000 Hz.
Connection Refused: not authorised.

Any ideas ?

Connection Refused: not authorised.
Do you have authentication enabled on your MQTT broker?
Might need to add -u -P to the command for username & password, respectively.
So:

sudo rtl_433 -F json -G | mosquitto_pub -t outdoor/rtl_433 -l -h 192.168.0.8 -u user -P pass

Also, if you run this, by itself, what do you see?

sudo rtl_433 -F json -G

Right it was the username and password needed. However it runs well but when I transmit a rf signal from my remote it doesnā€™t pick it up (the transmitted code) which is very surprising. Do you experience that?or am I doing something wrong?

Youā€™ll probably have to do a little troubleshooting to figure this out. Try running:

rtl_433 -G

It wonā€™t pipe to MQTT, but it will try and decode all known signals.
If that doesnā€™t work, check to see if your device is in the ā€œsupported device protocolsā€ table, on the github page.

If that still doesnā€™t work, you might have to work on adding your device, to the supported devices. See the ā€œSupporting Additional Devices and Test Dataā€ section on the github page.

1 Like

OK so my DVB-T dongle arrived from chinaā€¦ complete with crappy aerial and remote control :smiley:
Turns out its a FC0012 tuner model.
Iā€™ve connected it to my x86 ESXi server and passed the USB through to an Ubuntu 16.04 VM (this one happens to be also running docker + hass.io).
I needed to blacklist the DVB kernel modules to get rtl_433 working.

But I have problemsā€¦

Firstly I cannot receive and decode the signals from a known supported device (protocol [44] ā€œCurrentCost Current Sensorā€).
When running rtl_433 -a I can see a periodic packet every 6 seconds, which is what I expect from the current costā€¦ but its not decoded when running with rtl_433 -R 44 - I just see nothing.

Secondly whenever rtl_433 quits it seems to leave the USB device in a non-functioning state, and I need to pull and re-insert the dongle. If I donā€™t do this then next time I run rtl_433 it exits as soon as it calls out to rtl_sdr - i.e. pretty much immediately. Weirdly this seems to be related to the version of rtl_433/rtl_sdr being run - when I ran an out of date version of rtl_433 from docker (https://hub.docker.com/r/sysrun/rtl_433/) it didnā€™t have the same issuesā€¦

I also tried with very latest versions with a new docker image I forked from here:
https://hub.docker.com/r/hijinx/rtl433test/
The latest version has support for more devices, but exhibits this ā€œonly works on 1st executionā€ issueā€¦
(BTW I also compiled and ran rtl_433 directly on the ubuntu vm with same result)

Is it my cheap and crappy dongle? Should I try with a device from reputable (and more expensive) brand?
Or do I need to fiddle about with any of the tuner parameters? (and if so, how to I find out what?)

Haha. Issue #1 was a simple thingā€¦

Just needed to correct the tuning offset by finding the ppm value per these great instructions:

Yes. I am a SDR noob :wink:

Still having issue #2

2 Likes

Got it working in the end, by using someoneā€™s docker image with an out-of-date version of rtl_433:

The only info I get from the current cost is current usage in W every 6 seconds:

image

1 Like

I bought the current cost and now thinking of returning it as I had the same issues as you mentioned in your previous posts.

My problem is more with the rtl dongle I thinkā€¦ itā€™s weird that it works great with an old version of rtlsdr and rtl433, but if I use latest rtlsdr and compile rtl433 from source itā€™s working only 1st time I run them never again until I pull and reinsert the dongle.

What rtl dongle (with which tuner) are you using?

Realtek RTL2838UHIDIR is what I use.

If youā€™re running docker feel free to try my CurrentCost rtl_433 to MQTT image:

https://hub.docker.com/r/hijinx/currentcost_rtl433/

Note that this image hardcodes the tuner offset ppm (rtl_433 -p switch) to the offset for my tuner.
If you need to change this you can fork my repo and change the rtl2mqtt.sh script to update the ppm value or remove the -p switch and get docker hub to build you a custom image.

Ultimately I hope that the problems I have with rtl_433 crashing with new version are due to my cheap and crappy tuner rather than the software. I have another tuner on order to check this. If that one works well Iā€™ll update the rtl_433 docker to be a hass.io addonā€¦

3 Likes

I found the problem - it was a bug in rtl_433 that I have squashed :slight_smile:
Now updated as a hass.io addon:

2 Likes

Hi !

If I have 3 sensors for my 2gigs alarm system that are on 433mhz, do I have to synchronize them with the usb key ? How does it know that itā€™s a door sensor or a movement sensor ?

Thanks !

Hi, sorry to rewamp such an old 3ad.
Is this graph coming from OWLā€™s data?
TIA

Graph is generated from OWL using RFXCOM component

thank you for your answer

would you mind to share your mqtt config? kinda a newbie here :slight_smile:
Thank you