mmiller7
(Matt Miller)
March 28, 2021, 11:05pm
1
I notice when I restart HomeAssistant the Utility Meters seem to jump, presumably because initially the sensors from MQTT are “unknown” which I guess is zero; then populate their values.
This means if (for example) I have a daily rain gauge sensor if we got 0.25 inch and I restart HomeAssistant it suddenly reads 0.5 inches for the day…not good.
Is there any way too fix this?
tom_l
March 28, 2021, 11:41pm
2
Retain your mqtt sensor states in the broker.
mmiller7
(Matt Miller)
March 28, 2021, 11:44pm
3
Is that something I can set up with the YAML of my sensors, or is that something that someone has to change in the RTL433 addon?
tom_l
March 28, 2021, 11:45pm
4
You have to get whatever is sending the mqtt messages to send them with the retained flag set.
mmiller7
(Matt Miller)
March 28, 2021, 11:49pm
5
ugh, I guess I would have to submit a feature request then.
Is there some other kind of sensor that would correctly handle the differences, or ignore when it is zero?
mmiller7
(Matt Miller)
March 29, 2021, 12:14am
6
I think I may have found where it is sent, and if I understand the -r means it already has retain set.
echo $line | /usr/bin/mosquitto_pub -h $MQTT_HOST -u $MQTT_USER -P $MQTT_PASS -i RTL_433 -r -l -t $MQTT_PATH
Is there a possibility the “unknown” value is happening if HomeAssistant loads faster than the addons initialize or something?
tom_l
March 29, 2021, 12:20am
7
I suppose it is possible that the utility meter platform could be loaded before the mqtt platform.
mmiller7
(Matt Miller)
March 29, 2021, 12:23am
8
is there a way to delay it loading for a bit (say 90 seconds) to give everything else a better chance at initializing properly first?