I have a 2gig CT100 that I was sad to see wasn’t easily programmable anymore when I switched to the Vera Lite.
So I hacked up a simple table-driven scheduler. It sets both heating and cooling temps, but not the mode. So you can set it up for summer and winter and switch just by pressing the mode button on the thermostat itself.
To configure it, set thermostatDeviceNumber to match your thermostat, and then configure the temperatures with as many rows in the heating and cooling tables you’d like. Each row has a temp for each day of the week, and a start time (in seconds since midnight). The end time for any given period is the start of the next period, or midnight.
To use it, create a scene that triggers every few minutes, and paste in the following LUA:
[code]local temps_Heat = { {65, 65, 65, 65, 65, 65, 65, startTime=3600}, – 1:00AM
{67, 68, 68, 68, 68, 68, 68, startTime=27000}, – 7:30AM
{68, 65, 65, 65, 65, 65, 68, startTime=32400}, – 9:00AM
{68, 65, 65, 65, 65, 65, 68, startTime=46800}, – 1:00PM
{68, 68, 68, 68, 68, 68, 68, startTime=59400}, – 4:30PM
{67, 67, 67, 67, 67, 67, 67, startTime=82800} – 11:00PM
}
local temps_Cool = { {74, 74, 74, 74, 74, 74, 74, startTime=3600}, – 1:00AM
{71, 71, 71, 71, 71, 71, 71, startTime=27000}, – 7:30AM
{71, 78, 78, 78, 78, 78, 71, startTime=32400}, – 9:00AM
{71, 78, 78, 78, 78, 78, 71, startTime=46800}, – 1:00PM
{71, 71, 71, 71, 71, 71, 71, startTime=59400}, – 4:30PM
{74, 74, 74, 74, 74, 74, 74, startTime=82800} – 11:00PM
}
local thermostatDeviceNumber = 18
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[/code]