Home Assistant Add-on: rtl_433 with MQTT auto discovery

One more note: if you dont specify any protocols at all in your config file, rtl_433 will enable all protocols that it knows about EXCEPT for some that developers marked as “require more testing”. Try this first and see if it addresses your needs.

Thank you for your help.
Specifying the individual protocols needed is an ideal solution.
I don’t know why I didn’t think of that.
I also needed to run excluded protocol number 120 for my thermometer. It seems to work flawlessly.

1 Like

Hoping someone here can help, i’m trying to get my ECOWITT WH51 Soil Sensor working to report it’s moisture level to home assistant.

This is my topic, the only entity I see from this device in Home Assistant is the battery level, any ideas why I can’t see the moisture?

homeassistant/sensor/Fineoffset-WH51-00141d/Fineoffset-WH51-00141d-H/config : {"device_class": "moisture", "name": "Fineoffset-WH51-00141d-H", "unit_of_measurement": "%", "value_template": "{{ value|float }}", "state_topic": "rtl_433/9b13b3f4-rtl433/devices/Fineoffset-WH51/00141d/moisture", "unique_id": "Fineoffset-WH51-00141d-H", "device": {"identifiers": "Fineoffset-WH51-00141d", "name": "Fineoffset-WH51-00141d", "model": "Fineoffset-WH51", "manufacturer": "rtl_433"}}
Published Fineoffset-WH51/00141d: battery_ok, moisture
Skipped Fineoffset-WH51/00141d: battery_mV, boost, ad_raw
homeassistant/sensor/Fineoffset-WH51-00141d/Fineoffset-WH51-00141d-B/config : {"device_class": "battery", "name": "Fineoffset-WH51-00141d-B", "unit_of_measurement": "%", "value_template": "{{ float(value|int) * 99 + 1 }}", "state_topic": "rtl_433/9b13b3f4-rtl433/devices/Fineoffset-WH51/00141d/battery_ok", "unique_id": "Fineoffset-WH51-00141d-B", "device": {"identifiers": "Fineoffset-WH51-00141d", "name": "Fineoffset-WH51-00141d", "model": "Fineoffset-WH51", "manufacturer": "rtl_433"}}

I just found this in my log, it looks like the device class value of ‘moisture’ is not acceptable, how would I go about changing that to ‘humidity’ ?

2021-03-17 15:26:06 ERROR (MainThread) [homeassistant.util.logging] Exception in async_discover when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'device_class': 'moisture', 'name': 'Fineoffset-WH51-00141d-H', 'unit_of_measurement': '%', 'value_template': '{{ value|float }}', 'state_topic': 'rtl_433/9b13b3f4-rtl433/devices/Fineoffset-WH51/00141d/moisture', 'unique_id': 'Fineoffset-WH51-00141d-H', 'device': {'identifiers': 'Fineoffset-WH51-00141d', 'name': 'Fineoffset-WH51-00141d', 'model': 'Fineoffset-WH51', 'manufacturer': 'rtl_433'}, 'platform': 'mqtt'},)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 152, in async_discover
    config = schema(discovery_payload)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
    return base_validate(path, iteritems(data), out)
  File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
    raise er.MultipleInvalid(errors)
voluptuous.error.MultipleInvalid: value must be one of ['battery', 'current', 'energy', 'humidity', 'illuminance', 'power', 'power_factor', 'pressure', 'signal_strength', 'temperature', 'timestamp', 'voltage'] for dictionary value @ data['device_class']

If I may, where did you get the ECOWITT WH51 Soil Sensor? I tried one from Amazon that said it was a WH51, and I could not get rtl_433 to see it at all, tried every debug option and it never showed up.

This is what I purchased, it seems to be working well beyond the moisture data type issue.
https://www.amazon.com/gp/product/B07JM621R3/

I’m on it.

Thanks Peter!

Jon, please update the add-on to version 0.1.7 (you should see the addon marked as “update available” after clicking “Supervisor” -> “Add-on store” -> “…” -> “Reload”) and let me know whether it fixes your issue. Thanks!

Confirmed, this has resolved the issue. I appreciate the speedy fix and perfect timing as I have a few more of these on the way, thanks!

1 Like

Did you have to do anything special to get that device to work? I bought 2 of those exact ones and neither would show up in rtl_433

@bs_42 I am using this SDR with a $5 antenna I got off amazon. https://www.amazon.com/gp/product/B01HA642SW/

I have both rtl_433 addons installed in hass.
This is my rtl_433.conf file for the rtl_433 addon

output mqtt://hostname:port,user=homeassistant,pass=password
# output json
# protocol 142
frequency 915M
# frequency 433M
convert si
report_meta newmodel
# gain 0

