Home Assistant Add-on: rtl_433 with MQTT auto discovery

Hi there.

How can I point this to install a newer version of the rtl_433? the Govee leak sensors are all now shipping with a new protocol, so they won’t work with this version and we need to apply the changes in a branch or wait for the master to pull.

Any chance you quickly update this when rtl_433 has a new pull? I know a lot of people use this for the govee detectors and the change is going to make it very difficult for new devices/users until we have that branch wrapped into this add-on.

Thanks for the work!

I’m working on a PR to do this at Build both a specific commit and master of rtl_433 by deviantintegral · Pull Request #129 · pbkhrv/rtl_433-hass-addons · GitHub. I actually fell down a rabbit hole where for some reason the docker image cache isn’t working on builds, which really speeds up the arm builds. I think I’ll probably postpone getting that working since it works, but is just slow.

That’s awesome! You’ll have to excuse me since I’m a real newbie at this. What does your reply actually mean? I should update this add-on and it’ll work? or do I need to point at a different repository?

Thanks! Sorry to have NO clue how to work on this…really dove into the deep end on this one.

In summary: I’m working on making it easier and automatic for new releases of rtl_433 to be included in the addon. But, it’s not done yet.

1 Like

Amazing. Thank you!

Hi Guys,

I’m really keen to get my electricity data in to HA, I have a clamp style meter and am in the UK.

I see the readings and a current value in the data but it’s not automagically working - can anyone help me get this working please?

Debug mode shows the value within the data. e.g. 2.9 or 2.7 but the message says skipped!?

Any tips please?

INFO:root:Enabling debug logging
INFO:root:Discovering all devices
DEBUG:root:MQTT Client: Starting Loop
DEBUG:paho.mqtt.client:Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b''
DEBUG:paho.mqtt.client:Received CONNACK (0, 0)
INFO:root:MQTT connected: Connection Accepted.
INFO:root:Subscribing to: rtl_433/+/events
DEBUG:paho.mqtt.client:Sending SUBSCRIBE (d0, m1) [(b'rtl_433/+/events', 0)]
DEBUG:paho.mqtt.client:Received SUBACK
DEBUG:paho.mqtt.client:Received PUBLISH (d0, q0, r1, m0), 'rtl_433/9b13b3f4-rtl433/events', ...  (105 bytes)
DEBUG:root:MQTT message: "{\"time\":\"2023-01-25 08:59:03\",\"model\":\"Clipsal-CMR113\",\"current_1_A\":2.7,\"current_2_A\":0,\"current_3_A\":0}"
DEBUG:root:homeassistant/sensor/Clipsal-CMR113/Clipsal-CMR113-UTC/config:{"device_class": "timestamp", "name": "Clipsal-CMR113-UTC", "entity_category": "diagnostic", "enabled_by_default": false, "icon": "mdi:clock-in", "state_topic": "rtl_433/9b13b3f4-rtl433/devices/Clipsal-CMR113/time", "unique_id": "Clipsal-CMR113-UTC", "device": {"identifiers": ["Clipsal-CMR113"], "name": "Clipsal-CMR113", "model": "Clipsal-CMR113", "manufacturer": "rtl_433"}}
DEBUG:paho.mqtt.client:Sending PUBLISH (d0, q0, r0, m2), 'b'homeassistant/sensor/Clipsal-CMR113/Clipsal-CMR113-UTC/config'', ... (377 bytes)
INFO:root:Published Clipsal-CMR113: time
INFO:root:Skipped Clipsal-CMR113: current_1_A, current_2_A, current_3_A
DEBUG:paho.mqtt.client:Received PUBLISH (d0, q0, r0, m0), 'rtl_433/9b13b3f4-rtl433/events', ...  (105 bytes)
DEBUG:root:MQTT message: "{\"time\":\"2023-01-25 08:59:15\",\"model\":\"Clipsal-CMR113\",\"current_1_A\":2.9,\"current_2_A\":0,\"current_3_A\":0}"
DEBUG:root:Discovery timeout in the future for: homeassistant/sensor/Clipsal-CMR113/Clipsal-CMR113-UTC/config



That means that the script doesn’t understand how to map current_1_A and so on to Home Assistant entities. You would have to configure them manually.

Do you know what’s meant by 1 / 2 / 3? The autodiscovery script looks like it expects only a current_A output: rtl_433/rtl_433_mqtt_hass.py at 4968419bf748ac9b5fca5ebfc267b7cd9f31c0e6 · merbanan/rtl_433 · GitHub

oh yes - not sure if it helps but the devices has three outputs that you can connect the clamp to. I’m currently in number 1.

I see the last commit on the git was a few months ago. Do we have an ETA on implementing new features from the RTL_433 git? The govee sensors will no longer work with this add-on, but have been fixed in the RTL_433 main branch.

