hannseman / homebridge-mi-hygrothermograph

Homebridge plugin for the Xiaomi Mi Bluetooth Temperature and Humidity Sensor
MIT License
267 stars 52 forks source link

Identical values for many hours for Temp&Humid when connection to device is lost #116

Closed mrdc closed 3 years ago

mrdc commented 4 years ago

Hello,

I'm using homebridge-mi-hygrothermograph 3.0.1 and sometimes see that in EVE history Temp&Humid values are the same for many hours. I've also checked in JSON - the same values for many hours. Looks like plugin auto repeats previous values to history when no new readings.

Expected Behavior

Temp and Humid values shouldn't be repeated if there is no new values.

Current Behavior

Temp and Humid values are repeated if there is no connection to Device.

Steps to Reproduce (for bugs)

Versions

Configuration

{
            "name": "Temperature & Humidity",
            "address": "xxxxxxxxx",
            "temperatureName": "Temperature",
            "humidityName": "Humidity",
            "fakeGatoEnabled": true,
            "timeout": 30,
            "forceDiscovering": true,
            "forceDiscoveringDelay": 120,
            "disableBatteryLevel": false,
            "lowBattery": 10,
            "temperatureOffset": 0,
            "humidityOffset": 0,
            "accessory": "Hygrotermograph"
        },
hannseman commented 4 years ago

That's the default behaviour of the fakegato-history which is used to provide support for the eve app.

By default, if you don't addEntry during the 10 minutes timer, to avoid gaps (and fill data for lazy sensors), the timer repeat the last data. To avoid this behaviour, add the disableRepeatLastData.

I guess we could add support for passing custom configuration to fakegato which would enable you to turn off this behaviour. I'll look into adding this ASAP or if you feel like it I'm glad to accept patches.

Another question is why you see hour long gaps, maybe your sensor so too far away from the raspberry pi? Try moving it closer.

hannseman commented 3 years ago

Just published 3.1.0 where one can customise fakegato-history through the fakeGatoOptions parameter. You should be able to use it to set fakeGatoOptions: {disableRepeatLastData: true}.