Pretty much the same basic settings in the rtl_433 MQTT Auto Disovery addon, nothing special.

Hey Brad, would you mind starting another thread on this forum with details of your setup: what sdr dongle you got, how is it hooked up etc? that way we could focus the discussion on trying to help you get your sensor to show up in rtl_433 without other unrelated messages intermixing (hard to keep track of conversations otherwise). Tag me in that thread and I’ll try to help.

You are right, I didn’t intend to hijack this thread. It’s just the first time I’ve see any indication of these sensors working. If I can’t get them working with the above information I will absolutely start a new thread. Thanks!

I tried installing the add-on and get this error message in my log. Do you know what could be wrong?

21-03-20 18:28:33 ERROR (SyncWorker_0) [supervisor.docker.addon] Can't build 9b13b3f4/armv7-addon-rtl433:0.1.2: The command '/bin/ash -o pipefail -c apk add --no-cache --virtual build-deps alpine-sdk cmake git libusb-dev && mkdir /tmp/src && cd /tmp/src && git clone git://git.osmocom.org/rtl-sdr.git && mkdir /tmp/src/rtl-sdr/build && cd /tmp/src/rtl-sdr/build && cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr/local && make && make install && chmod +s /usr/local/bin/rtl_* && cd /tmp/src/ && git clone https://github.com/merbanan/rtl_433 && cd rtl_433/ && mkdir build && cd build && cmake ../ && make && make install && apk del build-deps && rm -r /tmp/src && apk add --no-cache libusb' returned a non-zero code: 5 21-03-20 18:28:33 ERROR (SyncWorker_0) [supervisor.docker.addon] Build log: Step 1/15 : ARG BUILD_FROM Step 2/15 : FROM $BUILD_FROM ---> 21461176cb52 Step 3/15 : ENV LANG C.UTF-8 ---> Using cache ---> 0cf506ade6f8 Step 4/15 : MAINTAINER [email protected] ---> Using cache ---> f1af39ad21d0 Step 5/15 : RUN apk add --no-cache --virtual build-deps alpine-sdk cmake git libusb-dev && mkdir /tmp/src && cd /tmp/src && git clone git://git.osmocom.org/rtl-sdr.git && mkdir /tmp/src/rtl-sdr/build && cd /tmp/src/rtl-sdr/build && cmake ../ -DINSTALL_UDEV_RULES=ON -DDETACH_KERNEL_DRIVER=ON -DCMAKE_INSTALL_PREFIX:PATH=/usr/local && make && make install && chmod +s /usr/local/bin/rtl_* && cd /tmp/src/ && git clone https://github.com/merbanan/rtl_433 && cd rtl_433/ && mkdir build && cd build && cmake ../ && make && make install && apk del build-deps && rm -r /tmp/src && apk add --no-cache libusb ---> Running in da6241a352b3 fetch https://dl-cdn.alpinelinux.org/alpine/v3.13/main/armv7/APKINDEX.tar.gz WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/main: temporary error (try again later)

This part of the error message makes me think it’s a temporary network issue of some kind:
WARNING: Ignoring https://dl-cdn.alpinelinux.org/alpine/v3.13/main: temporary error (try again later)

Have you tried installing it again after you got this error?
What version of HA are you running? What are you running it on?

Hi guys, anyone know if it’s possible to make this work with a 433 receiver connected to an ESP32?

Got a boatload of raw data in the logs but can’t make any sense of it…

I’m getting the same error message as Powskierman. I had the add on working on a previous installation, but I’m in the process of upgrading to running Home Assistant from a Raspberry Pi 4 using an SSD.

I’m running Home Assistant supervisor-2021.03.6 on a Docker version 20.10.5 installation. I just tried again today and I still get the same message about Can’t build 74930c0d/armv7-addon-rtl433:0.1.2:

@allmyhinges Hi again Peter, the fix you made for my WH51 moisture sensors work great, I do have one small issue though.

For some reason the battery level on the sensors are all either 1% or 100% there is never anything in between, is this an issue with the sensor itself or is there something else going on?

Hi Jon, based on a log snippet you included in your initial post, it looks like the template is receiving a battery_ok value from the sensor (which I’m guessing is either set to 0 or 1) and turning it into a percentage using a somewhat silly formula: "value_template": "{{ float(value|int) * 99 + 1 }}" - that’s how you end up with either 0*99+1 = 1% or 1*99+1 = 100%. The sensor itself probably isn’t reporting actual battery charge percentage - I have the same situation with my Acurite temp/humidity sensors, btw.