P1 counter values history

Moderator: leecollings

Post Reply
rednas
Posts: 132
Joined: Tuesday 20 October 2015 12:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

P1 counter values history

Post by rednas »

Hello,

Is there a possibility to get the history of the P1 counter values?
Domoticz only shows the values of the usage/return per day, but I would like to read out the counter values at certain dates in history. Is this possible?
Or do I need to make a dummy device to record the counter values?

Thanks in advance!
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 counter values history

Post by waaren »

rednas wrote: Wednesday 05 June 2019 10:48 Is there a possibility to get the history of the P1 counter values?
Domoticz only shows the values of the usage/return per day, but I would like to read out the counter values at certain dates in history. Is this possible?
Or do I need to make a dummy device to record the counter values?
The history is indeed only a summary of the data. So to be able to see the historical detailed data you either need an additional virtual device or store the data to an external database (e.g. influxdb)
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
User avatar
erem
Posts: 230
Joined: Tuesday 27 March 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Amsterdam/netherlands
Contact:

Re: P1 counter values history

Post by erem »

my reverse engineering to ferret out a problem with my P1 meter found:


The daily values are stored in the table multimeter_calendar.
You need to find the device id for your P1 meter in the table devicestatus (Field ID) and use the found value to select from the table multimeter_calendar where DeciceRowId = found value
there you will find the daily counter values

//value1 = powerusage1; Low mEVLT Electriciteit Verbruik Laag Tarief
//value2 = powerdeliv1; low mEOLT Electriciteit Opbrengst Laag Tarief
//value3 = usagecurrent; mEAV Electriciteit Actueel Verbruik
//value4 = delivcurrent; mEAT Electriciteit Actueel Teruglevering
//value5 = powerusage2; high mEVHT Electriciteit Verbruik Hoog Tarief
//value6 = powerdeliv2; high mEOHT Electriciteit Opbrengst Hoog Tarief

hope this helps......
Regards,

Rob
SebastiaanCT
Posts: 5
Joined: Friday 28 June 2019 8:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: P1 counter values history

Post by SebastiaanCT »

Hi rednas,

I have written a c# application which will collect the data from the P1 meter hourly and store it in a MS SQL database.
This is how I store the historical data from both the power and gas meter.

The API call i quite simple actually. But now I strugle a bit with the values themselfs.

I see different values returning from the API call vs the values in the domoticz charts.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 counter values history

Post by waaren »

SebastiaanCT wrote: Friday 28 June 2019 8:49 I have written a c# application which will collect the data from the P1 meter hourly and store it in a MS SQL database.
I see different values returning from the API call vs the values in the domoticz charts.
Can you please share your API call and explain where the differences are between the results of this call and what you expect ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
SebastiaanCT
Posts: 5
Joined: Friday 28 June 2019 8:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: P1 counter values history

Post by SebastiaanCT »

waaren wrote: Friday 28 June 2019 9:59
SebastiaanCT wrote: Friday 28 June 2019 8:49 I have written a c# application which will collect the data from the P1 meter hourly and store it in a MS SQL database.
I see different values returning from the API call vs the values in the domoticz charts.
Can you please share your API call and explain where the differences are between the results of this call and what you expect ?
The call is made every hour. The code checks the database for entries which have the same timestamp.
If they exist, they are skipped. If not,.....they are inserted to the database

The API call: http://192.168.82.3:8084/json.htm?type= ... y&method=1
The gas sensor is addressed IDX=2
Based on this request I get the values from the last 24hrs.
What I see is the value in the 7th hour (07:05) = 2,56
All other values within this hour are zero.
In the graph on the website of Domotics the value for the 7th hour = 0.213m3

Some settings in Domoticz related to P1
RFXMeter/Counter Divider for gas = 100 (default)
P1 Samrt Meter Type = With decimals (default)
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: P1 counter values history

Post by waaren »

SebastiaanCT wrote: Friday 28 June 2019 14:44 The call is made every hour. The code checks the database for entries which have the same timestamp.
The API call: http://192.168.82.3:8084/json.htm?type= ... y&method=1
The GUI graph does use a slightly different API (without the &method=1 ).
The differences are that with method1 the call returns the 5 minutes totals and without method1 it returns the hourly totals. The unit is also different (on my system the hourly values totals to 0.405 and the 5 minute values totals to 4.2)
I think the method1 parm is meant to be used for regular counters to be able to present a combined bar / line graph on the GUI.

with method1
Spoiler: show

Code: Select all

