I had to restart my system and when it came back up everything seemed to be working with the exception of all the temperature sensors which get their data from Rtl-433 via MQTT. If I run MQTTtool and look at the MQTT broker on HA, I can see the updates coming in but my all of these sensor devices show as unavailable on the dashboard. Can anyone please help me figure out how to get this working again?
I tried starting the RTL-433 MQTT Auto Discovery addon and that seems to have fixed the problem. I admit that I donāt understand this since all of the sensors were already discovered and after starting it and stopping it, the sensors continue to be updated by MQTT messages.
I just had this happen, except that when running auto-discovery again, the IDs of some of the devices changed and now donāt match existing dashboards and such. Iām struggling to find clear info on how to make this work consistentlyā¦
Itās a common problem with these sensors. Usually when battery reconnected they give a new ID from the sensor. Itās part of their progamming. As the battery tends to last > 1 year you donāt have to do it too often.
I saw some reference to that issue among my searches. The real problem here is that I imagined at each HA update Iād restart and have to reset all my weather sensors. After the first time, all the IDs stayed the same, but MQTT integration still lost track of them. After running autodiscovery for 30 seconds, blam, everything worked again.
- name: " Digoo Temperature"
device_class: "temperature"
state_topic: "home/OpenMQTTGateway_heltec_rtl_433_ESP/RTL_433toMQTT/Nexus-TH/1/114"
value_template: "{{ (value_json.temperature_C +0.5)|round(1) }}"
unit_of_measurement: "Ā°C"
unique_id: digoo_temp_heltec
I set up weather sensors in YAML rather than use discovery. So if the cell in the device runs out I check MQTTexplorer and see the new device number and change it in the YAML and reload manual mqtt entities.
I guess there are other advantages, like unique id that is āhumanā and rounding, scaling. Do you keep the MQTT integration installed ?
I dont have a device in settings/integrations/mqtt. I turn off discovery or Iām left with dozens of 433 devices. Temp,pressure, humidity all just show as entities.
Last time I restarted, I only ran discovery for 5 min, just long enough to pick up my stuff again. I found the same, leave it running and you get tons of TPMS entries.
Trying to work out the value template so I can convert wind speed kph to mph.
I would bet that āhome/OpenMQTTGateway_heltec_rtl_433_ESP/RTL_433toMQTT/Nexus-TH/1/114/temperature_Cā is the temp. hence, you use value_j son.temperature_C in your value template.
Hereās the full topic Iām trying to convert:
rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/wind_avg_km_h
and the corresponding yaml
- name: "Weather Station Avg Wind Speed"
device_class: "wind_speed"
state_topic: "rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211"
value_template: "{{ (value_json.wind_avg_km_h)| float * 2.23694 |round(1) }}"
unit_of_measurement: "mph"
unique_id: 5in1_windspeed
what am I missing?
value_template: "{{ (value_json.wind_avg_km_h * 2.23694)| float(0)|round(1) }}"
Try this
Thanks, much appreciated. That works if I try it on the developer tools > template tool. I still get unknown value in states. Iāve still got some other issue going onā¦
Hereās the whole mqtt section from configuration.yaml
mqtt:
sensor:
- name: "Weather Station Temperature"
device_class: "temperature"
state_topic: "rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/temperature_F"
# value_template: "{{ (value_json.temperature_C +0.5)|round(1) }}"
unit_of_measurement: "Ā°F"
unique_id: 5in1_temp
- name: "Weather Station Avg Wind Speed"
device_class: wind_speed
state_topic: "rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/wind_avg_km_h"
value_template: "{{ (value_json.wind_avg_km_h * 2.23694)| float(0)|round(1) }}"
# value_template: {{ value_json.wind_avg_km_h }}
# value_template: "{{ value_json.wind_avg_km_h | float * 2.23694 |round(1) }}"
# value_template: "{{ (states('sensor.openweathermap_wind_speed')| float * 2.23694) | round(1) }}"
# unit_of_measurement: "mph"
unique_id: 5in1_windspeed
value_template: "{{ (value * 2.23694)|round(1) }}"
unit_of_measurement: "mph"
You are using wind_avg_km_h in both state topic and value template. If above dosenāt work show the json output of the state topic.
still unknown. I just donāt get it. could I be missing some configuration in the yaml that āenablesā the jinja template stuff?
pasted rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/wind_avg_km_h
into the āListen to a topicā box in the MQTT integration, and got the following:
Message 3 received on rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/wind_avg_km_h at 10:40 AM:
6.7946
QoS: 0 - Retain: false
Message 2 received on rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/wind_avg_km_h at 10:40 AM:
6.7946
QoS: 0 - Retain: false
Message 1 received on rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/wind_avg_km_h at 10:40 AM:
6.7946
QoS: 0 - Retain: false
Message 0 received on rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/wind_avg_km_h at 10:40 AM:
11.7614
QoS: 0 - Retain: true
Using mqttexplorer show what the topic
rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211/wind_avg_km_h shows as a payload.
2.6556 when looking directly at that topic
Hereās a capture of the whole message from the RTL_433 radio events topic for the 5-in-1 device:
{"time":"1720573645.761205","protocol":40,"model":"Acurite-5n1","message_type":56,"id":1211,"channel":"C","sequence_num":2,"battery_ok":1,"wind_avg_km_h":2.6556,"temperature_F":68.9,"humidity":93,"mic":"CHECKSUM","mod":"ASK","freq":433.93882,"rssi":-0.0764809,"snr":7.40349,"noise":-7.47997}
mqtt:
sensor:
- name: "Weather Station Avg Wind Speed"
device_class: "wind_speed"
state_topic: "rtl_433/3a727f7fda47/devices/Acurite-5n1/C/1211"
value_template: "{{ (value_json.wind_avg_km_h)| float |round(1) }}"
unit_of_measurement: "Kph"
unique_id: 5in1_windspeed
First I would say is delete the device/entity from settings/integrations/mqtt if you have already setup the device by discovery then add the above yaml ( try simple version in kph first)and in developertools/yaml and press on the manually added mqtt entities .