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

Lights on with different switches


Question

Posted (edited)

I have on my bedroom 

 

Light 1 with single switch 1 and wallswitch 1

Light 2 with single switch 2 and wallswitch 2

Single switch 3 with wallswitch 3

 

 

I want if i push wallswitch 3 lights  1 en 2 on or off. But if i use wallswitch 1 Light 1 on or off and if i push wallswitch 2 Light 2 on or off.

Lights 1 and 2 are the lights left and right next to the bed the same als switch 1 and 2. The wallswitch 3 is next to the door. 

Edited by Reinhold

4 answers to this question

Recommended Posts

  • 0
Posted (edited)

@Reinhold I had to read it more than once ?

 

I think you want to toggle the lights, but what if light 1 is on and light two is off. Switch 3 will toggle light 1 off and light 2 on ?

 

It sound more like you want to switch both lights off with switch 3 if one of the lights is on?

 

And you want to switch both lights on with switch 3 if both of the lights are off? 
 

?

Edited by SmartHomeEddy
  • 0
  • Inquirer
  • Posted (edited)

    Yes i want to toggle the lights. And if light 1 is on en light 2 is off then if i use switch 3 then both light must off.

     

    --[[
    %% properties
    310 value
    %% weather
    %% events
    %% globals
    --]]



    if (fibaro:countScenes()>1) then fibaro:abort()
    fibaro:debug("2de scene word gestopt")
    end
    --------------------------------------------------------------

    local startSource = fibaro:getSourceTrigger()
    local switch3= 310 -- single switch 
    local light1 = 168 -- single switch
    local light2= 105 -- single switch 

    if tonumber(fibaro:getValue(switch3, "value")) >= 0 then
      if tonumber(fibaro:getValue(light1, "value")) == 0
        and
         tonumber(fibaro:getValue(light2, "value")) == 0 then
        fibaro:call(light1, "turnOn")
          fibaro:call(light2, "turnOn")
       else
        fibaro:call(light1, "turnOff")
          fibaro:call(light2, "turnOff")
        
       end
      end

    Edited by Reinhold
    • 0
    Posted

    looks like this should work, does it?

    • 0
  • Inquirer
  • Posted (edited)

    This works, but if i turn off light 1 with switch 1 and i toggle then switch 3 the light 1 turn on and 2 goes off.

    Edited by Reinhold

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