Skip to content

How to prevent sensor to drop to unknown state? #93

Open

Description

@4ybaka

Hi, thank you for this great component! In my usecase I sync Smart Battery Sense data and go to deep sleep mode. The problem is that after node woke up it first connects to Home Assistant and sensor changed its state to Unknown. Later it is set to proper value but on graphs I see a lot of gaps without data. How can I prevent sensor to drop to Unknown and leverage last value? Or do not send data until it gets it from VE device?

Activity

  1. sooty66 commented on Feb 14, 2025

    @sooty66

    Hi, I have a similar question.

    I have several Victron devices with instant readout installed in my camper van along with an esp32 which is pushing sensor values into Home Assistant.

    These Victron devices produce a lot of data particularly when voltage is fluctuating by 1/100th of a volt which is no problem when used on a display but not ideal when data is being pushed into Home Assistant and stored.

    I have solved the excessive data issue on problem sensors by applying filters.

    I have an AC charger which is not always on so I have used both a smoothing and timeout filter on the voltage, current & power sensors. Basically the timeout filter will send a NAN if nothing has been received which is the behaviour I want as it sets the sensor in Home Assistant to unknown state.

    There is no timeout filter for text sensors so that sensor will stay on whatever status it was when the AC charger last sent a message.
    I notice on first boot of the esp32 the device_state text sensor on the AC charger does go to unknown so I'm guessing it is sending a NAN.

    Is there a way to get a text sensor to send NAN when nothing has been received for x time?

    Regards
    Paul..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions