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

Scena blokowa HC3 - pomocy


PatrykN

Question

Witam,

 

Proszę o podpowiedź jak powinna wyglądać scena:

Gdy czujnik ruchu fibaro wykrywa ruch to wall plug fibaro do którego podpięty jest pasek ledowy się włącza i po 30 sekundach od braku ruchu wall plug się wyłącza.

W tej chwili nie wiem dlaczego ale gdy czujnik ruchu wykrywa ruch to wall plug się załącza i jest włączony przez te ustalone 30 sekund ale pasek dosłownie tylko mrugnie ale się nie zapala.  Myślałem, że może coś nie tak z paskiem Led ale gdy podepnę go normalnie do gniazdka to działa bez zarzutu.  Nie znam się na LUA więc zrobiłem to prostą sceną blokową ale niestety nie działa tak jak bym chciał i nie wiem gdzie jest błąd?

Please login or register to see this attachment.

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Nie zrobisz tego sceną blokową.

 

Utwórz scenę LUA, ale ustaw, by scena się nie restartowała

 

Please login or register to see this attachment.

 

W poniższym kodzie zmień tylko numery Motion Sensora oraz Switcha, który uruchamia LEDy oraz czas ile ma się światło świecić.

local motionSensorID = 176
local doubleSwitchID = 194
local durationOfTurnOnSec = 600

Kod działa tak, że jak PIR wykryje ruch to zapala światło na 10 minut i po tym czasie zgaśnie no chyba, ze PIR znowu wykryje ruch, to czas liczy się od nowa, itd.

 

Triger sceny:

 

{
  conditions = { {
      id = 194,
      isTrigger = true,
      operator = "==",
      property = "state",
      type = "device",
      value = true
    }, {
      id = 176,
      isTrigger = true,
      operator = "==",
      property = "value",
      type = "device",
      value = true
    } },
  operator = "any"
}
 

Akcja sceny:

 
local motionSensorID = 176
local doubleSwitchID = 194
local durationOfTurnOnSec = 600
local lightIsOn = false
local sceneStartupTime = os.time()
local scheduledTimeLightOff = sceneStartupTime + durationOfTurnOnSec
 
