Welcome to Smart Home Forum by FIBARO
Dear Guest,
as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.
As a member you can:
- Start new topics and reply to others
- Follow topics and users to get email updates
- Get your own profile page and make new friends
- Send personal messages
- ... and learn a lot about our system!
Regards,
Smart Home Forum by FIBARO Team
Question
HansAvlund 0
Hello!
Probably very stupid question. But... Cant seem to find out how to get this sceene to autorun. Have done a bit of searching in the forum, but cant seem to find anything that works? atleast I cant get it to work.
This sceene controlls blinds. Their posision and their angulation.
I use
scene run : Automatic.
Max running instances : 5
I used while true do function and a delay. But it does not seem like the best way to implement this...
I also tested local selfrun, and local refresh. But did not seem to work
Any idea how to make this sceene run one every 2 minutes or something?
Thanks!
the code:
--[[
%%autostart
%% properties
%% events
%% globals
--]]
--[[
ID:
1267 = Persienne kalle
1264 = Trappegang/ arkiv
1261 = Spiserom Ø-Side H
1255 = Spiserom Ø-Side V
1227 = Nytt møterom
]]--
-- While true do brukes for att denne scenen skal kjøre hele tiden.
local selfRun = true
local refresh = 120
h = tonumber((os.date('%H%M')))
posisjon = tonumber (fibaro:getValue(1261, "value"))
vinkling = tonumber (fibaro:getValue(1261, "value2"))
Lux = tonumber (fibaro:getValue(1272, "value"))
Tidned = 630
Tidopp = 1800
-- Kjøres når persienne skal opp for natten. Mellom 1800 og 0630
if ( h > Tidopp or h < Tidned) and (posisjon < 10) then
fibaro:call(1267, "open")
fibaro:call(1264, "open")
fibaro:call(1255, "open")
fibaro:call(1261, "open")
fibaro:call(1227, "open")
end
-- Kjører hvis kl er mellom 0630 og 1800 og Lux verdien er mellom 1200 og 20 000, solskjemingen må være opp fra før for att denne kommandoen skal kjøre.
if (h > Tidned and h < Tidopp) and (Lux > 1200 and Lux < 20000) and (posisjon > 90)then
fibaro:call(1267, "close")
fibaro:call(1267, "setValue2", "60")
fibaro:call(1264, "close")
fibaro:call(1264, "setValue2", "60")
fibaro:call(1255, "close")
fibaro:call(1255, "setValue2", "60")
fibaro:call(1261, "close")
fibaro:call(1261, "setValue2", "60")
fibaro:call(1227, "close")
fibaro:call(1227, "setValue2", "60")
end
-- Kjører hvis Lux verdien er undere 20 000 og solskjemingen er nede og vinkelen ikke er satt til 60 fra før
if(Lux < 20000) and (posisjon < 10) and (vinkling ~= 60) then
fibaro:call(1267, "setValue2", "60")
fibaro:call(1264, "setValue2", "60")
fibaro:call(1255, "setValue2", "60")
fibaro:call(1261, "setValue2", "60")
fibaro:call(1227, "setValue2", "60")
end
-- Kjører hvis Lux verdien er over 20 000 og solskjemingen er nede og vinklingen ikke er satt til 35 fra før.
if(Lux > 20000) and (posisjon < 10) and (vinkling ~= 35) then
fibaro:call(1267, "setValue2", "35")
fibaro:call(1264, "setValue2", "35")
fibaro:call(1255, "setValue2", "35")
fibaro:call(1261, "setValue2", "35")
fibaro:call(1227, "setValue2", "35")
end
-- Scene som kjører hvis det er veldig skart ute og solskjermingen ikke er tatt ned.
if (h >= Tidned and h <= Tidopp) and (Lux > 20000) and (posisjon < 90) then
fibaro:call(1267, "close")
fibaro:call(1267, "setValue2", "35")
fibaro:call(1264, "close")
fibaro:call(1264, "setValue2", "35")
fibaro:call(1255, "close")
fibaro:call(1255, "setValue2", "35")
fibaro:call(1261, "close")
fibaro:call(1261, "setValue2", "35")
fibaro:call(1227, "close")
fibaro:call(1227, "setValue2", "35")
end
-- tar en pause på 1min før den looper tilbake på starten.
end
Link to comment
Share on other sites
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.