Rtl_433: temp sensors and error in the HaaS log due to the missing timezone - questions

Hello everyone,

I will put several questions here in this one post. Please bear with me. :slight_smile:

Yesterday I managed to installed rtl_433 and rtl_433 MQTT Auto Discovery and today after hooking up RTL-SDR Blog V3 R820T2 via USB extension cable, I got info from three ThermoPro TX-2. sensors.

Here is the log from rtl_433:

[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 with rtl_433.conf...
[rtl_433] rtl_433 version 21.12-101-g9eec4611 branch  at 202204282249 inputs file rtl_tcp RTL-SDR
[rtl_433] Use -h for usage help and see https://triq.org/ for documentation.
[rtl_433] Publishing MQTT data to core-mosquitto port 1883
[rtl_433] Publishing device info to MQTT topic "rtl_433/9b13b3f4-rtl433/devices[/type][/model][/subtype][/channel][/id]".
[rtl_433] Publishing events info to MQTT topic "rtl_433/9b13b3f4-rtl433/events".
[rtl_433] Publishing states info to MQTT topic "rtl_433/9b13b3f4-rtl433/states".
[rtl_433] Registered 186 out of 218 device decoding protocols [ 1-4 8 11-12 15-17 19-23 25-26 29-36 38-60 63 67-71 73-100 102-105 108-116 119 121 124-128 130-149 151-161 163-168 170-175 177-197 199 201-215 217-218 ]
[rtl_433] Detached kernel driver
[rtl_433] Found Rafael Micro R820T tuner
[rtl_433] Exact sample rate is: 250000.000414 Hz
[rtl_433] [R82XX] PLL not locked!
[rtl_433] Sample rate set to 250000 S/s.
[rtl_433] Tuner gain set to Auto.
[rtl_433] Tuned to 433.920MHz.
[rtl_433] Allocating 15 zero-copy buffers

My first couple of questions:

It seems that some of the channels are skipped, particularly 162 - protocol 162 # ThermoPro-TX2 temperature sensor which is the one I have - see next section - but apparently, it still works. But how do I enable it and even should I?

Secondly, only 433mhz signals are decoded.

Here is the log from rtl_433 MQTT Auto Discovery

[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.
mqtt found in this Home Assistance instance.
Starting rtl_433_mqtt_hass.py...
INFO:root:Discovering all devices
INFO:root:MQTT connected: Connection Accepted.
INFO:root:Subscribing to: rtl_433/+/events
INFO:root:Published Prologue-TH/9/1/102: time, channel, battery_ok, temperature_C, humidity, button
INFO:root:Published Prologue-TH/9/2/150: time, channel, battery_ok, temperature_C, humidity, button
INFO:root:Published Prologue-TH/9/3/105: time, channel, battery_ok, temperature_C, humidity, button

So I understand that Prologue-TH/9 is how devices are named and /1, /2 /3 are the channels they operate, so you know where are they. Good.

A question here - is there a way to rename them so I can have a little bit more human-friendly description in the dashboard?

When I looked at the Lov Viewer, I saw the following entry repeating number of times:
: Invalid datetime: sensor.prologue_th_9_1_102_utc provides state '2022-08-09 13:35:00', which is missing timezone information

I went back to rtl_433 and in the configuration file added "time:utc" in it. After restart, the above logs entry stopped appearing, but now I see output from the sensons logged constantly:

time      : 2022-08-09 14:11:40
model     : Prologue-TH  subtype   : 9             id        : 102
Channel   : 1            Battery   : 1             Temperature: 25.10 C      Humidity  : 41 %          Button    : 0
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

How do I stop logging it?

Also, adding time did not help to fix the ‘unknown’ error in the dashboard

Suggestions are welcome how to address all the above.

OK, update on this matter.

After a whole day of trial and error I figured out that I actually need to edit /config/rtl_433/rtl_433.conf.template file and put there relevant information. Currently, the config looks like the following:

frequency 433.92M 315M 345M 868M 
#report_meta newmodel
#frequency 433.92M
#frequency 345M
#frequency 868M
convert     si

protocol 162 # ThermoPro-TX2 temperature sensor
protocol 53  # Springfield Temperature and Soil Moisture 
protocol 209 # SimpliSafe Gen 3 Home Security System
protocol 102 # SimpliSafe Home Security System (May require disabling automatic gain for KeyPad decodes)

protocol 2   # Rubicson, TFA 30.3197 or InFactory PT-310 Temperature Sensor
protocol ...
protocol ...

rtl_433 log looks like following:

[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.
/tmp/rtl_433_heredoc: line 265: warning: here-document at line 1 delimited by end-of-file (wanted `EOD')
Starting rtl_433 with rtl_433.conf...
[rtl_433] rtl_433 version 21.12-101-g9eec4611 branch  at 202204282249 inputs file rtl_tcp RTL-SDR
[rtl_433] Use -h for usage help and see https://triq.org/ for documentation.
[rtl_433] Publishing MQTT data to core-mosquitto port 1883
[rtl_433] Publishing device info to MQTT topic "rtl_433/9b13b3f4-rtl433/devices[/type][/model][/subtype][/channel][/id]".
[rtl_433] Publishing events info to MQTT topic "rtl_433/9b13b3f4-rtl433/events".
[rtl_433] Publishing states info to MQTT topic "rtl_433/9b13b3f4-rtl433/states".
[rtl_433] Registered 206 out of 218 device decoding protocols [ 162 53 209 102 2 12 32 34 40 45 69 84 88 97 110 117 130 134 136 143 145 155 157-158 166 168 172-173 175 190 193 213 1 4 6-8 10-11 13-17 19-26 29-31 33 35-39 41-44 46-52 54-64 67-68 70-83 85-87 89-96 98-101 103-105 108-109 111-116 119-129 131-133 135 137-142 144 146-154 156 159-161 163-165 167 169-171 174 177-189 191-192 194-197 199-208 210-212 214-215 217-218 ]
[rtl_433] Detached kernel driver
[rtl_433] Found Rafael Micro R820T tuner
[rtl_433] Exact sample rate is: 250000.000414 Hz
[rtl_433] [R82XX] PLL not locked!

I don’t see any errors in the supervisor, however in the core I see the following entry:

logger: homeassistant
Source: components/sensor/__init__.py:398
First occurred: 9:15:56 PM (5 occurrences)
Last logged: 9:21:01 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 892, in _async_registry_updated
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state
    state = self._stringify_state(available)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state
    if (state := self.state) is None:
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 398, in state
    raise ValueError(
ValueError: Invalid datetime: sensor.thermopro_tx2_9_3_105_utc provides state '2022-08-09 21:15:15', which is missing timezone information

Also, the following entry is repeated every minute, it is spamming the log

Exception in message_received when handling msg on 'rtl_433/9b13b3f4-rtl433/devices/Thermopro-TX2/9/3/105/time': '2022-08-09 21:58:11' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 47, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/sensor.py", line 306, in message_received self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state state = self._stringify_state(available) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 398, in state raise ValueError( ValueError: Invalid datetime: sensor.thermopro_tx2_9_3_105_utc provides state '2022-08-09 21:58:11', which is missing timezone information

I would appreciate if someone can point me how to fix the above error.

P.S. I’ve added report_meta time:iso:tz:local to the config, but it does not help. Still getting this every 10 seconds:

Exception in message_received when handling msg on 'rtl_433/9b13b3f4-rtl433/devices/Thermopro-TX2/9/2/150/time': '2022-08-09 22:23:45' Traceback (most recent call last): File 
"/usr/src/homeassistant/homeassistant/components/mqtt/debug_info.py", line 47, in wrapper msg_callback(msg) File "/usr/src/homeassistant/homeassistant/components/mqtt/sensor.py", line 306, in message_received self.async_write_ha_state() File 
"/usr/src/homeassistant/homeassistant/helpers/entity.py", line 532, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 570, in _async_write_ha_state state = self._stringify_state(available) File 
"/usr/src/homeassistant/homeassistant/helpers/entity.py", line 538, in _stringify_state if (state := self.state) is None: File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 398, in state raise ValueError( ValueError: Invalid datetime: sensor.thermopro_tx2_9_2_150_utc provides state '2022-08-09 22:23:45', which is missing timezone information

Where did you find this rtl_433 integration? I cannot find it here Integrations - Home Assistant. Nor can I find the addon you are apparently using.

You need to add repo:

https://github.com/pbkhrv/rtl_433-hass-addons

Add both rtl_433 and rtl_433 MQTT Auto Discovery. Then you need to make sure to edit config at /config/rtl_433/rtl_433.conf.template via file editor or some other means.

This is what my config looks like but I am still getting spammed by timezone log entires…

output mqtt://${host}:${port},user=${username},pass=${password},retain=${retain}

# Uncomment the following line to also enable the default "table" output to the
# addon logs.
# output kv

frequency 433.92M 315M 345M 868M 
#report_meta newmodel
#frequency 433.92M
#frequency 345M
#frequency 868M
convert     si

#report_meta time:iso:tz:local
report_meta time:utc

report_meta level
report_meta stats
report_meta protocol
report_meta noise

protocol 162 # ThermoPro-TX2 temperature sensor
protocol 53  # Springfield Temperature and Soil Moisture 
protocol 209 # SimpliSafe Gen 3 Home Security System
protocol 102 # SimpliSafe Home Security System (May require disabling automatic gain for KeyPad decodes)

Thanks. Do you think you should post an issue there?

If you are talking about timezone logging issue, apparently it is core HA bug…

Try to install it both and see if timezeone issue is gone for you. I am running older version of HA - 7.6 and it might be fixed in the newer versions.

So rtl_433 is sending a datetime without a timezone and it is HA’s fault? I don’t think so.

As I said, hit up the author of the addon on a github issue.

I am running the latest HA and just installed the add-on and encountered the timezone error.

Adding this the config file, and restarting the add-on resolved the issue.

report_meta time:iso:tz:local
1 Like