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

sceny o wyznaczonej godzinie


wojtas810

Question

Witam 

 

Mam do was pytanie zrobiłem dwie sceny oparte na bloczkach 

1. włącza alarm o 23.59

2. wyłącza alarm o 7.00

- ustawione są tylko kontaktrony na wejscie drzwi i na taras

 

Problem polega na tym ze scena działała dwa dni i w trzecim ani się nie włączyła ani tym bardziej wyłącza

jest ustawione w bloczku że ma się włączać codziennie. 

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0
Guest damian

Skonwertuj do lua i sam zobacz dlaczego.

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

Skrypty sprawdzają co 60 sekund czy jużjesttapora. Jednak wykonanie warunku też zajmuje czas, przez co faktycznie sprawdzają co 60+kilka sekund. Co to daje? Ano to, że jak sprawdzi o 23:58'59 i następny raz o 00:00'01 to nie uzbroi alarmu.

Please login or register to see this image.

/emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" />

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Ale lipa nawet nie wiedziałem ze tak jest - dzięki za info - jak przyjade do domu to skonwertuje i wrzucę będę liczył na pomoc w ulepszeniu

    Please login or register to see this image.

    /emoticons/default_smile.png" alt=":)" srcset="https://forum.fibaro.com/uploads/emoticons/[email protected] 2x" width="20" height="20" /> 

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • Dobra tak wyglada kod w LUA co można było by wtedy zmienić poprawić ?

    --[[
    %% autostart
    %% properties
    %% globals
    --]]
     
    local sourceTrigger = fibaro:getSourceTrigger();
    function tempFunc()
    local currentDate = os.date("*t");
    local startSource = fibaro:getSourceTrigger();
    if (
     ( ((currentDate.wday == 1 or currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6 or currentDate.wday == 7) and string.format("%02d", currentDate.hour) .. ":" .. string.format("%02d", currentDate.min) == "23:59") )
    )
    then
    fibaro:call(7, "setArmed", "1");
    fibaro:call(5, "setArmed", "1");
    end
     
    setTimeout(tempFunc, 60*1000)
    end
    if (sourceTrigger["type"] == "autostart") then
    tempFunc()
    else
     
    local currentDate = os.date("*t");
    local startSource = fibaro:getSourceTrigger();
    if (
    startSource["type"] == "other"
    )
    then
    fibaro:call(7, "setArmed", "1");
    fibaro:call(5, "setArmed", "1");
    end
     
    end
    Link to comment
    Share on other sites

    • 0

    Poza tym jest jeszcze taki parametr w scenie:

    "Chroń scenę przed wyłączeniem podczas alarmu".

     

    Należy go zaznaczyć. W przeciwnym wypadku przy pierwszym naruszeniu alarmu scena wyłącza się i już nie sprawdza siebie co 60 s.

    Link to comment
    Share on other sites

    • 0
    Guest damian

    Ejno, generalnie ta scena to pomyłka a tworzenie kodu z konwersji z bloków może służyć wyłącznie celom edukacyjnym.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • A to jesteście mi w stanie pomóc w napisaniu tak aby ta scena zawsze działała nie zależnie czy włączy się alarm czy też nie ?

    Link to comment
    Share on other sites

    • 0

    Tak jak napisaliśmy:

    1. W ustawieniach sceny zaznacz parametr "Chroń scenę przed wyłączeniem podczas alarmu"

    2. W kodzie sceny zmień wartość 60*1000 na np. 55*1000

    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...