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


Fibaro switches contact state


jack.daniels

Recommended Posts

Hi,

Is it possible to read fibaro switch's contact position S1/S2 in lua scene?

This would be cool for more smart automation.

Thanks in advance

Link to comment
Share on other sites

You mean if it is turned on or off?

Easy. 67 and 68 are the IDs on the switch - change to what switch you want to use:

 

Contact1 = fibaro:getValue(67, "value")

Contact2 = fibaro:getValue(68, "value")

 

If Contact1 == "1" then

     fibaro:debug("Contact 1 is on")

else

    fibaro:debug("Contact 1 is off")

end

 

If Contact2 == "1" then

     fibaro:debug("Contact 2 is on")

else

    fibaro:debug("Contact 2 is off")

end

Edited by Thomasn
Link to comment
Share on other sites

  • Topic Author
  • 4 minutes ago, Thomasn said:

    You mean if it is turned on or off?

    I mean, the physical switch state. Is it open or closed.

    Value property is different. It tells the load status, on/off

    Link to comment
    Share on other sites

    12 hours ago, jack.daniels said:

    Is it possible to read fibaro switch's contact position S1/S2 in lua scene?

    This would be cool for more smart automation.

     

    You mean to get the status of S1 and/or S2 is actual energised by a switch?

     

    Not that I that I know of. The only way to get the state is by 'synchronise' it with the load. Meaning, if S1 == energised then relais 1 (R1) = on.

     

    This could/should be done by setting parameter 13/14 of a Fibaro FGS-221 (double relais switch) for example:

    Parameter 13: State Change (ON / OFF) for toggle switch (Parameter no.14). Default Setting: key position change = ON or OFF

    1 - ON = switch contacts connected / OFF = switch contacts disconnected

    Parameter 14: Switch Type - momentary or toggle

    0 - Momentary Switch

     

    I don't know if template settings can be separated  by device or by ID. Meaning, if parameters can be different by S1-R1 and S2-R2. If so, you could set S2-R2 as actual status detection by bridging the (hardware) circuit connections S1-S2 connected coming from the switch.

     

    Then you can use R1 to connect the light and do not connect anything on R2 (= just for status detection in HC2).

     

    I didn't try this, it's just a thought I had..... ;)

    Edited by Lambik
    Added 'R2 (= just for status detection in HC2)'
    Link to comment
    Share on other sites

    The closest you can get is by using centralSceneEvent (FGS-2x2 and FGS-2x3).

     

    If someone holds the button, you'll get "HeldDown" and as long as it is held nothing happens. When it's released, you get "Released", no surprise there... You'll also have to handle the other events, depending on the parameters. For FGs-2x3 see parameter 28 and 29:

     

    1 - Key pressed 1 time
    2 - Key pressed 2 times
    4 - Key pressed 3 times
    8 - Key Hold Down and Key Released

     

    But there is no way to separate the relay action from the switch status. In fact, as far as I know, there is no AC relay on the market with independent inputs.

    Link to comment
    Share on other sites

  • Topic Author
  • Yes, this is why i have started the thread

    Would be convinient to know, the contacts state. Lets say we setting up autologhts. One grope in a room which on/off by some sensor. And when it should be always on, i just press a switch on. The scene will not switch off the lght when contacts are closed (linked)

    As for now i dont know how the relay was enabled, by s1/s2, or by assciation or by other scene

    Link to comment
    Share on other sites

    • 3 years later...

    I am using the idea with scenes described by petergebreuers and it works fine.

     

    My case:

    I have a window lamp controlled by a Dimmer 2. I have a few scenes that control this dimmer over the course of the week but sometimes I want to disable these scenes and just allow manual operation of the lamp. For this purpose, I am using S2 to indicate "Automatic" versus "Manual" mode.

    S1 is connected to a momentary switch and controls normal dimmer operation.

    S2 is connected to a toggle switch where OFF shall  mean "Automatic" and On shall mean "Manual" mode.

     

    Parameter 20 is set to "0 - Momentary switch"

    Parameter 28 (Scene activation) is set to "1 - Functionality is activated". This sends scene id 22 if S2 is ON (hold) and 23 when S2 is OFF (release)

     

    The following scene captures that S2 goes from OFF to ON, which means that mode is set to "Manual" (954 is the device ID, hence my choice of variable name)

    Please login or register to see this image.

    /monthly_2021_01/Set_to_manual_mode.PNG.8e2189eac59ce957c4153f2b8910643a.PNG" />

     

    The following scene captures that S2 goes from ON to OFF, which means that mode is set to "Automatic"

    Set_to_automatic_mode.PNG.6ff97c9261f87d80aba9fe375ba29202.PNG

     

    An example scene making use of the mode button. 

    The lamp is switched on when evening falls, but only if mode is "Automatic"

    Sample_scene.PNG.ea1a20eecb36a6cac3a0ee0200b14a70.PNG

     

    I am using this concept in our bedrooms, allowing  members of the family to easily choose if their window lamp should be controlled by the system or only by the wall switch. It eliminates the need for me to go in and change the programming as soon as they change their minds about how "automatic" their room should be. Now they can decide for themselves by flicking the switch.

     

     

     

     

     

    • Like 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
    Reply to this topic...

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