Jump to content

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


  • 0

Jak zrealizować działanie sceny określonych godzinach od 7:00 do 20:30


Mag

Question

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

  • 0

W linku masz scenę w której możesz określić wszystkie parametry jakie potrzebujesz:

Na dole strony jest opis instalacji. Trzeba ręcznie wpisać wszystkie zmienne aby scena poprawnie działała

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Przeglądając kilka programów z forów angielskich udało mi się coś takiego samemu poprawić to co działa i realizuje to co chciałem. Może ktoś będzie potrzebował to zostawiam ślad. Program poniższy realizuje zadanie >> Gdy czujka w godzinach od 19:05 do 23:50 jak czuja wykryje ruch to załącza światło na 10 sekund:

    --[[
    %% autostart
    %% properties
    87 value
    %% weather
    %% events
    %% globals
    --]]

    local startSource = fibaro:getSourceTrigger();
    local time = tonumber(os.date("%H%M"))
    local startTime = tonumber(1905)
    local stopTime = tonumber(2350)
    if (
     ( tonumber(fibaro:getValue(87, "value")) > 0 )
     and   (time >= startTime and time <= stopTime)
        or 
        startSource["type"] == "other"
    )
    then
        fibaro:call(99, "turnOn");
        -- fibaro:call(133, "turnOn");
        setTimeout(function()
            fibaro:call(99, "turnOff");
        -- fibaro:call(133, "turnOff");
        end, 10000)
    end
     

    • Thanks 1
    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

    ×
    ×
    • Create New...