I having problem with auto discovery:
here my details:

  • rtl 433 config:
frequency 868300000
frequency 433920000
hop_interval 60
protocol 172
protocol 12
output mqtt=http://core-mosquitto:1883,user=***,pass=***,retain=1
convert si
report_meta time:iso:tz:local
output json
  • auto discovery config:
mqtt_host: core-mosquitto
mqtt_port: 1883
mqtt_user: ***
mqtt_password: ***
mqtt_retain: true
rtl_topic: /rtl_433/+/events
discovery_prefix: homeassistant
discovery_interval: 6
force_update: false
log_level: debug
  • auto discovery logs:
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
mqtt found in this Home Assistance instance.
Starting rtl_433_mqtt_hass.py...
INFO:root:Enabling debug logging
INFO:root:Discovering all devices
DEBUG:root:MQTT Client: Starting Loop
DEBUG:paho.mqtt.client:Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b''
DEBUG:paho.mqtt.client:Received CONNACK (0, 0)
INFO:root:MQTT connected: Connection Accepted.
INFO:root:Subscribing to: /rtl_433/+/events
DEBUG:paho.mqtt.client:Sending SUBSCRIBE (d0, m1) [(b'/rtl_433/+/events', 0)]
DEBUG:paho.mqtt.client:Received SUBACK
DEBUG:paho.mqtt.client:Sending PINGREQ
DEBUG:paho.mqtt.client:Received PINGRESP
DEBUG:paho.mqtt.client:Sending PINGREQ
DEBUG:paho.mqtt.client:Received PINGRESP
DEBUG:paho.mqtt.client:Sending PINGREQ
DEBUG:paho.mqtt.client:Received PINGRESP
  • rtl_433 logs:
[devices] Tuned to 433.920MHz.
[devices] {"center_frequency" : 433920000, "frequencies" : [868300000, 433920000], "hop_times" : [60]}
[devices] Allocating 15 zero-copy buffers
[devices] {"time" : "2023-02-06T14:50:53+0100", "model" : "Bresser-6in1", "id" : 338715378, "channel" : 0, "sensor_type" : 1, "wind_max_m_s" : 2.900, "wind_avg_m_s" : 2.800, "wind_dir_deg" : 338, "rain_mm" : 360.400, "startup" : 1, "flags" : 1, "mic" : "CRC"}
[devices] {"time" : "2023-02-06T14:51:13+0100", "model" : "Oregon-THGR810", "id" : 139, "channel" : 1, "battery_ok" : 1, "temperature_C" : 18.900, "humidity" : 74}
[devices] Tuned to 868.300MHz.
[devices] {"center_frequency" : 868300000, "frequencies" : [868300000, 433920000], "hop_times" : [60]}
[devices] Allocating 15 zero-copy buffers
[devices] {"time" : "2023-02-06T14:52:04+0100", "model" : "Bresser-6in1", "id" : 338715378, "channel" : 0, "sensor_type" : 1, "wind_max_m_s" : 2.700, "wind_avg_m_s" : 2.700, "wind_dir_deg" : 338, "rain_mm" : 360.400, "startup" : 1, "flags" : 1, "mic" : "CRC"}
[devices] {"time" : "2023-02-06T14:52:16+0100", "model" : "Bresser-6in1", "id" : 338715378, "channel" : 0, "battery_ok" : 1, "temperature_C" : 10.800, "humidity" : 72, "sensor_type" : 1, "wind_max_m_s" : 3.200, "wind_avg_m_s" : 3.100, "wind_dir_deg" : 112, "uv" : 0.000, "startup" : 1, "flags" : 0, "mic" : "CRC"}
[devices] {"time" : "2023-02-06T14:52:28+0100", "model" : "Bresser-6in1", "id" : 338715378, "channel" : 0, "sensor_type" : 1, "wind_max_m_s" : 3.200, "wind_avg_m_s" : 3.100, "wind_dir_deg" : 112, "rain_mm" : 360.400, "startup" : 1, "flags" : 1, "mic" : "CRC"}
[devices] {"time" : "2023-02-06T14:52:40+0100", "model" : "Bresser-6in1", "id" : 338715378, "channel" : 0, "battery_ok" : 1, "temperature_C" : 10.800, "humidity" : 72, "sensor_type" : 1, "wind_max_m_s" : 2.000, "wind_avg_m_s" : 1.800, "wind_dir_deg" : 315, "uv" : 0.000, "startup" : 1, "flags" : 0, "mic" : "CRC"}
[devices] {"time" : "2023-02-06T14:52:52+0100", "model" : "Bresser-6in1", "id" : 338715378, "channel" : 0, "sensor_type" : 1, "wind_max_m_s" : 0.800, "wind_avg_m_s" : 0.800, "wind_dir_deg" : 45, "rain_mm" : 360.400, "startup" : 1, "flags" : 1, "mic" : "CRC"}
  • mqtt explorer screenshot:

