Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4ybaka opened this issue Jan 29, 2025 · 1 comment
Open

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

4ybaka opened this issue Jan 29, 2025 · 1 comment

Comments

@4ybaka
Copy link

4ybaka commented Jan 29, 2025

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?

@sooty66
Copy link

sooty66 commented Feb 14, 2025

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants