Someone gave me this a long time ago, and I am still grateful.
I created a scene with a schedule to run every 60 minutes. You will find good and bad in how high or low you set that time.
Then in the luup code add the following. You will need to change the device code (30 in this example) to the device code of your ct100. the temperatures separated by commas start with sunday. the times are seconds, so you might have to calculate based upon the standard clock time that you want. so every 60 minutes this scene gets executed and the temperature for that time range is sent to the setpoint of your thermostat. the downside is that if you manually override your setpoint, then sometime in the next 60 minutes it will get reset to your schedule. for vacation, I disable this scene, put the thermostat on hold temp, and turn it to an energy friendly number.
I wish I could give credit to the person that gave me this, but I haven’t been able to find it again in the forum.
local temps_Heat = { {64, 64, 64, 64, 64, 64, 64, startTime=3600}, – 1:00AM
{65, 68, 68, 68, 68, 68, 65, startTime=23400}, – 6:30AM
{65, 65, 65, 65, 65, 65, 65, startTime=32400}, – 9:00AM
{65, 65, 65, 65, 65, 65, 65, startTime=46800}, – 1:00PM
{65, 66, 66, 66, 66, 66, 65, startTime=59400}, – 4:30PM
{65, 65, 65, 65, 65, 65, 65, startTime=82800} – 11:00PM
}
local temps_Cool = { {75, 75, 75, 75, 75, 75, 75, startTime=3600}, – 1:00AM
{74, 74, 74, 74, 74, 74, 74, startTime=23400}, – 6:30AM
{74, 74, 74, 74, 74, 74, 74, startTime=28800}, – 8:00AM
{76, 76, 76, 76, 76, 76, 76, startTime=46800}, – 1:00PM
{74, 74, 74, 74, 74, 74, 74, startTime=63000}, – 5:00PM
{76, 76, 76, 76, 76, 76, 76, startTime=79200} – 10:00PM
}
local thermostatDeviceNumber = 30
local t = os.date(‘*t’)
local current_second = t.hour * 3600 + t.min * 60 + t.sec
local current_day = t.wday
function applyTemp( serviceId, tempsTable )
for i,temps in ipairs(tempsTable) do
local startTime = temps.startTime
local endTime = current_second + (3600 * 24)
if (tempsTable[i+1]) then
endTime = tempsTable[i+1].startTime
end
if (endTime > current_second) then
if (startTime <= current_second) then
luup.log("Settint " .. serviceId .. " temp to " .. temps[current_day])
luup.call_action(serviceId, "SetCurrentSetpoint", {NewCurrentSetpoint = temps[current_day]}, thermostatDeviceNumber)
end
end
end
end
applyTemp( “urn:upnp-org:serviceId:TemperatureSetpoint1_Heat”, temps_Heat )
applyTemp( “urn:upnp-org:serviceId:TemperatureSetpoint1_Cool”, temps_Cool )
return true