json.htm?type=graph&sensor=counter&idx=36&range=day&method=1
{
   "ValueQuantity" : "",
   "ValueUnits" : "",
   "result" : [
      {
         "d" : "2019-06-27 15:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 15:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 15:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 15:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 15:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 15:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 15:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 15:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 15:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 16:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:10",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 17:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:10",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 18:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:10",
         "v" : "0.09"
      },
      {
         "d" : "2019-06-27 19:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 19:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:10",
         "v" : "0.10"
      },
      {
         "d" : "2019-06-27 20:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 20:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:10",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 21:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:10",
         "v" : "0.10"
      },
      {
         "d" : "2019-06-27 22:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 22:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:10",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-27 23:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:10",
         "v" : "0.20"
      },
      {
         "d" : "2019-06-28 00:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 00:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:10",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 01:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:10",
         "v" : "0.11"
      },
      {
         "d" : "2019-06-28 02:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 02:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:10",
         "v" : "0.10"
      },
      {
         "d" : "2019-06-28 03:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:36",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 03:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:10",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 04:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:10",
         "v" : "0.10"
      },
      {
         "d" : "2019-06-28 05:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 05:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:10",
         "v" : "0.11"
      },
      {
         "d" : "2019-06-28 06:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 06:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:10",
         "v" : "0.10"
      },
      {
         "d" : "2019-06-28 07:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 07:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:10",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 08:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:10",
         "v" : "0.11"
      },
      {
         "d" : "2019-06-28 09:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 09:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:10",
         "v" : "0.10"
      },
      {
         "d" : "2019-06-28 10:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 10:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:10",
         "v" : "3.25"
      },
      {
         "d" : "2019-06-28 11:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 11:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:10",
         "v" : "0.11"
      },
      {
         "d" : "2019-06-28 12:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 12:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:10",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 13:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:05",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:10",
         "v" : "0.11"
      },
      {
         "d" : "2019-06-28 14:15",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:20",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:25",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:30",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:35",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:40",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:45",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:50",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 14:55",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 15:00",
         "v" : "0.00"
      },
      {
         "d" : "2019-06-28 15:05",
         "v" : "0.00"
      }
   ],
   "status" : "OK",
   "title" : "Graph counter day"
}
without &method=1
Spoiler: show

Code: Select all

{
   "ValueQuantity" : "",
   "ValueUnits" : "",
   "result" : [
      {
         "d" : "2019-06-27 15:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-27 16:00",
         "v" : "0.016"
      },
      {
         "d" : "2019-06-27 17:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-27 18:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-27 19:00",
         "v" : "0.008"
      },
      {
         "d" : "2019-06-27 20:00",
         "v" : "0.008"
      },
      {
         "d" : "2019-06-27 21:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-27 22:00",
         "v" : "0.008"
      },
      {
         "d" : "2019-06-27 23:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-28 00:00",
         "v" : "0.017"
      },
      {
         "d" : "2019-06-28 01:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-28 02:00",
         "v" : "0.009"
      },
      {
         "d" : "2019-06-28 03:00",
         "v" : "0.008"
      },
      {
         "d" : "2019-06-28 04:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-28 05:00",
         "v" : "0.008"
      },
      {
         "d" : "2019-06-28 06:00",
         "v" : "0.009"
      },
      {
         "d" : "2019-06-28 07:00",
         "v" : "0.008"
      },
      {
         "d" : "2019-06-28 08:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-28 09:00",
         "v" : "0.009"
      },
      {
         "d" : "2019-06-28 10:00",
         "v" : "0.008"
      },
      {
         "d" : "2019-06-28 11:00",
         "v" : "0.271"
      },
      {
         "d" : "2019-06-28 12:00",
         "v" : "0.009"
      },
      {
         "d" : "2019-06-28 13:00",
         "v" : "0.000"
      },
      {
         "d" : "2019-06-28 14:00",
         "v" : "0.009"
      },
      {
         "d" : "2019-06-28 15:00",
         "v" : "0.000"
      }
   ],
   "status" : "OK",
   "title" : "Graph counter day"
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
SebastiaanCT
Posts: 5
Joined: Friday 28 June 2019 8:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: P1 counter values history

Post by SebastiaanCT »

waaren wrote: Friday 28 June 2019 15:47
SebastiaanCT wrote: Friday 28 June 2019 14:44 The call is made every hour. The code checks the database for entries which have the same timestamp.
The API call: http://192.168.82.3:8084/json.htm?type= ... y&method=1
The GUI graph does use a slightly different API (without the &method=1 ).
The differences are that with method1 the call returns the 5 minutes totals and without method1 it returns the hourly totals. The unit is also different (on my system the hourly values totals to 0.405 and the 5 minute values totals to 4.2)
I think the method1 parm is meant to be used for regular counters to be able to present a combined bar / line graph on the GUI.
Hi Waaren,

Just checked the API call without the method=1. This indeed solves the problem.
Never thought about not using the method=1 actually ;)

The progam runs again, in the mean time added a file based logging. So each request is logged into a log file.
But it's clear whats happening.

Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest