Do the Acurite sensors like the one shown below only broadcast if the battery is ok (1) or bad (0).
If so, what is the approximate %value of the battery when it flags as bad?
When I tried to add the message_type sensors for my Acurite-5n1 in the “- platform: mqtt” format, Home Assistant said:
“It’s not possible to configure mqtt sensor by adding platform: mqtt to the sensor configuration. Please check the documentation for more information on how to set up this integration.”
Here is what my working configuration.yaml looks like:
mqtt:
sensor:
- name: Local Temperature
device_class: temperature
unit_of_measurement: "°F"
value_template: "{{ value_json.temperature_F | round(1) }}"
state_topic: rtl_433/Acurite-5n1/1245/msg56
json_attributes_topic: rtl_433/Acurite-5n1/1245/msg56
- name: Local Humidity
device_class: humidity
value_template: "{{ value_json.humidity }}"
state_topic: rtl_433/Acurite-5n1/1245/msg56
- name: Local Wind
unit_of_measurement: "mph"
value_template: "{{ (value_json.wind_avg_km_h | float / 1.609) | round(0) }}"
state_topic: rtl_433/Acurite-5n1/1245/msg49
json_attributes_topic: rtl_433/Acurite-5n1/1245/msg49
My Version info:
Core 2023.11.3
Supervisor 2023.11.6
Operating System 11.1
Frontend 20231030.2
You can include your code starting with the sensor:
line and everything below into a file called mqtt.yaml
that is saved in the same location as your configuration.yaml
file. (remember to remove the first indent from all lines.)
Then in your configuration.yaml
file, simply include this line:
mqtt: !include mqtt.yaml
Is anyone here hitting a wall when it comes to the number of sensors? I have a mix of AcuRite 06044M and 06002M devices and when I recently added about 4-5 more I noticed some were not updating and needed to restart RTL to get them to read again.
Right now I have 15 devices and my thought was to switch the devices on each floor, two levels with a basement, to the same ID to see if that resolves the issues.
That sounds very strange. I only have maybe 7 or 8 devices active, but my two rtl433 instances have seen 693 devices between them. (I have one inside the house, and one outside near my pool on a Pi zero). I’ve never noticed any of my own gear not updating, and it’s been reliable for well over a year.
I’ve really only had three issues in the time I’ve been using this: One was reliably reading a temperature sensor in my pool due to a weak signal – hence the second rtl433 instance outside. The others are both with some very cheap door contacts from aliexpress: two had the same ID, making one worthless, and another (unfortunately not one of the duplicate id ones) randomly stopped working with no obvious cause.
I’d look at a couple things:
- Do any of your sensors have the same ID? Perhaps one is just being immediately overwritten with updates from the other
- Watch the raw rtl433 output or log – it shows the raw messages being read.
- Depending on the result, you can subscribe to mqtt with eg
mosquitto_sub -h your_mqtt_host -t rtl_433/#
and this will help isolate if there’s a problem on mqtt vs homeassistant side
- Depending on the result, you can subscribe to mqtt with eg
So on the dual ID issue no… I keep records of each device as I on-board them and record the ID and the location it housed.
I do log my rtl_433 processes to their own log files by frequencies and I checked the IDs of the one having issues at the time and don’t see them showing up in the broadcasts which means of course they aren’t going to MQTT.
The only way I can “kick” it alive in some cases is restarting the process but I had this configuration for 6 months before I added the new ones so the only thing I can think about is capacity issues. The node running my rtl_433 process is a mini PC with like an N100 processor and plenty of ram, it was my old HA node to be honest, so I know resources aren’t an issue.
I did make a minor tweak this morning with the following changes:
#pulse_detect autolevel
pulse_detect classic
And the other day turned off any unused protocols.
I’ve also setup a cron to run every 2 hours to bounce the rtl_433 process to just to see if that helps.
Sharing here for all the other Home Assistant newbies or anyone else who gets stuck in a similar scenario:
Rather than having my SDR switching between 915 MHz for my utility meters, and 433 MHz for my Acurite sensors, I decided to just have two separate SDRs with two separate instances of rtl_433 running, with one publishing to rtl_433/433[/model][/id]
and the other to rtl_433/915[/model][/id]
. Even without this though, setting up the automation to demux the Acurite sensor messages wasn’t working for me; I have an Acurite Atlas setup, and it publishes message_type
37, 38, and 39, but the automation in the instructions wasn’t ever triggering. After going through the MQTT Trigger documentation, I wound up with this automation instead which is working (copied from the web UI under Settings > Automations & scenes > Automations > (Automation) > (Three-dot menu in top-right) > Edit in YAML):
alias: RTL_433 MQTT message_type Demuxer
description: Split rtl_433/433/# signals into msg topics, if message_type exists
trigger:
- platform: mqtt
topic: rtl_433/433/+/+
value_template: "{{ trigger.payload_json.message_type != null }}"
action:
- service: mqtt.publish
data:
payload: "{{trigger.payload}}"
topic: >-
rtl_433/433/{{trigger.payload_json.model or
"UnknownModel"}}/{{trigger.payload_json.id or
"UnknownId"}}/msg{{trigger.payload_json.message_type}}
mode: single
For anyone not running dual SDRs publishing to separate topics, you’d want to change the three instances of rtl_433/433
above to rtl_433
. But, I can confirm it works via MQTT Explorer:
As for the rtl_433 configuration, if anyone wants to do something similar, all you have to do is add a line to the configuration file which specifies the device (I specify mine via serial number, which you can grab via rtl_eeprom; unlike the device ID it won’t change on its own, just prefix it with a colon) and frequency (technically optional for 433 MHz). I also cranked up the logging a bit since I was having trouble at one point getting the service to start (the SDR wasn’t being released despite the rtl_433 process being killed). So my configuration file at /etc/rtl_433/rtl_433-433.conf
looks like:
verbose 5
device :00000203
frequency 433.92M
sample_rate 1500k
report_meta level
report_meta time:utc
output json
output mqtt://<MQTT Broker IP address>:1883,retain=0,user=<user>,pass=<pass>,events=rtl_433/433[/model][/id]
The service configuration files are the same as the examples in the first post, they’re just named differently (rtl_433-433.service
and rtl_433-915.service
) with the ExecStart command changed to point to the appropriate config file.