I cannot see no entities or devices in home assistant,
can someone help me?

found the issue:

/rtl_topic: /rtl_433/+/events -> rtl_topic: /rtl_433/+/events

Hey folks, I just released new versions of the addons. The biggest new feature is not in the addons themselves, but in new parallel addons that automatically rebuild and track rtl_433’s master branch. You do have to uninstall and reinstall the addon in HA for it to get a new version, but that matches how zigbee2mqtt works and is really a HA limitation. Hope this helps for the folks waiting for Govee sensor fixes and other updates. As always, PRs are welcome in the repo with fixes and improvements.

4 Likes

So, you’ll need to manually configure that clamp meter for now. If you write a patch for this upstream to the autodiscovery script, feel free to file a PR to pull it in to the addon.

SOLVED: Make sure you restart the VM (from proxmox) and add the usb-device to the VM in the proxmox options (hardware). Started up after I did that and rebooted the VM!

Original Post Below -----

I just moved over to a proxmox install. I’m on the latest (next) install and it just starts then immediately stops. No errors thrown in the add-on logs:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting rtl_433 with rtl_433.conf...
[rtl_433] rtl_433 version nightly-2-g371ccfd5 branch master at 202302201511 inputs file rtl_tcp RTL-SDR
[rtl_433] Use -h for usage help and see https://triq.org/ for documentation.
[rtl_433] MQTT: Publishing MQTT data to 192.168.0.190 port 1883
[rtl_433] MQTT: Publishing device info to MQTT topic "rtl_433/9b13b3f4-rtl433/devices[/type][/model][/subtype][/channel][/id]".
[rtl_433] MQTT: Publishing events info to MQTT topic "rtl_433/9b13b3f4-rtl433/events".
[rtl_433] MQTT: Publishing states info to MQTT topic "rtl_433/9b13b3f4-rtl433/states".
[rtl_433] Use "-F log" if you want any messages, warnings, and errors in the console.
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Errors are thrown in the HA logs:

Failed to to call /addons/9b13b3f4_rtl433-next/stats - Can't read stats from addon_9b13b3f4_rtl433-next: Expecting value: line 1 column 1 (char 0)
12:29:48 PM – (ERROR) Home Assistant Supervisor - message first occurred at 12:27:38 PM and shows up 3 times
Error adding entities for domain sensor with platform mqtt
12:24:51 PM – (ERROR) Sensor
Error doing job: Exception in callback MQTT._mqtt_handle_message(<paho.mqtt.cl...x7f121cebb370>)
12:24:51 PM – (ERROR) components/sensor/__init__.py
JSON result was not a dictionary
12:24:51 PM – (WARNING) MQTT - message first occurred at 12:24:50 PM and shows up 26 times
Error parsing value: 'value_json' is undefined (value: 965c92off, template: {{ value_json.code }})
12:24:51 PM – (ERROR) helpers/template.py
Template variable error: 'value_json' is undefined when rendering '{{ value_json.code }}'
12:24:51 PM – (ERROR) helpers/template.py

New and unexpected behavior here. If I shut down the “autodiscovery” add-on all my acurite sensors update just fine until I reset the box. Then they go “undiscovered” until I boot the autodiscovery add-on back up.

Ideas?

Is mqtt_retain set in the autodiscovery config? If not, then the discovery configuration will be reset when home assistant restarts.

Hm, unknown. I think my HA got a little confused. I rebooted after configuring some other devices and the things populated after about 5 minutes. So all good! thank you for troubleshooting though!

I just want to thank you for your effort. I am using your addon over a year without a problem. And I have just found new usage for it. t There are actually arduino libraries out on the internet which enable one to send sensor data as a weather station, I have just modified my Vindriktning to send PM2.5 data as a Hideki weather station over 433MHz to HA. So instead of banging your head over distance issues with zigbee, zwave or WIFI sensors you just put together ESP/arduino+sensor configuration with powerfull enough 433MHz transmitter to cover desired distance.

2 Likes

How do I change temperature_C to temperature_F in my mqtt rtl_433 transactions?

This is what my rtl_433 conf looks like.

output mqtt://${host}:${port},user=${username},pass=${password},retain=${retain},events=rtl_433[/model][/id]
report_meta time:iso:usec:tz
convert si
protocol 30
protocol 40
protocol 86
protocol 192

thanks

The easiest thing to do is to convert units in Home Assistant:

It may also work if you remove convert si: rtl_433/rtl_433.example.conf at d3fb71696f1a52e8f68a67690371f5beee4f6d4d · merbanan/rtl_433 · GitHub