Hi folks, thanks in advance for your help.
I’m trying to make my HA instance a little more robust, and reduce errors in my logs on startup.
I have a bunch of Z-Wave devices using zwave-js-ui. They talk to HA via MQTT. From there, I take some of those entities (for example electric consumption in kWh) and then run it through a Max/Min filter to remove any outliers. This filtered entity then goes into a utility_meter that resets daily.
I have alot of Z-Wave devices, so on startup I get a lot of errors looking like this.
Logger: homeassistant.components.utility_meter.sensor
Source: components/utility_meter/sensor.py:447
Integration: Utility Meter (documentation, issues)
First occurred: 11 April 2023 at 2:34:28 pm (28 occurrences)
Last logged: 11 April 2023 at 2:34:29 pm
Daily - Bathroom Towel Rail received an invalid state change coming from sensor.bathroom_towel_rail_filtered_electric_consumption (unknown > 2.1)
Daily Loft Hot Water Return received an invalid state change coming from sensor.loft_hot_water_return_filtered_electric_consumption (unknown > 33.8)
Daily - Bedroom 4 Desk received an invalid state change coming from sensor.bedroom_4_desk_filtered_electric_consumption (unknown > 11.48)
Kitchen Island 4 received an invalid state change coming from sensor.kitchen_island_4_filtered_electric_consumption (unknown > 0.04)
Kitchen Island 3 received an invalid state change coming from sensor.kitchen_island_3_filtered_electric_consumption (unknown > 0.0)
I believe this is because as HA is starting up the MQTT entity is “unknown” which then hits the filter, and eventually gets to the utility_meter which can’t cope.
Normally, I would look to try and use an availability template, but when I look at the filters documentation, it doesn’t seem like thats an option I can use.
Do I need to create a sensor using an availability template that sits in between the MQTT entity and the filter? That seems like I’m generating a bunch of extra sensors just for this - is there a better way?