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
Mag 1
Próbuję ustawić tak czujkę by po wykryciu ruchu zapalała światło na 10 s. - ten warunek działa bez problemu.
Nie chcę by działała w godzinach od 20:30 do 7:00 - ta część nie jest realizowana bez względu jaki kod dodam za każdym razem zapala na 10s.
Znalazłem rozwiązanie PROGRAM 2 na Froum Fibaro po angielsku, ale też nie pomogło.
Czy ktoś może wie co jest nie tak albo jak zrealizować takie działanie?
PROGRAM 1
--[[
%% autostart
%% properties
87 value
%% weather
%% events
%% globals
--]]
local startSource = fibaro:getSourceTrigger();
if (
( tonumber(fibaro:getValue(87, "value")) > 0 )
and ( (tonumber(os.date("%H%M")) >= tonumber(string.format("%02d%02d", "20", "30")) or
tonumber(os.date("%H%M")) <= tonumber(string.format("%02d%02d", "07", "00"))))
or
startSource["type"] == "other"
)
then
fibaro:call(99, "turnOn");
setTimeout(function()
fibaro:call(99, "turnOff");
end, 10000)
end
PROGRAM 2:
--[[
%% autostart
%% properties
87 value
%% weather
%% events
%% globals
--]]
local startSource = fibaro:getSourceTrigger();
local time = tonumber(os.date("%H%M"))
local startTime = 0600
local stopTime = 2000
if (
( tonumber(fibaro:getValue(87, "value")) > 0 )
and (time >= startTime and time <= stopTime)
or
startSource["type"] == "other"
)
then
fibaro:call(99, "turnOn");
setTimeout(function()
fibaro:call(99, "turnOff");
end, 10000)
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.