setpoint +

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

Moderator: leecollings

Post Reply
User avatar
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

setpoint +

Post by jacobsentertainment »

Hi all,

I'm trying in a script to change the setpoint but not getting what I'm expecting. I have a script running for my stove and if the temperature reaches 89° I want to dump some heat in one of the radiators in my house by increasing the temperature.

Code: Select all

       elseif
           Temp_Hal >= 89 then 
              Hal_setpoint.updateSetPoint(20)
Currently I'm using this and when the temperature is below 89° then the script sets it back to 13° the issue is that this script runs every minute and updates also this temperature. My idea was to use a script like

Code: Select all

       elseif
           Temp_H >= 89 then 
              Hal_setpoint.updateSetPoint(+ 8)
So it increases current setpoint with 8° and when done it lowers it with 8°

But it seems DzVents does not allow me to use the + to add some to the setpoint. Is there a other way to do this? How can I store current setpoint value and then later use this again? Can some point me to a good topic where i can find some info on storing a setpoint value?
User avatar
waltervl
Posts: 6691
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2025.1
Location: NL
Contact:

Re: setpoint +

Post by waltervl »

You first have to read the setpoint
So something like

Hal_setpoint.updateSetPoint(Hal_setpoint.setPoint+ 8)
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
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

Re: setpoint +

Post by jacobsentertainment »

Thanks ill give this a try tonight see if I can make this work.
User avatar
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

Re: setpoint +

Post by jacobsentertainment »

Well nice try this won't work :lol:
Spoiler: show
return {

active = true,

on = {
devices = {18,
},
timer = {
'every 1 minute'
},
},

logging = {
level = domoticz.LOG_INFO,
marker = "setpoint test"
},

execute = function(domoticz, device)

local Setpoint_l = domoticz.devices(206) --logeerkamer setpoint
local systeem_temp = domoticz.devices(18)
local temp_s = systeem_temp.temperature

if
temp_s >= 60 then
Setpoint_l.updateSetPoint(Setpoint_l.setPoint+ 8)
elseif
temp_s <= 60 then
Setpoint_l.updateSetPoint(Setpoint_l.setPoint- 8)

end
end
}
This is not working as planned, now if the temperature is below an value it will constantly lower the setpoint as the script is triggered, I could have known this before, so back to the drawingboard :roll:
User avatar
madpatrick
Posts: 761
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: setpoint +

Post by madpatrick »

Try something like this

Code: Select all

local new_setpoint = Hal_setpoint.updateSetPoint +8

       elseif
           Temp_H >= 89 then 
Hal_setpoint.updateSetPoint(new_setpoint)
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
User avatar
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

Re: setpoint +

Post by jacobsentertainment »

madpatrick wrote: Monday 04 April 2022 20:08 Try something like this

Code: Select all

local new_setpoint = Hal_setpoint.updateSetPoint +8

       elseif
           Temp_H >= 89 then 
Hal_setpoint.updateSetPoint(new_setpoint)
Tried it in a script for the "logeerkamer" and doesn't work

Code: Select all

Logeerkamer: ...z/scripts/dzVents/generated_scripts/Logeerkamer temp.lua:22: attempt to perform arithmetic on a function value (field 'updateSetPoint')
anyway, what I think won't work is that I simply create a trigger to add a couple of degrees and after that the temperature dropped I want to subtract that same amount, but if I do it like mentioned above everytime that trigger will subtract another 8° from the last setpoint. That way I will end up whit a setpoint way below me desired setpoint.
I think that I need a way to store current setpoint and when the temperature is back to normal it sets this value back and the script stops till the temperature is to high again and does the same trick. :roll:
User avatar
madpatrick
Posts: 761
Joined: Monday 26 December 2016 12:17
Target OS: Linux
Domoticz version: 2025.2
Location: Netherlands
Contact:

Re: setpoint +

Post by madpatrick »

Checkout this post.

viewtopic.php?p=257729#p257729

Within this script the setpoint is stored and the recalled again
Maybe it helps
-= HP server GEN11 =- ZwaveJS-=- Domoticz v2025.2 -=- Dashticz =-
-= Checkout https://github.com/MadPatrick for the plugins =-
User avatar
jacobsentertainment
Posts: 223
Joined: Thursday 01 October 2020 1:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021-1
Location: Not @ home
Contact:

Re: setpoint +

Post by jacobsentertainment »

That's indeed a nice topic to study and test.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest