Then next Nexus-TH message comes along again and temp and humidity come back.
How do I retain the temp and humidity readings on HA until the next message sent with new readings?
I have replaced the CC1101 small antenna with a ground plane antenna I’ve built and the readings have improved. I’m getting the signal through 2 concrete floors. Just before each drop out of readings the last reading have 14 decimal places.
While I don’t know much about the HomeAssistant .yaml definitions, isn’t it possible to define that only the messages from the model= “Nexus-TH” are registered for what you require? A further restriction could also be done by using the id as well, for example when having several sensors of the same model, but this will usually change whenever the sensors is being reset, like when changing the batteries.
I have a similar issue with temperature and humidity sensors here and use the model restrictions in openHAB to only get the messages from my temperature sensors and not the ones from my neighbours, which use different sensor models.
In your case it seems to be an unrecognised model though, with “signal parsing failed”. In that case you could try to set the build flag
'-DSUPPRESS_UNPARSED=true'
to completely suppress such unrecognised signals from even sending MQTT messages.
Hope this helps.
P.S.: In your case a further definition restriction of your “Nexus-TH” sensor would be the “channel”:1, which will always stay the same, instead of the id didn’t see that initially.
I was able to adjust the value template to restrict the data sent to the sensor to a specific ID. The readings are showing on Home Assistant. Real test will be when I get another sensor with a different ID.
value_template: >
{% if value_json is defined and value_json.id == 195 %}
{{ value_json.temperature_C }}
{% else %}
{{ states('sensor.digoo_weatherstation_temp') }}
{% endif %}
If your doing a custom build, their is an option available in the current development build which changes the MQTT message topic to make it easier to extract when you have multiple devices.
valueAsASubject
This will change the MQTT Topic to contain the model and ID values