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

Way to check if Dimmer S1 is pushed or not


Circumflex_sigma

Question

Hi,

 

I tried to search the forum for 'Dimmer S1' or 'Check S1', but scrolling to all the different threads, didn't let me find what i'm looking for (if it possible in the first place; don't know)

 

What i'm looking for is a way to check if a certain device, in my case a Dimmer, the S1 is pushed or not.

I'm trying to create a LUA scene that uses a motion sensor as a trigger to turn on a dimmer for a certain amount of time, and reset that timer every time there is a movement detected.

But in some cases, i want to push the momentary switch, what is connected to the S1, so that the timer is boosted for a much higher time.

And is the S1 is pushed again (like if i'm leaving the room) the timer is reduced again to a much lesser time, so that when the timer hits 0, the lights are turned off.

 

Now i looks very simple at first hand, and i have an idea how to this, but it falls or stands by the fact i don't know how to check the S1 status; if it is pushed or not.

 

Now i found some other fantastic LUA scenes with VD devices and all, but the code was that massive, i couldn't wrap my mind around it how it works; and i always want to know how the code works :)

 

Thanks in advance guys for looking in to this one.

 

Regards

David

Edited by Circumflex_sigma
Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

You mean detecting if S1 was flicked manually, as opposed to when your script turn on S1 due to the motion sensor being breached?

If so, there is a discussion in the thread below and some pseudo code in the last post how to deal with it 

 

Link to comment
Share on other sites

  • 0
  • Inquirer
  • Well i ended up with a sort of code that is working, i adjusted an scene made by Thomas G Nielsen, and added the hinted psuedo code and some other stuff, like day/night value

     

    Now the only thing is, is that when i press the button, the dimmer turns OFF the light, the scene notices this and turns it back ON and sets the timer to a longer period. (manual ON)

    When pressed again, after meeting the if statement, the light is turned OFF and back ON again (manual OFF) and turns OFF after the 5 seconds.

     

    That OFF->ON behavior when i manually override; is it possible to solve this another way? that when i press the button, the light stays ON, without ON-OFF-ON ?

     

    Thanks again!

     

    Regards,

    David

     

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 0
    On 12/28/2019 at 10:54 PM, Circumflex_sigma said:

    Well i ended up with a sort of code that is working, i adjusted an scene made by Thomas G Nielsen, and added the hinted psuedo code and some other stuff, like day/night value

     

    Now the only thing is, is that when i press the button, the dimmer turns OFF the light, the scene notices this and turns it back ON and sets the timer to a longer period. (manual ON)

    When pressed again, after meeting the if statement, the light is turned OFF and back ON again (manual OFF) and turns OFF after the 5 seconds.

     

    That OFF->ON behavior when i manually override; is it possible to solve this another way? that when i press the button, the light stays ON, without ON-OFF-ON ?

     

    Thanks again!

     

    Regards,

    David

     

     

    Please login or register to see this code.

     

     

    No, because your switch control your lamp it will flicker - no way to stop the (physical) switch from turning off the lamp what I know.

     

    Because you don't need to trigger on the switch you can do without global variables

    Please login or register to see this code.

     

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