Page 1 of 1
historic max and min values
Posted: Sunday 16 June 2024 15:27
by elgringo
I measure my voltage of 3 phases and can see the min and max per day but I wan the find the min and max value of all the day as output I would like the day when thism occured.
The graph is not able to show this. How can i achive this information.
Re: historic max and min values
Posted: Sunday 16 June 2024 19:55
by RonkA
You mean like this?
Code: Select all
http://192.168.178.2:7080/json.htm?type=command¶m=graph&sensor=counter&idx=28&range=month
change ip:port and set idx to your voltage device and see the last entry for the current day.
read this at 23.58 and you get your min and max today

..
My 100th post birthday!!

Re: historic max and min values
Posted: Wednesday 19 June 2024 12:55
by elgringo
RonkA wrote: ↑Sunday 16 June 2024 19:55
You mean like this?
Code: Select all
http://192.168.178.2:7080/json.htm?type=command¶m=graph&sensor=counter&idx=28&range=month
change ip:port and set idx to your voltage device and see the last entry for the current day.
read this at 23.58 and you get your min and max today

..
My 100th post birthday!!
A graph per month is not the max/min value of a period

The graph makes it possible to search for a max or min value, but this is still manual work. Exporting to csv is an option but this is manual work
Re: historic max and min values
Posted: Wednesday 19 June 2024 13:16
by waltervl
You can do something with dzvents to store data in a history variable. Only I don't think it is possible to load the min max values from the meter table.
Or you can load the graph json (can also with a longer period) into dzvents and do your math.
Unfortunately the Voltage Device has no report function like Temperature so it will not show min/max on the report page.
But further there is no out of the box function.
Re: historic max and min values
Posted: Wednesday 19 June 2024 19:07
by RonkA
Hmm, for some time Domoticz sends me an email at 23.58 with many facts about what has happened this day..
In this mail i have a section for the voltages and this does the thing i think you asked for...
The script is 500+ lines long and has all sorts of rubbish and usefull information about my installations, here the piece for getting voltage data for fase 1:
Code: Select all
-- data from 'Net - Voltage L1'
domoticz.openURL({
url = 'http://127.17.0.2:80/json.htm?type=command¶m=graph&sensor=counter&idx=28&range=month',
method = 'GET',
callback = 'VoltageL1Data'
})
Code: Select all
-- Callback for VoltageL1Data
if item.isHTTPResponse and item.ok and item.callback == 'VoltageL1Data' then
local response = item.json
if response.status == 'OK' then
local counterData = response.result
local lastIndex = #counterData
if lastIndex > 0 then
local lastEntry1 = counterData[lastIndex]
local lastEntry2 = counterData[lastIndex - 1]
L1Max1 = tonumber(lastEntry1.v_max) or 0
L1Min1 = tonumber(lastEntry1.v_min) or 0
L1Max2 = tonumber(lastEntry2.v_max) or 0
L1Min2 = tonumber(lastEntry2.v_min) or 0
L1Avg2 = tonumber(lastEntry2.v_avg) or 0
L1Dat2 = tostring(lastEntry2.d)
L1Avg2 is the average value from the day before.
So... i think it would be possible to automatically get that average value every day if jou have the patience, or run a script 1 minute in the new day..