Home Assistant Add-on: rtl_433 with MQTT auto discovery

THANK YOU, this fixed my issue

Thank you for answer. Unfortunately, if I add to the configuration file register_all true, then the addon does not work.
If I delete this line, it will start correctly right away.
Can you please see where the error is?

Log:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Starting rtl_433 -c /config/rtl_433/rtl_433.conf
rtl_433 version 20.11-66-gc2124fa6 branch master at 202102071317 inputs file rtl_tcp RTL-SDR
Use -h for usage help and see https://triq.org/ for documentation.
Publishing MQTT data to core-mosquitto port 1883
Publishing device info to MQTT topic "rtl_433/9b13b3f4-rtl433/devices[/type][/model][/subtype][/channel][/id]".
Publishing events info to MQTT topic "rtl_433/9b13b3f4-rtl433/events".
Publishing states info to MQTT topic "rtl_433/9b13b3f4-rtl433/states".
	Use -G for testing only. Enable with -G 4 if you really mean it.
[cmd] /run.sh exited 1
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.


Configuration file :

output      mqtt://core-mosquitto:1883,user=homeassistant,pass=XXX
frequency   433.92M
register_all true

1 Like

Looking at rtl_433’s source code, I’m not seeing a way to specify “-G 4” via a config file. You have a couple of options:

  1. Explicitly specify all protocols that you need, one per line in the config file, something like this:
protocol 1
protocol 2
protocol ...
...

This is tedious, but do you really need all 100+ protocols enabled? Full list can be found here.
2. Fork my addons repository on GitHub, pass “-G 4” on the command line to rtl_433 in run.sh, and install the add-on from your GitHub fork instead of mine.
3. Copy the add-on to your Home Assistant server’s addons file share (as described in the dev documentation), and change run.sh to pass “-G 4” to rtl_433.

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…