arachnetech / homebridge-mqttthing

A plugin for Homebridge allowing the integration of many different accessory types using MQTT.
Apache License 2.0
469 stars 103 forks source link

Identical values for 5-6 hours in temperature history #159

Closed mrdc closed 5 years ago

mrdc commented 5 years ago

Hello,

I'm using mqttthing v1.0.45 and sometimes see that in EVE history values for outside temp are the same for 6-8 hours. I've also check it in json - the same values for many hours. Strange that it happens during night time:

5,8 | 08.10.19 8:48 -- | -- 6,44 | 08.10.19 8:38 5,82 | 08.10.19 8:28 5,69 | 08.10.19 8:18 5,58 | 08.10.19 8:08 6,08 | 08.10.19 7:58 5,54 | 08.10.19 7:48 5,23 | 08.10.19 7:38 5,08 | 08.10.19 7:28 4,87 | 08.10.19 7:18 5,15 | 08.10.19 7:08 3,94 | 08.10.19 6:58 3,94 | 08.10.19 6:48 3,69 | 08.10.19 6:38 3,69 | 08.10.19 6:28 3,69 | 08.10.19 6:18 3,47 | 08.10.19 6:08 3,47 | 08.10.19 5:58 3,47 | 08.10.19 5:48 3,31 | 08.10.19 5:38 2,72 | 08.10.19 5:28 2,72 | 08.10.19 5:18 2,72 | 08.10.19 5:08 2,72 | 08.10.19 4:58 **1,19 | 08.10.19 4:48 1,19 | 08.10.19 4:38 1,19 | 08.10.19 4:28 1,19 | 08.10.19 4:18 1,19 | 08.10.19 4:08 1,19 | 08.10.19 3:58 1,19 | 08.10.19 3:48 1,19 | 08.10.19 3:38 1,19 | 08.10.19 3:28 1,19 | 08.10.19 3:18 1,19 | 08.10.19 3:08 1,19 | 08.10.19 2:58 1,19 | 08.10.19 2:48 1,19 | 08.10.19 2:38 1,19 | 08.10.19 2:28 1,19 | 08.10.19 2:18 1,19 | 08.10.19 2:08 1,19 | 08.10.19 1:58 1,19 | 08.10.19 1:48 1,19 | 08.10.19 1:38 1,19 | 08.10.19 1:28 1,19 | 08.10.19 1:18 1,19 | 08.10.19 1:08 1,19 | 08.10.19 0:58 1,19 | 08.10.19 0:48 1,19 | 08.10.19 0:38 1,19 | 08.10.19 0:28 1,19 | 08.10.19 0:18 1,19 | 08.10.19 0:08 1,19 | 07.10.19 23:58 1,19 | 07.10.19 23:48 1,19 | 07.10.19 23:38 1,19 | 07.10.19 23:28 1,19 | 07.10.19 23:18 1,19 | 07.10.19 23:08 1,19 | 07.10.19 22:58 1,19 | 07.10.19 22:48 1,19 | 07.10.19 22:38 1,19 | 07.10.19 22:28 1,19 | 07.10.19 22:18 1,19 | 07.10.19 22:08 1,19 | 07.10.19 21:58 1,19 | 07.10.19 21:48 1,19 | 07.10.19 21:38** 0,88 | 07.10.19 21:28 0,88 | 07.10.19 21:18 0,88 | 07.10.19 21:08 0,88 | 07.10.19 20:58 0,88 | 07.10.19 20:48 0,88 | 07.10.19 20:38 1,44 | 07.10.19 20:28 1,44 | 07.10.19 20:18 1,44 | 07.10.19 20:08 1,44 | 07.10.19 19:58 1,44 | 07.10.19 19:48 1,5 | 07.10.19 19:38 1,5 | 07.10.19 19:28 1,69 | 07.10.19 19:18 1,69 | 07.10.19 19:08 1,56 | 07.10.19 18:58 1,69 | 07.10.19 18:48 1,69 | 07.10.19 18:38 1,94 | 07.10.19 18:28 2,12 | 07.10.19 18:18 2,12 | 07.10.19 18:08 2,12 | 07.10.19 17:58 2,37 | 07.10.19 17:48 2,37 | 07.10.19 17:38 2,6 | 07.10.19 17:28 2,63 | 07.10.19 17:18   | 07.10.19 17:08 2,72 | 07.10.19 17:08 2,56 | 07.10.19 16:51 2,44 | 07.10.19 16:41 2,48 | 07.10.19 16:31 2,5 | 07.10.19 16:21 2,56 | 07.10.19 16:11 2,6 | 07.10.19 16:01 2,64 | 07.10.19 15:51 2,71 | 07.10.19 15:41 2,81 | 07.10.19 15:31 3,06 | 07.10.19 15:21 3,06 | 07.10.19 15:11 3,33 | 07.10.19 15:01 3,44 | 07.10.19 14:51 3,56 | 07.10.19 14:41 3,64 | 07.10.19 14:31 3,74 | 07.10.19 14:21 3,93 | 07.10.19 14:11 4,03 | 07.10.19 14:01 4,19 | 07.10.19 13:51 4,12 | 07.10.19 13:41 3,89 | 07.10.19 13:31 3,84 | 07.10.19 13:21 3,52 | 07.10.19 13:11 3,83 | 07.10.19 13:01 3,74 | 07.10.19 12:51 3,77 | 07.10.19 12:41 3,98 | 07.10.19 12:31 4,11 | 07.10.19 12:21 3,73 | 07.10.19 12:11 3,24 | 07.10.19 12:01 3,01 | 07.10.19 11:51 2,75 | 07.10.19 11:41 3,67 | 07.10.19 11:31 4,74 | 07.10.19 11:21 4,27 | 07.10.19 11:11 4,1 | 07.10.19 11:01 5,49 | 07.10.19 10:51 5,43 | 07.10.19 10:41 5,31 | 07.10.19 10:31 4,94 | 07.10.19 10:21 4,99 | 07.10.19 10:11 5,34 | 07.10.19 10:01 4,88 | 07.10.19 9:51 4,92 | 07.10.19 9:41 4,83 | 07.10.19 9:31 4,52 | 07.10.19 9:21 4,64 | 07.10.19 9:11 4,87 | 07.10.19 9:01 4,77 | 07.10.19 8:51 4,06 | 07.10.19 8:41 3,78 | 07.10.19 8:31 3,81 | 07.10.19 8:21 4 | 07.10.19 8:11 3,5 | 07.10.19 8:01 3,45 | 07.10.19 7:51 3,47 | 07.10.19 7:41 3,19 | 07.10.19 7:31 1,91 | 07.10.19 7:21 1,91 | 07.10.19 7:11 1,91 | 07.10.19 7:01 1,91 | 07.10.19 6:51 1,91 | 07.10.19 6:41 2 | 07.10.19 6:31 1,81 | 07.10.19 6:21 1,75 | 07.10.19 6:11 1,75 | 07.10.19 6:01 1,62 | 07.10.19 5:51 **1,56 | 07.10.19 5:41 1,56 | 07.10.19 5:31 1,56 | 07.10.19 5:21 1,56 | 07.10.19 5:11 1,56 | 07.10.19 5:01 1,56 | 07.10.19 4:51 1,56 | 07.10.19 4:41 1,56 | 07.10.19 4:31 1,56 | 07.10.19 4:21 1,56 | 07.10.19 4:11 1,56 | 07.10.19 4:01 1,56 | 07.10.19 3:51 1,56 | 07.10.19 3:41 1,56 | 07.10.19 3:31 1,56 | 07.10.19 3:21 1,56 | 07.10.19 3:11 1,56 | 07.10.19 3:01 1,56 | 07.10.19 2:51 1,56 | 07.10.19 2:41 1,56 | 07.10.19 2:31 1,56 | 07.10.19 2:21 1,56 | 07.10.19 2:11 1,56 | 07.10.19 2:01 1,56 | 07.10.19 1:51 1,56 | 07.10.19 1:41 1,56 | 07.10.19 1:31 1,56 | 07.10.19 1:21 1,56 | 07.10.19 1:11 1,56 | 07.10.19 1:01 1,56 | 07.10.19 0:51 1,56 | 07.10.19 0:41 1,56 | 07.10.19 0:31 1,56 | 07.10.19 0:21 1,56 | 07.10.19 0:11 1,56 | 07.10.19 0:01 1,56 | 06.10.19 23:51 1,56 | 06.10.19 23:41 1,56 | 06.10.19 23:31 1,56 | 06.10.19 23:21 1,56 | 06.10.19 23:11 1,56 | 06.10.19 23:01 1,56 | 06.10.19 22:51 1,56 | 06.10.19 22:41 1,56 | 06.10.19 22:31 1,56 | 06.10.19 22:21 1,56 | 06.10.19 22:11 1,56 | 06.10.19 22:01 1,56 | 06.10.19 21:51 1,56 | 06.10.19 21:41 1,56 | 06.10.19 21:31 1,56 | 06.10.19 21:21** 1,5 | 06.10.19 21:11 1,5 | 06.10.19 21:01 1,5 | 06.10.19 20:51 1,56 | 06.10.19 20:41 1,56 | 06.10.19 20:31 1,56 | 06.10.19 20:21 1,56 | 06.10.19 20:11 1,66 | 06.10.19 20:01 1,69 | 06.10.19 19:51 1,75 | 06.10.19 19:41 1,75 | 06.10.19 19:31 1,75 | 06.10.19 19:21 1,75 | 06.10.19 19:11 1,69 | 06.10.19 19:01 1,69 | 06.10.19 18:51 1,81 | 06.10.19 18:41 1,81 | 06.10.19 18:31 1,69 | 06.10.19 18:21 1,81 | 06.10.19 18:11 1,75 | 06.10.19 18:01 1,81 | 06.10.19 17:51 1,81 | 06.10.19 17:41 2,12 | 06.10.19 17:31 2,12 | 06.10.19 17:21 2,12 | 06.10.19 17:11 2,06 | 06.10.19 17:01 2,06 | 06.10.19 16:51 2,06 | 06.10.19 16:41 2 | 06.10.19 16:31
tobekas commented 5 years ago

Hi, typically the history plugin will average all incoming mqtt temperature messages within a 10min intervall and so it will add one entry every 10 minutes to the history. If no data was received in the last 10min intervall, the default behavior of fakegato-history is to just repeat the last entry to prevent holes in the graph. I assume this happens here. Please make sure that your device really sends messages continuously (during night) at least every 10min.

You can disable this repetition by the following config line (recommenced):

"history": {"autoRepeat": false}

Alternatively, you can disable the complete timer (no averaging and no data repetition) by:

"history": {"autoTimer": false}

Attention: In this case you may flood the history with a lot of measurements. But these will reflect the original mqtt messages. Good for debugging and to see what’s going on.

mrdc commented 5 years ago

"history": {"autoRepeat": false}

Should I also keep "history": "true" in my config? Like this: "history": { "history": "true", "autoRepeat": false}

tobekas commented 5 years ago

Not necessary. If you define history as an object, it’s implicit true.

mrdc commented 5 years ago

@tobekas I've enabled autoRepeat but again I see the same values at night for many hours - do I have such a stable weather during sleep time or it can be an issues with MQTT: old data is fetched by mqttthing as sensor is not updating a MQTT topic with new measurements?

tobekas commented 5 years ago

Can you paste your config.json? Do you use the latest version of this plugin? For me personally, this configuration works as expected. What kind of sensor do you have? Does it really stop publishing messages at night? For further debugging, you can install mqtt.fx, which can also subscribe to your temperature topic. So you will see the origin messages.

mrdc commented 5 years ago

Yes, I'm using the latest version of Mqttthing - 1.0.45. Hardware setup: ESP-01S with ESP Easy + DS18B20. ESP-01S sends temp values via MQTT to RPi3b+ with Mosquitto on it. I have no clue if it really stops sending at night - maybe there is no new values and Mqttthing fetches old values before ESP-01S send a new one.

For further debugging, you can install mqtt.fx, which can also subscribe to your temperature topic.

Yes, that's what I want to do.

Config:

{
            "accessory": "mqttthing",
            "type": "temperatureSensor",
            "name": "OutsideTemp",
            "url": "mqtt://192.168.1.35",
            "username": "admin",
            "password": "admin",
            "topics": {
                "getCurrentTemperature": "/ESP_Easy/OutsideTemp/Temperature"
            },
            "history": {
                "history": "true",
                "autoRepeat": false
            }
        },
mrdc commented 5 years ago

With "autoRepeat": false I receive correct measurements.