Maybe someone here has a good idea how to resolve this…
I’m using RTL2MQTT addon to pull in a bunch of Acurite sensors. This works great…but I just got a new weather station for Christmas and it sends the information over 3 messages.
Problem is when I make the MQTT sensors for the payload data, it “blinks” out because apparently unlike basic temp sensors, not all the data is in every message but they are all published to the same station/object ID.
Here’s what it sends:
{
"time" : "2021-01-29 09:26:27",
"model" : "Acurite-Atlas",
"id" : 1234,
"channel" : "C",
"sequence_num" : 0,
"battery_ok" : 1,
"message_type" : 37,
"wind_avg_mi_h" : 3.000,
"temperature_F" : 26.200,
"humidity" : 45,
"strike_count" : 0,
"strike_distance" : 31,
"exception" : 0,
"raw_msg" : "01e76581c5962d009ff5"
}
{
"time" : "2021-01-29 09:40:17",
"model" : "Acurite-Atlas",
"id" : 1234,
"channel" : "C",
"sequence_num" : 0,
"battery_ok" : 1,
"message_type" : 39,
"wind_avg_mi_h" : 5.000,
"uv" : 1,
"lux" : 15810,
"strike_count" : 0,
"strike_distance" : 31,
"exception" : 0,
"raw_msg" : "05e7e782410c2d009f6e"
}
{
"time" : "2021-01-29 09:46:07",
"model" : "Acurite-Atlas",
"id" : 1234,
"channel" : "C",
"sequence_num" : 2,
"battery_ok" : 1,
"message_type" : 38,
"wind_avg_mi_h" : 4.000,
"wind_dir_deg" : 223.000,
"rain_in" : 0.150,
"strike_count" : 0,
"strike_distance" : 31,
"exception" : 0,
"raw_msg" : "09e7668206fc0f009f88"
}
And here’s the YAML I am trying to use:
sensor:
- platform: mqtt
name: "Wx Station Temperature"
unique_id: "wx_station_temperature"
force_update: true
state_topic: "homeassistant/sensor/rtl433/Acurite-Atlas/1234"
# Yes, this really reports in F not C unlike other Acurite sensors
unit_of_measurement: '°F'
value_template: "{{ value_json.temperature_F }}"
I was hoping if it was missing the field in the value_template somehow it would just “skip” that message but apparently it doesn’t work that way. I’m not sure if there is a “neat” way to do this without a horribly convoluted “store the value somewhere else and feed it back into itself if it is missing” process of template nonsense.
EDIT: Oops, also the “sequence number” is not useful…that’s just it resends the same message 3x each to compensate for errors or something.