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

Code for flashing lights?


Guest David R

Question

Guest David R
Posted

I have an alarm scene that turns all the house lights on when the security alarm is breached. What i would like to do is have the outside lights flashing on and off. Does anybody know the LUA code to do this? Thanks!

12 answers to this question

Recommended Posts

  • 0
Posted

Make a scene that will turn them on and of in a while loop, checking for some device "armed" state as an exit condition.

  • 0
Guest David R
  • Inquirer
  • Posted

    Thanks could you show my a little example of this? Just unsure about the loop

    • 0
    Posted

    Please login or register to see this code.

    This scene should be added as an action to alarm panel and activated. It will toggle chosen light and stop when some sensors get disarmed, eg. when turning off alarm.

    • 0
    Guest David R
  • Inquirer
  • Posted

    Thanks. I dont use Fibaro alarm to activate. I use an ubs integrated to my house alarm that sets off the lights when the house alarm is breached. is this still possible?

    • 0
    Posted

    Sure, just add proper triggering condition.

    • 0
    Guest David R
  • Inquirer
  • Posted

    Please login or register to see this code.

    This scene should be added as an action to alarm panel and activated. It will toggle chosen light and stop when some sensors get disarmed, eg. when turning off alarm.

    How do I add more lights to the scene? So what I want to do is is alarm breached (=>0) yes?

    Then fibaro push to my phone....loop the lights as above..then when alarm is safe...fibaro:call turn on lights where needed? Thanks

    • 0
    Posted

    If you want to trigger scene by value (not armed or breached state) of some sensor (XX) stands for its ID do it like this:

    --[[

    %% properties

    XX value

    %% globals

    --]]

    sensorID =

    lightID1 =

    lightID2 =

    lightID3 =

    delay = --in ms

    while tonumber(fibaro:getValue(sensorID, "value")) == 1 do

    fibaro:call(lightID1, "turnOn")

    fibaro:call(lightID2, "turnOn")

    fibaro:call(lightID3, "turnOn")

    fibaro:sleep(delay)

    fibaro:call(lightID1, "turnOff")

    fibaro:call(lightID2, "turnOff")

    fibaro:call(lightID3, "turnOff")

    fibaro:sleep(delay)

    end

    • 0
    Guest David R
  • Inquirer
  • Posted
    If you want to trigger scene by value (not armed or breached state) of some sensor (XX) stands for its ID do it like this:

    --[[

    %% properties

    XX value

    %% globals

    --]]

    sensorID =

    lightID1 =

    lightID2 =

    lightID3 =

    delay = --in ms

    while tonumber(fibaro:getValue(sensorID, "value")) == 1 do

    fibaro:call(lightID1, "turnOn")

    fibaro:call(lightID2, "turnOn")

    fibaro:call(lightID3, "turnOn")

    fibaro:sleep(delay)

    fibaro:call(lightID1, "turnOff")

    fibaro:call(lightID2, "turnOff")

    fibaro:call(lightID3, "turnOff")

    fibaro:sleep(delay)

    end

    Okay so I made an alarm in the alarm panel using "emergency lights" this works great apart from when the alarm is reset all the lights stop flashing and turn off. Is there a way to make them stay on rather than turn off and send the house into complete dark. Thanks

    • 0
    Posted

    David R, so you used predefined scene in Alarm Panel after all or used my scene? Sorry, but I do not follow.

    • 0
    Guest David R
  • Inquirer
  • Posted

    I used a predefined scene in the end. I didn't know it was possible. I hadn't used the alarm panel before. So what im saying is in predefined "emergency lights" when the pin is entered and the scence ends. Sometimes the lights stay on sometimes they all turn off. Turning off is not good if its the night!!

    • 0
    Posted

    David R, we can not modify predefined scenes, so you need to make some work-around, like using scene i gave you previously for checking some device armed state in a loop, after exiting loop turn on some lights. It should be added to Alarm Panel to be triggered along with alarm breach.

    • 0
    Posted

    David R- i'm not into code, so thank's for the code

    Is it a code to add so the blinking stops, say after 10 min or so

    Please login or register to see this image.

    /emoticons/default_icon_question.gif" alt=":?:" />

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