Until today i was convinced scene's are triggered by devices or variables i put in the upper section in the LUA script.
I have a scene where i put in some actions when my wife leaves the house.
If her variable change the scene should run.
Her variable is "Ilse" and can be "Away" or "Home".
But i noticed the scene also runs when my variable "Remi" change status Home or Away.
The only variable in the upper section is her's and not mine, so i dont understand why the scene is running when my variable change?
The following variable's are used in the script:
Ilse (Which can be Home or Away
Remi (Which van be Home or Away)
Rollershuttercount (Which can be 0 or 1 and is used as a flag to limit opening automatitaclly the rollershutter to one's a day, and is reset during the night by a "Maintance scene")
--[[
%% properties
%% weather
%% events
%% globals
Ilse
--]]
local date = os.date();
local ct=os.date("%H:%M",os.time())
-- debugging function in color
function logbug(color, message)
for line in message:gmatch("[^\010\013]+") do
local txt = line:gsub("([\038\060\062])",
function(c)
return "&#"..string.byte(c)..";"
end)
fibaro:debug(('<span style="color:%s">%s</span>'):format(color,txt))
end
end
if fibaro:getGlobalValue("Ilse")=="Away" and fibaro:getGlobalValue("Remi")=="Away" and fibaro:getGlobalValue("Rollershuttercount")=="0" and (ct>="07:00" and ct<"14:00")
then
fibaro:debug(date);
fibaro:call(92, "open")
fibaro:setGlobal("Rollershuttercount","1")
setTimeout(function()
fibaro:call(95, "turnOff") --Main lamp
fibaro:call(98, "turnOff") --Spot lamp Remi
fibaro:call(101, "turnOff") --Spot lamp Ilse
fibaro:call(104, "turnOff") -- Walli WCD
end, 22000)
logbug("green", "Rollershutter open and lights off.")
else
if fibaro:getGlobalValue("Ilse") == "Away"
then
fibaro:debug(date);
fibaro:call(95, "turnOff") --Main lamp
fibaro:call(98, "turnOff") --Spot lamp Remi
fibaro:call(101, "turnOff") --Spot lamp Ilse
fibaro:call(104, "turnOff") -- Walli WCD
logbug("green", "Lights off")
end
end
The reason why my variable is in the scene is, because the rollershutter is of our bedroom.
When i have a day off i like to sleep a bit longer and dont want to wake up because the rollershutter goes up automatically when she leaves the house.