smoothing values

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
har0543
Posts: 18
Joined: Wednesday 06 January 2016 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Dalfsen netherlands
Contact:

smoothing values

Post by har0543 »

Hi,
I am completly new to DZVents so perhaps I ask something that is asked before.
I have a electric boiler that has to start when the solar panels produce enough power.
With a Blocky this works. But when there is only for 1 minute enough sunshine the boiler is switched on.
So I am looking for an option to use a moving average.
I see in DzVents the option smoothItem.

Could somebody show how this is done? I get mixed up by all the options in DzVents...

thanks in advance,

Har
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: smoothing values

Post by waltervl »

You have to use history=true. See the examples for this in the documentation on persistent data.
See for example viewtopic.php?p=144660
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
har0543
Posts: 18
Joined: Wednesday 06 January 2016 11:34
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Dalfsen netherlands
Contact:

Re: smoothing values

Post by har0543 »

Thank you for your reply. But I can not see the trees in the forest...
I am sorry but the history=true function does not make sense to me. But I have zero programming knowlage.
I have an divice called "teruglevering" which gives values in Watts.
Do i first have to make some kind off extra logging with 10 values and another script that calcutales a new divice called pa "smoothed terugleveering"

Is there a book or site in dutch that explense LUA and or DzVents?
Hope somebody can help me here
User avatar
waltervl
Posts: 5149
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: smoothing values

Post by waltervl »

Here you have an example of a script using the same functionally, only using .avg() instead of smootItem().
viewtopic.php?p=288575
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests