NorthernMan54 / homebridge-tasmota

Plugin for Tasmota devices leveraging Home Assistant auto discovery
Apache License 2.0
35 stars 9 forks source link

Reduce the number of statusUpdate messages #5

Closed saabirsa closed 4 years ago

saabirsa commented 4 years ago

Would it be possible to consider reducing the number of statusUpdate messages being written to the logs? I have roughly 33 messages on the console every minute. I've ensured that debug is set to false.

As a backlog enhancement, it would be even better to configure these on a per device basis within Homebridge Config UI X. For example, switching off statusUpdate for BME680 devices only.

NorthernMan54 commented 4 years ago

Or would it be better to only log when the value changes? Ie delta’s

saabirsa commented 4 years ago

Yup, that could work also, but perhaps have this adjustable in the config.json file? (i.e. debug vs logging as it is now vs deltas only)

StumbleNOLA commented 4 years ago

Any one of the following, or all three, would be great.

1) set min frequency of logs 2) only log deltas 3) only log deltas X% larger than current (I am thinking of temp sensors that read .01 degrees). They always fluctuate by that .0x amount but I don’t need that granularity of data.

NorthernMan54 commented 4 years ago

Okay, I changed the logging to only log when the value changes aka Delta. And use debug logging when the value doesn't change. This should drop the logging immensely.

Please update to the latest

saabirsa commented 4 years ago

All working as expected, many thanks!

Although logging has been significantly reduced, I do see the logic in @StumbleNOLA's 3rd suggestion above; my Humidity sensors are reporting fluctuations of 0.1 and this now forms the bulk of the statusUpdate messages.

NorthernMan54 commented 4 years ago

In the latest version I changed the logic to only update on whole number changes, so the frequency should be significantly lower now.

StumbleNOLA commented 4 years ago

This is a great compromise. I can’t think of many HomeKit things where I need granularity beyond 1 unit. Maybe Celsius degrees, where .5 might be desirable, but I work in Fahrenheit.