Part of my script:
and the log of the switchif(timehour_n == 09 and timemin_n == 30 and IsWeekend()=='True') then
if(bedPosition==0) then
commandArray['Bed Blinds']='Set Level 30'
end
if(livingPosition==0) then
commandArray['Livingroom Blinds']='On'
end
end
So blinds were closed at 18:36 on the 11/02. At 9:30 (as per script), they were set to 30% but we see 3 lines for this action(1. set to 30%, 2. set to off (previous state), 3. set to 30% (again)). Same happens at 10:20 where it sets to "on", we see 1. On, 2. set to 30% (previous state), 3. set to on.2017-02-12 10:20:16 On
2017-02-12 10:20:01 Set Level: 30 %
2017-02-12 10:20:01 On
2017-02-12 09:30:08 Set Level: 30 %
2017-02-12 09:30:01 Off
2017-02-12 09:30:01 Set Level: 30 %
2017-02-11 18:36:20 Off
here is the full script for reference
Running V3.6635 (latest corbin release)function IsWeekend()
local dayNow = tonumber(os.date("%w"))
local weekend
if (dayNow == 0) or (dayNow == 6) then weekend = "True"
else weekend = "False"
end
return weekend
end
local timehour = os.date("%H")
local timehour_n = tonumber(timehour)
local timemin = os.date("%M")
local timemin_n = tonumber(timemin)
local bedPosition = tonumber(otherdevices_svalues['Bed Blinds'])
local livingPosition = tonumber(otherdevices_svalues['Livingroom Blinds'])
commandArray = {}
if(timehour_n == 08 and timemin_n == 10 and IsWeekend()=='False') then
if(bedPosition==0) then
commandArray['Bed Blinds']='Set Level 30'
end
if(livingPosition==0) then
commandArray['Livingroom Blinds']='On'
end
end
if(timehour_n == 09 and timemin_n == 00 and IsWeekend()=='False'and bedPosition>0 and bedPosition<95) then
commandArray['Bed Blinds']='On'
end
if(timehour_n == 09 and timemin_n == 30 and IsWeekend()=='True') then
if(bedPosition==0) then
commandArray['Bed Blinds']='Set Level 30'
end
if(livingPosition==0) then
commandArray['Livingroom Blinds']='On'
end
end
if(timehour_n == 10 and timemin_n == 20 and IsWeekend()=='True'and bedPosition>0 and bedPosition<95) then
commandArray['Bed Blinds']='On'
end
return commandArray