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


Question

Posted

I want to be able to either :

  • send a http request when a switch is pushed - in order to send a command to a GCE IPX800 relay

or

  • 'push'a virtual device to send the request when a switch is pushed.

I can send a LUA command to the IPX800 and it works.

I did not find how to do the same when a switch is pushed.

I need to do that because the switches are not directly connect to the lights, ...

 

Thanks a lot for your help.

Pierre

6 answers to this question

Recommended Posts

  • 0
Posted

the LUA scene you used can be triggered from a switch.

under the %%properties at the top of the scene just add the ID of the switch and the word 'value'

eg switch ID is 22

 

--[[

%%properties

22 value

%%events

%%globals

]]

 

hope this helps

 

  • 0
  • Inquirer
  • Posted

    I do not use a scene.

    I've 56 switches.

    I don't think it is possible to use so much scenes for ON and OFF.

    What I'd like to do is to either send a http request form the switch programming page or trigger the virtual device form the switch page.

    Best way would be to send http request from the switvch programming page.

    I need to send :

    ON :

    HWS = Net.FHttp("172.17.10.63")
    HWSReponse = HWS:GET("/api/xdevices.json?SetR=15")

    OFF :

    HWS = Net.FHttp("172.17.10.63")
    HWSReponse = HWS:GET("/api/xdevices.json?ClearR=15")

    • 0
    Posted

    Hi @pierre

     

    Could I ask what you are looking to do with the http request and why you want it to be triggered from the switch 

    • 0
  • Inquirer
  • Posted

    Hi,

    as mentioned earlier the switchss are not connect directly to the lights because of the way the cabling was done..

    The lights are connected to relay. In this case EGC IPX800.

    So I need to send a command to the relay when a switch is pushed.

    Switches are only used to send info not to switch on - off the lights.

    Pierrre

     

    • 0
    Posted

    @pierre

     

    assume switch ID is 22

     

    --[[

    %%properties

    22 value

    ]]

     

    local sw = fibaro:call(22, 'Value')

     

    if (sw == '0') then

     

    PUT LUA CODE HERE FOR OFF

     

    end

     

    if (sw == '1') then

     

    PUT LUA CODE HERE FOR ON

     

    end

     

     

    so if switch in ON position then lights ON and if switch in OFF position then lights OFF

     

    hope this helps

    • Like 1
    • 0
    Posted (edited)

    I'm not at home so I am a bit limited in resources, but you might be able to do it in one scene. You can put multiple triggers in the header, like:

    22 value

    23 value

     

    Then use "getSourceTrigger()"  to find out if it was device 22 or 23 that started the scene.

    Edited by petergebruers

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