7$ USD 433 mhz sensor reader to MQTT

With this 7 dollar USB dimp you can push all temperature sensors to MQTT so HA can process them:
https://www.aliexpress.com/item/USB-2-0-Software-Radio-DVB-T-RTL2832U-R820T2-SDR-Digital-TV-Receiver-Stick-Hot-Product/32635958974.html

Temperature/humidity sensors for the scandinavian market which isnt too expensive: http://www.clasohlson.com/no/Temperaturgiver-hygrometer/36-1797

I have created a docker image for using this directly (docker needs access to the USB device)
https://hub.docker.com/r/roflmao/rtl2mqtt/

Output from script:

# docker exec -it 5d660092cb56 tail -f /rtl_433.log
{"time" : "2017-01-31 09:47:46", "model" : "WT450 sensor", "id" : 12, "channel" : 4, "battery" : "OK", "temperature_C" : -0.270, "humidity" : 93}

If you want to use the script manually (you need to compile rtl_433 manually yourself from https://github.com/merbanan/rtl_433)
https://github.com/roflmao/rtl2mqtt/blob/master/rtl2mqtt.sh

Temperature sensor picked up in HA:

- platform: mqtt
  state_topic: 'RTL_433/Raw'
  name: 'Kjøleskap temperatur'
  unit_of_measurement: "°C"
  value_template: "{% if value_json.id == 12 and value_json.channel == 4 %}{{ value_json.temperature_C | round(1) }}{% else %}{{ states.sensor.kjleskap_temperatur.state }}{% endif %}"
12 Likes

That’s pretty awesome, never though of using this kind of stick to receive 433MHz signal, it’s certainly one of the cheapest plug&play hardware solution.

UOU such an impressive work, could you gently do a more detailed DIY? I am very interested in this, however on the international market i kind of don’t know which sensor’s to buy, with this most likely you have just created an hub for 433mhz devices if i understood correctly.

Thanks for sharing

Hi @roflmao are you using hass.io?
Just wondered if you considered (re)packaging your docker image as a hassio addon?
I don’t currently have a RTL2382U dongle, but intending to get one. If/when I do, I’ll be happy to help achieve this.

Im not using hassio myself, so no im afraid.
The code is on github so have fun :slight_smile:

The link (aliexpress) is not working ??

Check ebay etc for “RTL SDR”

1 Like

So are you saying the rtl sdr would act as 433mhz receiver and able to receive 433mhz signals and then send it to HA ?

Forgive my novelty but how is the range of the rtl sdr as a 433mhz receiver? I would love to replace my existing 433mhz receivers with this and get a better range.

Thanks.

The device is a wide band tuner - it can tune to 433mhz.
The the raw data is sent to SDR software rtl_433, which extracts the sensor data, matches it to a device profile etc.

Sorry I can’t yet answer about range - mine is in the post from China to UK :slight_smile:

Right I see. Could you please explain about the docker image? Do I have to install it on the machine which the tuner is connected to?

That’s awesome! I’ll give this a try tonight. I’ve got a few RTL-SDR dongles sitting around, never thought about using one of them for this purpose.

@bachoo786 Yep, that’s exactly what this is. As for range, it really depends on 2 things. The output power / antenna of the transmitter. And the receiving power of the RTL’s antenna. Nice thing is, most of the RTL-SDR’s that I’ve used, have an external antenna connector, so you could add a high gain antenna for longer distances.

As a side note, I’ve used one of these RTL-SDR’s to receive NOAA weather satellite imagery. Best part is, I was able to use the antenna that came with the unit, and it worked just fine. So I don’t think you’ll have an issue with range.

I’ll have to do some testing, but does anyone know if you can receive readings from multiple radios, using different protocols? Perhaps polling different devices, at different intervals.

1 Like

Yes.
Also probably need to configure something in docker to make the USB dev available in the docker container.
I use VMWare so I will also need to passhthrough the USB to the VM.
When I get the device I will try to help more.

1 Like

Check here:

it enumerates the list of supported devices.

Looking through the github page, it looks like the radio / software can be run from anywhere, as long as it’s on the same network, using the MQTT option. So you could have a dedicated PiZero, with the RTL-SDR, connected via wifi. Acting as a 433mhz-MQTT bridge.

1 Like

I will hold fire and won’t buy one until I hear your results but it does look encouraging and I have a pi zerow lying around the house.

The dvb dongle needs to be on same device as the docker image (radio software).
HA can be somewhere (anywhere!) else as long as it can see the mqtt messages.

I don’t think that’s accurate. The software on the git repo is entirely independent of HA, as well as docker. No where on the page does it even mention docker…

I haven’t tested this, but the following should work:
RTL-SDR->USB->RPi Zero->RTL_433 (software)-> Wireless connection -> MQTT broker -> HA.

If RTL-433 was setup as a service and run on bare metal on the RPi Zero, with the sole job of bridging 433Mhz devices with MQTT, it could be anywhere (on the local network) No docker necessary.

1 Like

You are completely correct :smiley:
I just plan to use docker as the OP linked to his docker image that does the USB–>RTL_433 bit.
For me its better as my server:

  • is in middle of house (for good range)
  • runs 24/7
  • has spare usb ports
  • runs docker (in VM under ubuntu) which also hosts hass.io

ALso need to be sure that the rtl driver is available for ARM arch and that rpi zero has the CPU necessary to run the SDR.

Well that makes sense! :smiley:
In that situation, the RTL-SDR would need to be directly connected to the system running the docker image. (as you, and the op stated)

This has got me thinking… (which could be bad)

Got one of these sat in a drawer not being used! Might give this a go with my energy monitor and LightwaveRF switches (currently using an RFXCOM)

If this works I could get another one and have two identical instances of home assistance mosquitto (for redundancy)