Query P1 database with JSON
Posted: Saturday 24 January 2026 9:58
Hi,
My current energy script filters the P1 meter log database per year and searches for specific dates in that year.
[url]http://<IPaddr>:<Port>/json.htm?type=command¶m=graph&sensor=counter&idx=12345&range=year&year=2026[/url]
It returns the whole year, but filtering for 2026-01-01 it returns:
So this works but queries a large JSON response.
Since I am only looking for data at one specific date (day of the year), I thought I could also do:
[url]http://<IPaddr>:<Port>/json.htm?type=command¶m=graph&sensor=counter&idx=12345&range=2026-01-01T2026-01-01[/url]
However, in this case not all data is present, I get (only showing "result" section below), so "c" and "p" are missing:
What thinking error do I make?
Ultimately I want to fetch the data of the P1 meter for one specific day of the year (e.g. contract start date).
Any idea's?
My current energy script filters the P1 meter log database per year and searches for specific dates in that year.
[url]http://<IPaddr>:<Port>/json.htm?type=command¶m=graph&sensor=counter&idx=12345&range=year&year=2026[/url]
It returns the whole year, but filtering for 2026-01-01 it returns:
Code: Select all
{
"c" : "6409.15",
"d" : "2026-01-01",
"p" : "11.8244",
"v" : "9.91"
},Since I am only looking for data at one specific date (day of the year), I thought I could also do:
[url]http://<IPaddr>:<Port>/json.htm?type=command¶m=graph&sensor=counter&idx=12345&range=2026-01-01T2026-01-01[/url]
However, in this case not all data is present, I get (only showing "result" section below), so "c" and "p" are missing:
Code: Select all
"result" :
[
{
"d" : "2026-01-01",
"v" : "9.91"
},
{
"d" : "2026-01-01",
"v" : "20.11"
}
],
Ultimately I want to fetch the data of the P1 meter for one specific day of the year (e.g. contract start date).
Any idea's?