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

Add option to set force_update for all sensors #1695

Merged
merged 1 commit into from
Apr 27, 2021

Conversation

joegross
Copy link
Contributor

If your sensor values change infrequently and you prefer to write the most recent value even if not changed.

This is useful if you're graphing the sensor data or want to alert on missing data.

@zuckschwerdt
Copy link
Collaborator

Thanks. Looks good. Unfortunatly there is kind of a pile up of other changes, not sure what the implications are.
@rct and @maxlock are more familiar with the script.

@rct
Copy link
Contributor

rct commented Apr 24, 2021

This looks fine to me. I still haven't had time to pull the various PRs and other config changes people have submitted into one clean PR that can be applied to the current head.

@zuckschwerdt I think this is self contained enough that you could merge this. There is merging that has to be done anyway. This won't really complicate that..

@joegross - Just curious what you are using this for in Hass? I've seen the option, but I don't understand the implications from the docs on the MQTT page. I guess I haven't noticed a need for it so far.

I suspect this is also one of those things that if you have enough devices, you'll probably want to selectively enable this option. I've got to imagine this causes extra rows to be added to the recorder database, where the default behavior for hass is to try to suppress those if the state hasn't changed.

@joegross
Copy link
Contributor Author

@joegross - Just curious what you are using this for in Hass? I've seen the option, but I don't understand the implications from the docs on the MQTT page. I guess I haven't noticed a need for it so far.

I have a collection of Acurite temperature sensors throughout the house as well as a bunch of 986 sensors in frdges/freezers. I use hassio to send the data to influx with a grafana.

The 986 sensor, in particular, measures temperature in 1F increments, and in a deep freezer it can stay within a 1F range for hours at a time.

I have grafana alerts on temperature alert (did the freezer lose power or did I leave the door open?) but there's no way to differentiate between the sensor losing power or signal and the temperature being stable. My solution is to force_update and then grafana can alert on "no data".

I suspect this is also one of those things that if you have enough devices, you'll probably want to selectively enable this option. I've got to imagine this causes extra rows to be added to the recorder database, where the default behavior for hass is to try to suppress those if the state hasn't changed.

I agree with that, though influx is extremely efficient in storing data so in my case there's no harm in storing duplicate data points. I saw force_update was enabled on a seemingly random selection of sensors, so short of a larger refactor I didn't see a good way of selecting this option without imposing a new default on others.

@zuckschwerdt zuckschwerdt merged commit 836bf75 into merbanan:master Apr 27, 2021
@rct
Copy link
Contributor

rct commented Apr 29, 2021

@joegross - thanks for the info.

I have 986 sensors - I wrote the decoder for them, but I haven't used them in alerts yet (on my list). I can usually see the freezer's on/off and defrost cycles as long as the sensor isn't sitting on top of some big solid frozen thing.

I was thinking more about the Hass recorder database than InfluxDB. I've had issues before with the recorder database (especially when it was on an SD card.)

Trying to refactor the auto discovery script to do things in a model specific way is on my list, but it's not very high up at the moment.

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

Successfully merging this pull request may close these issues.

3 participants