OK I’ve found the bug. hourly_kwh is updated every minutes by Neviweb but I’m polling the data only once every 30 minutes. But it is possible to get the data of every minutes as a dictionary and calculate a total for this hour period.
for example the data receive for last hour
|history|[ {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, … ]|
|0|Object { period: 0, periodQuality: 0, counter: 3777495, … }|
|1|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|2|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|3|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|4|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|5|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|6|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|7|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|8|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|9|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|10|Object { period: 0, periodQuality: 60, counter: 3777495, … }|
|11|Object { period: 400, periodQuality: 60, counter: 3777095, … }|
|12|Object { period: 767, periodQuality: 60, counter: 3776328, … }|
|13|Object { period: 761, periodQuality: 60, counter: 3775567, … }|
|14|Object { period: 767, periodQuality: 60, counter: 3774800, … }|
|15|Object { period: 52, periodQuality: 60, counter: 3774748, … }|
|16|Object { period: 0, periodQuality: 60, counter: 3774748, … }|
|17|Object { period: 0, periodQuality: 60, counter: 3774748, … }|
|18|Object { period: 0, periodQuality: 60, counter: 3774748, … }|
|19|Object { period: 0, periodQuality: 60, counter: 3774748, … }|
|20|Object { period: 0, periodQuality: 60, counter: 3774748, … }|
|21|Object { period: 0, periodQuality: 60, counter: 3774748, … }|
|22|Object { period: 0, periodQuality: 60, counter: 3774748, … }|
|23|Object { period: 0, periodQuality: 60, counter: 3774748, … }|
|24|Object { period: 649, periodQuality: 60, counter: 3774099, … }|
|25|Object { period: 688, periodQuality: 60, counter: 3773411, … }|
|26|Object { period: 0, periodQuality: 60, counter: 3773411, … }|
|27|Object { period: 0, periodQuality: 60, counter: 3773411, … }|
|28|Object { period: 0, periodQuality: 60, counter: 3773411, … }|
|29|Object { period: 0, periodQuality: 60, counter: 3773411, … }|
|30|Object { period: 0, periodQuality: 60, counter: 3773411, … }|
|31|Object { period: 642, periodQuality: 60, counter: 3772769, … }|
|32|Object { period: 160, periodQuality: 60, counter: 3772609, … }|
|33|Object { period: 0, periodQuality: 60, counter: 3772609, … }|
|34|Object { period: 383, periodQuality: 60, counter: 3772226, … }|
|35|Object { period: 775, periodQuality: 60, counter: 3771451, … }|
|36|Object { period: 779, periodQuality: 60, counter: 3770672, … }|
|37|Object { period: 783, periodQuality: 60, counter: 3769889, … }|
|38|Object { period: 271, periodQuality: 60, counter: 3769618, … }|
|39|Object { period: 0, periodQuality: 60, counter: 3769618, … }|
I need to sum the period value to get the hourly_kwh. I’ll try to make a patch this week.