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!
P1 counter values history
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: P1 counter values history
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)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?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- 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
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......
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
Rob
-
- Posts: 5
- Joined: Friday 28 June 2019 8:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Contact:
Re: P1 counter values history
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.
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.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: P1 counter values history
Can you please share your API call and explain where the differences are between the results of this call and what you expect ?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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 5
- Joined: Friday 28 June 2019 8:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Contact:
Re: P1 counter values history
The call is made every hour. The code checks the database for entries which have the same timestamp.waaren wrote: ↑Friday 28 June 2019 9:59Can you please share your API call and explain where the differences are between the results of this call and what you expect ?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.
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)
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: P1 counter values history
The GUI graph does use a slightly different API (without the &method=1 ).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 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
- Spoiler: show
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 5
- Joined: Friday 28 June 2019 8:43
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Contact:
Re: P1 counter values history
Hi Waaren,waaren wrote: ↑Friday 28 June 2019 15:47The GUI graph does use a slightly different API (without the &method=1 ).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 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.
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!
Who is online
Users browsing this forum: No registered users and 1 guest