--print("--- New Instance of the Scene ---")
if fibaro.getValue(doubleSwitchID, "state"then
    lightIsOn = true
    print('The light in Toilet was switch on by Wall Plug at ', os.date("%Y-%m-%d %H:%M:%S", sceneStartupTime), ' and is scheduled to switch off at ', os.date("%Y-%m-%d %H:%M:%S", scheduledTimeLightOff))
elseif fibaro.getValue(motionSensorID, "value"then
    lightIsOn = true
    fibaro.call(doubleSwitchID, 'turnOn')
    print('The light in Toilet was switch on by Motion Sensor at ', os.date("%Y-%m-%d %H:%M:%S", sceneStartupTime), ' and is scheduled to switch off at ', os.date("%Y-%m-%d %H:%M:%S", scheduledTimeLightOff))
else
    print('The light in Toilet was switch on by Unknown Device at ', os.date("%Y-%m-%d %H:%M:%S", sceneStartupTime), ' and is scheduled to switch off at ', os.date("%Y-%m-%d %H:%M:%S", scheduledTimeLightOff))
end
 
if lightIsOn then
    while os.time() < scheduledTimeLightOff do
        --print (scheduledTimeLightOff - os.time(), 'sec to switch off the light')
        fibaro.sleep(1000
 
        -- turn off the scene when the light off by wall plug
        if fibaro.getValue(doubleSwitchID, "state") == false then
            --print('The light was switch off by Wall Plug')
            break
        end
 
        -- extending the light on when motion sensor is still active
        if scheduledTimeLightOff - os.time() <=10 and fibaro.getValue(motionSensorID, "value"then
            scheduledTimeLightOff = scheduledTimeLightOff + durationOfTurnOnSec
            --print('Extended time to additional ', durationOfTurnOnSec, ' sec')
            print('The scheduled switching off the light was recalculated on ', os.date("%Y-%m-%d %H:%M:%S", scheduledTimeLightOff))
        end
    end
 
    fibaro.call(doubleSwitchID, 'turnOff')    
end
--print("--- The end of the Scene ---")
Link to comment
Share on other sites

  • 0
  • Inquirer
  • W dniu 23.10.2022 o 17:45, Tomasz Spaleniak napisał:

    Nie zrobisz tego sceną blokową.

     

    Utwórz scenę LUA, ale ustaw, by scena się nie restartowała

     

    Please login or register to see this attachment.

     

    W poniższym kodzie zmień tylko numery Motion Sensora oraz Switcha, który uruchamia LEDy oraz czas ile ma się światło świecić.

    local motionSensorID = 176
    local doubleSwitchID = 194
    local durationOfTurnOnSec = 600

    Kod działa tak, że jak PIR wykryje ruch to zapala światło na 10 minut i po tym czasie zgaśnie no chyba, ze PIR znowu wykryje ruch, to czas liczy się od nowa, itd.

     

    Triger sceny:

     

    {
      conditions = { {
          id = 194,
          isTrigger = true,
          operator = "==",
          property = "state",
          type = "device",
          value = true
        }, {
          id = 176,
          isTrigger = true,
          operator = "==",
          property = "value",
          type = "device",
          value = true
        } },
      operator = "any"
    }
     

    Akcja sceny:

     
    local motionSensorID = 176
    local doubleSwitchID = 194
    local durationOfTurnOnSec = 600
    local lightIsOn = false
    local sceneStartupTime = os.time()
    local scheduledTimeLightOff = sceneStartupTime + durationOfTurnOnSec
     
    --print("--- New Instance of the Scene ---")
    if fibaro.getValue(doubleSwitchID, "state"then
        lightIsOn = true
        print('The light in Toilet was switch on by Wall Plug at ', os.date("%Y-%m-%d %H:%M:%S", sceneStartupTime), ' and is scheduled to switch off at ', os.date("%Y-%m-%d %H:%M:%S", scheduledTimeLightOff))
    elseif fibaro.getValue(motionSensorID, "value"then
        lightIsOn = true
        fibaro.call(doubleSwitchID, 'turnOn')
        print('The light in Toilet was switch on by Motion Sensor at ', os.date("%Y-%m-%d %H:%M:%S", sceneStartupTime), ' and is scheduled to switch off at ', os.date("%Y-%m-%d %H:%M:%S", scheduledTimeLightOff))
    else
        print('The light in Toilet was switch on by Unknown Device at ', os.date("%Y-%m-%d %H:%M:%S", sceneStartupTime), ' and is scheduled to switch off at ', os.date("%Y-%m-%d %H:%M:%S", scheduledTimeLightOff))
    end
     
    if lightIsOn then
        while os.time() < scheduledTimeLightOff do
            --print (scheduledTimeLightOff - os.time(), 'sec to switch off the light')
            fibaro.sleep(1000
     
            -- turn off the scene when the light off by wall plug
            if fibaro.getValue(doubleSwitchID, "state") == false then
                --print('The light was switch off by Wall Plug')
                break
            end
     
            -- extending the light on when motion sensor is still active
            if scheduledTimeLightOff - os.time() <=10 and fibaro.getValue(motionSensorID, "value"then
                scheduledTimeLightOff = scheduledTimeLightOff + durationOfTurnOnSec
                --print('Extended time to additional ', durationOfTurnOnSec, ' sec')
                print('The scheduled switching off the light was recalculated on ', os.date("%Y-%m-%d %H:%M:%S", scheduledTimeLightOff))
            end
        end
     
        fibaro.call(doubleSwitchID, 'turnOff')    
    end
    --print("--- The end of the Scene ---")

     

     

     

    Bardzo dziękuję za kod. Podstawiłem swoje ID ale niestety nadal jest ten sam problem - pasek LED po wykryciu ruchu dosłownie mrugnie. Tak sobie myślę czy może w parametrach sensora albo wall pluga coś trzeba jeszcze ustawić czy to nie ma znaczenia?

     

     

    Link to comment
    Share on other sites

    • 0

    W takim razie spróbuj podpiąć normalną żarówkę i zobacz czy działa. Jeśli tak to masz problem z LEDem a jak nie to prześle Ci parametry mojego sensora i wall pluga. Daj znać jak wyniki testu

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • W dniu 25.10.2022 o 22:26, Tomasz Spaleniak napisał:

    W takim razie spróbuj podpiąć normalną żarówkę i zobacz czy działa. Jeśli tak to masz problem z LEDem a jak nie to prześle Ci parametry mojego sensora i wall pluga. Daj znać jak wyniki testu

     

    Podpiąłem żarówkę i jest ten sam problem. Tylko mrugnie. Tak więc wina raczej po stronie fibaro. Nie wiem tylko gdzie?

    p.s. Scena tak jak sugerowałeś ustawiona by się nie restartowała.

    Link to comment
    Share on other sites

    • 0

    Pytanie jakie się nasuwa, to jak masz ustawione LEDy/żarówkę - może jako włączanie bistabilne/dzwonkowe? Sprawdź czy jak włączysz z panelu HC3 tą żarówkę/LEDy to też mignie czy świeci ciągle?

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 4 godziny temu, Tomasz Spaleniak napisał:

    Pytanie jakie się nasuwa, to jak masz ustawione LEDy/żarówkę - może jako włączanie bistabilne/dzwonkowe? Sprawdź czy jak włączysz z panelu HC3 tą żarówkę/LEDy to też mignie czy świeci ciągle?

     

    Nie wiem czy dobrze Cię zrozumiałem albo czy dobrze zrozumiałeś mnie:

     

    Pasek LED mam podłączony do Wall Plug'a. Gdy czujnik ruchu wykryje ruch to ma załączyć plug i wtedy pasek się powinien włączyć. No i niby tak jest ale pasek czy coś innego podłączonego do wall plug'a tylko mrugnie i nic więcej

    Edited by PatrykN
    Link to comment
    Share on other sites

    • 0

    Wiec wszystko wskazuje na to ze na Wall Plugu masz ustawione automatyczne wyłączenie po np. połowie sekundy. Przejrzyj jego parametry i odpowiednio je ustaw - efekt ma być taki, ze jak włączysz ręcznie Wall Pluga to światło ma się cały czas świecić do momentu jego ręcznego wyłączenia. Jak już to zrobisz to można się bawić sceną

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • W dniu 28.10.2022 o 23:44, Tomasz Spaleniak napisał:

    Wiec wszystko wskazuje na to ze na Wall Plugu masz ustawione automatyczne wyłączenie po np. połowie sekundy. Przejrzyj jego parametry i odpowiednio je ustaw - efekt ma być taki, ze jak włączysz ręcznie Wall Pluga to światło ma się cały czas świecić do momentu jego ręcznego wyłączenia. Jak już to zrobisz to można się bawić sceną

     

     

    Pobawiłem się trochę ale nic się nie zmieniło. Nie do końca rozumiem wszystkie funkcje parametrów. Na tą chwilę wygląda to tak jak na załączonym zdjęciu. Gdzie może być przyczyna?

     

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

    • 0

    @PatrykN no to masz identyczne ustawienia jak moje. Czy żadna inna scena nie powoduje wyłączenia wall pluga?

    Można też spróbować zrobić miękką rekonfigurację a jak to nie pomoże to usunąć i dodać na nowo.

    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • 1 godzinę temu, coonrado napisał:

    @PatrykN no to masz identyczne ustawienia jak moje. Czy żadna inna scena nie powoduje wyłączenia wall pluga?

    Można też spróbować zrobić miękką rekonfigurację a jak to nie pomoże to usunąć i dodać na nowo.

    Innych scen z Wall Plugiem nie mam. Zastanawiam się jeszcze nad jednym - Wall plug współpracuje w tej scenie z Motion Sensor. Czy jego ustawienia mogą mieć jakiś wpływ na to co się dzieje?

     

    p.s. miękka rekonfiguracja Wall Pluga nie pomogła.

    Edited by PatrykN
    Link to comment
    Share on other sites

    • 0
  • Inquirer
  • W dniu 28.10.2022 o 23:44, Tomasz Spaleniak napisał:

    Wiec wszystko wskazuje na to ze na Wall Plugu masz ustawione automatyczne wyłączenie po np. połowie sekundy. Przejrzyj jego parametry i odpowiednio je ustaw - efekt ma być taki, ze jak włączysz ręcznie Wall Pluga to światło ma się cały czas świecić do momentu jego ręcznego wyłączenia. Jak już to zrobisz to można się bawić sceną

    Niestety nic nie pomogło. Jeszcze jakieś pomysły?

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