hi,
i have a rfx meter counter. Is it possible to get the value 349 tendance water in the dzvents script ?
Pierrotori
tendances value in the dzvent script
Moderators: leecollings, remb0
- pierrotori
- Posts: 118
- Joined: Tuesday 15 May 2018 0:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: France
- Contact:
tendances value in the dzvent script
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
- waltervl
- Posts: 5852
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: tendances value in the dzvent script
I believe it is calculated by the highcharts graph module on the webgui part. So not available in dzvents.
You could ofcourse have dzvents calculate a trend based on the values in the database.
You could ofcourse have dzvents calculate a trend based on the values in the database.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- pierrotori
- Posts: 118
- Joined: Tuesday 15 May 2018 0:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: France
- Contact:
Re: tendances value in the dzvent script
if i would like to use the function in dzvents to calculate a trend bases, i suppose i use a sqlite function, is it correct ?
but by default sqlite is not installed
but by default sqlite is not installed
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
- waltervl
- Posts: 5852
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: tendances value in the dzvent script
No, sqlite is never needed to do dzvents actions.
You probably need an Domoticz json API param=graph call to get the history data https://wiki.domoticz.com/Domoticz_API/ ... 7s#History
From that data you can calculate the trend with dzvents/lua. There will probably be Lua functions for that.
You probably need an Domoticz json API param=graph call to get the history data https://wiki.domoticz.com/Domoticz_API/ ... 7s#History
From that data you can calculate the trend with dzvents/lua. There will probably be Lua functions for that.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- pierrotori
- Posts: 118
- Joined: Tuesday 15 May 2018 0:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: France
- Contact:
tendances value in the dzvent script
very good, thanks a lot i continue to update the dzvents script
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
- pierrotori
- Posts: 118
- Joined: Tuesday 15 May 2018 0:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: France
- Contact:
Re: tendances value in the dzvent script
i try this , but no tendance water in the result of http
Code: Select all
http://xxx.xxx.xx.x:8080/json.htm?groupby=month&idx=625¶m=graph&sensor=counter&type=command
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
- waltervl
- Posts: 5852
- Joined: Monday 28 January 2019 18:48
- Target OS: Linux
- Domoticz version: 2024.7
- Location: NL
- Contact:
Re: tendances value in the dzvent script
As said before, the web graph module highcharts that Domoticz is using is calculating the tendency itself. As input it is using the same raw data from the API calls you now used.
So you have to calculate the tendency yourself with dzvents the same way as the highcharts module is doing.
So you have to calculate the tendency yourself with dzvents the same way as the highcharts module is doing.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
- pierrotori
- Posts: 118
- Joined: Tuesday 15 May 2018 0:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2024.4
- Location: France
- Contact:
Re: tendances value in the dzvent script
i found the formule
n = len(days)
sum_x = sum(days)
sum_y = sum(water)
sum_xx = sum(days * days)
sum_xy = sum(days * water)
# Formules pour la pente (slope) et l'ordonnée à l'origine (intercept)
# slope = (n∑(xy)−∑x∑y)/(n∑(x^2)-∑(x)^2)
slope = (n * sum_xy - sum_x * sum_y) / (n * sum_xx - sum_x ^2)
# intercept = (∑y - slope * ∑x) /n
intercept = (sum_y - slope * sum_x) / n
tendance = slope * days + intercept
n = len(days)
sum_x = sum(days)
sum_y = sum(water)
sum_xx = sum(days * days)
sum_xy = sum(days * water)
# Formules pour la pente (slope) et l'ordonnée à l'origine (intercept)
# slope = (n∑(xy)−∑x∑y)/(n∑(x^2)-∑(x)^2)
slope = (n * sum_xy - sum_x * sum_y) / (n * sum_xx - sum_x ^2)
# intercept = (∑y - slope * ∑x) /n
intercept = (sum_y - slope * sum_x) / n
tendance = slope * days + intercept
rpi : Raspberry Pi 2 Model B Rev 1.1 / Modele : Cortex-A7 armv7l GNU/Linux / Os Name : bullseye
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
Docker/Domoticz/zwave-ui/homebridge/mosquitto/wireguard
Who is online
Users browsing this forum: No registered users and 1 guest