historic max and min values

Topics (not sure which fora)
when not sure where to post, post here and mods will move it to right forum.

Moderators: leecollings, remb0

Post Reply
elgringo
Posts: 96
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

historic max and min values

Post 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.
User avatar
RonkA
Posts: 115
Joined: Tuesday 14 June 2022 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Harlingen
Contact:

Re: historic max and min values

Post by RonkA »

You mean like this?

Code: Select all

http://192.168.178.2:7080/json.htm?type=command&param=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!! 8-)
SolarEdge ModbusTCP - Kaku - Synology NAS - Watermeter - ESPEasy - DS18b20
Work in progress = Life in general..
elgringo
Posts: 96
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

Re: historic max and min values

Post 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&param=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!! 8-)
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
User avatar
waltervl
Posts: 5851
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: historic max and min values

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
RonkA
Posts: 115
Joined: Tuesday 14 June 2022 12:57
Target OS: NAS (Synology & others)
Domoticz version: 2025.1
Location: Harlingen
Contact:

Re: historic max and min values

Post 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&param=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..
SolarEdge ModbusTCP - Kaku - Synology NAS - Watermeter - ESPEasy - DS18b20
Work in progress = Life in general..
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest