Set Thermostat Setpoint when adding a Schedule(timer)

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

Moderator: leecollings

Post Reply
johnrwoods
Posts: 10
Joined: Thursday 12 December 2019 11:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: UK
Contact:

Set Thermostat Setpoint when adding a Schedule(timer)

Post by johnrwoods »

I would like to add a new schedule(timer) with a specific setpoint to a Thermostat using dzVents.

In dzVents I am calling the json api using the addtimer parameter but cannot see an option in the parameters that would allow me to set the setpoint.
In the UI to add a Timer to a Thermostat there is a field to add a "Value" which then appears as "Temperature, {value}" in the Command column in the list of timers:
Capture.PNG
Capture.PNG (16.27 KiB) Viewed 681 times

This is the code I would like to use (the idx is the deviceId of the Thermostat):

Code: Select all

local function addSchedule(domoticz, idx, command, hour, minute, days)
    local jsonString  = "/json.htm?type=command" ..
    			 "&param=addtimer" ..
                         "&idx=" .. idx ..
                         "&active=true" ..
                         "&timertype=" ..
                         "&hour=" .. hour .. 
                         "&min=" .. minute .. 
                         "&randomness=false" ..
                         "&command=" .. command ..
                         "&days=" .. days 
    domoticz.openURL( domoticz.settings["Domoticz url"] .. jsonString )
end
Can anyone help me with this?
Thanks in advance
User avatar
waltervl
Posts: 5792
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Set Thermostat Setpoint when adding a Schedule(timer)

Post by waltervl »

Sorry, I do not know the answer.
But thinking the other way, why not using the dzVents script as a timer? I suppose that is what dzVents is basically designed for.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
johnrwoods
Posts: 10
Joined: Thursday 12 December 2019 11:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: UK
Contact:

Re: Set Thermostat Setpoint when adding a Schedule(timer)

Post by johnrwoods »

I had considered this but I think it would be rather messy for my particular scenario.

I have 20+ thermostats which need to have different temperature settings throughout the day and each of them is on a different schedule.

I guess that if the API cannot handle the setting of the Setpoint for a Thermostat timer then I will have no option but to set it up in dzVents.

Thanks for your help.

As an aside, how do I view the source code that handles the API call to add a Thermostat timer? I would be interested in looking at that.
User avatar
waltervl
Posts: 5792
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Set Thermostat Setpoint when adding a Schedule(timer)

Post by waltervl »

Some of the code can be found here: https://github.com/domoticz/domoticz/tr ... app/timers
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
rrozema
Posts: 470
Joined: Thursday 26 October 2017 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Delft
Contact:

Re: Set Thermostat Setpoint when adding a Schedule(timer)

Post by rrozema »

I think there is an additional reason why your plan of using timers for the thermostat will not work: the timer will fire when the time set for this timer is reached and this is when the setpoint on that timer will be used to set the setpoint on the thermostat. If you change the setpoint on that timer after the time is reached, the thermostat will not be changed with it to the new setpoint. In other words, the setpoint on the thermostat will not change until the next timer is reached.

You can test this for yourself easily: put a timer on one of your thermostats with a time before the current time, the change the setpoint on this timer. For your plan to work, the thermostat should change it's setpoint with the timer's setpoint, but it doesn't do so. It's a timer, not a heating plan.
Post Reply

Who is online

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