Page 1 of 1

Zero (0) values in graph

Posted: Thursday 28 May 2020 14:53
by tne7laa
I'm using the ToonAPILib to get power consumption etc from Toon (Netherlands). It is working fine some years now.
The problem i'm having is that the graph shows 0 values in the graph. So the line drops (each 35minutes or so). See picture:

Image

If i'm looking in the logging it show no values like that:

Code: Select all

...
2020-05-28 13:41:56.444  (Toon) Update power/solar usage: 742783;704131;59768;132476;364;0
2020-05-28 13:47:56.569  (Toon) Update power/solar usage: 742783;704156;59768;132581;370;0
2020-05-28 13:53:57.161  (Toon) Update power/solar usage: 742783;704180;59768;132584;0;0
2020-05-28 13:58:57.512  (Toon) Update power/solar usage: 742783;704180;59768;132704;0;0
2020-05-28 14:04:57.696  (Toon) Update power/solar usage: 742783;704211;59768;132758;380;0
2020-05-28 14:10:57.648  (Toon) Update power/solar usage: 742783;704216;59768;133025;0;0
2020-05-28 14:16:57.766  (Toon) Update power/solar usage: 742783;704250;59768;133111;476;0
2020-05-28 14:22:57.865  (Toon) Update power/solar usage: 742783;704280;59768;133127;0;0
2020-05-28 14:28:57.897  (Toon) Update power/solar usage: 742783;704280;59768;133282;0;0
2020-05-28 14:34:58.089  (Toon) Update power/solar usage: 742783;704280;59768;133542;0;0
2020-05-28 14:40:58.244  (Toon) Update power/solar usage: 742783;704280;59768;133764;0;0
...
Only thing what I see is that the graph gives graph info about values (when you hover above graph) on each 5 minutes (e.g. 10.05, 10.10, 10.15...) and the timestamps in logging are about 6 minutes from each other. Don't know if that is the problem because other graphs from other devices don't have this.

Hope someone knows how to fix this...

Re: Zero (0) values in graph

Posted: Tuesday 16 June 2020 10:49
by tne7laa
I solved it myself eventually. Problem was that Domoticz shows values in 5 minutes interval. The ToonAPIlib values where some time logged after 6 minutes. So then sometimes the value stays the same and because the values are shown as difference (current-previous) it wil generate 0.
Solution is to get ToonAPIlib values before 5 minutes.

Code: Select all

sudo nano /usr/local/lib/python3.7/dist-packages/toonapilib/configuration.py
change default 300 (5 minutes) to e.g. 240 (4 minutes):

Code: Select all

STATE_CACHING_SECONDS = 240
Graph has no 0 values
Image

Hope this helps also others.

Re: Zero (0) values in graph

Posted: Thursday 09 September 2021 19:19
by Ritchie
Thank you, this just solved my problem.