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
eva

VD pressButton with HTTP

Question

Please login or register to see this link.

 

Please login or register to see this link.

 

I tried a lot of links like these and got only {} response.

 

Please can anyone write how to trigger VD button with http?

VD with ID : 15

Button ID : Button11

 

+also tried with postman basic auth didnt work.

 

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

1. On VD HCL you need use structure of request like this examples in button :

 

ex1 (change label)

GET /api/callAction?deviceID=62&name=setProperty&arg1=ui.Label1.value&arg2=TEST HTTP/1.1
Host: 127.0.0.1
Authorization: Basic cGR1cmJhamxvQGl0LXNlY3VyDSsdsfe99999FxcTI=

 

ex2 (the ID of button is position numer of element in VD including all labels, buttons before)

GET /api/callAction?deviceID=213&name=pressButton&arg1=1 HTTP/1.1
Host: 127.0.0.1
Authorization: Basic cGR1cmJhamxvQGl0LXNlY3VyDSsdsfe99999FxcTI=

 

 

the Authorization Basic string is your user name (email) and password coded by Base64

You need write in IP zone of VD the: 127.0.0.1 and i PORT zone: 11111

 

2. If you call from webbrowser or any another device / program you use structure like this:

 

http://adminemail:password@192.168.1.X:11111/api/callAction?deviceID=213&name=pressButton&arg1=1

 

ex linux shell

HC_command='http://192.168.1.X:11111/api/callAction?deviceID=213&name=pressButton&arg1=1'

/usr/bin/curl --user admin@domain.zz:password $HC_command

 

Edited by drboss

Share this post


Link to post
Share on other sites
  • 0

@drboss so if I'm using a VD like VSL that has many different buttons with off and on etc, where would i find the ID of the button that I'd like to use for a "virtual push" in the callAction? I included an image for illustration purposes. 

Please login or register to see this attachment.

Share this post


Link to post
Share on other sites
  • 0
23 minutes ago, drboss said:

Id of this is 9

 

Textlabel do also count as an ID. So simply counting the buttons is not correct.

 

@matt1981

 

  • You could open up 

    Please login or register to see this link.

      and search for the device ID of your VD.  The VD ID could be easily found out if you do a mouseover of the little "edit-button" in your fibaro webinterface. Bottm left or right, pending which browser you use (in IE its left) you would see something like ?id=xx - this would tell you which ID you have to search for.
     
  • Other option is to use HC2 Toolkit of this forum made by Krikroff

Share this post


Link to post
Share on other sites
  • 0

Yes I wrote this in my text, count labels and buttons. But one time count label nam with value. For buttons count all buttons not group as one. 

Share this post


Link to post
Share on other sites
  • 0
  • Inquirer
  • @drboss @bl5cky Thank you

     

    Worked:

    http://admin:admin@192.168.0.31/api/callAction?deviceID=23&name=pressButton&arg1=1 (ON)

    http://admin:admin@192.168.0.31/api/callAction?deviceID=23&name=pressButton&arg1=2 (OFF)

    Find arg1 ID of button from http://192.168.0.31/api/devices (dont use element's name "ButtonXX")

     

    On the main "Devices" screen VD have a single button and it toggles on to off but doesnt toggles off to on?

     

     

    Details:

    How to change VD icon to "on" ? 

    Main "Devices" screen shows VD like this:

    Please login or register to see this attachment.

     

    When i press the button it sends OFF and new icon is:

    Please login or register to see this attachment.

     

    But when i press button again it doesnt change OFF icon to ON icon and also didnt send ON command from HTTP.

     

     

     

    This works normal when i press on - icon is on and sends HTTP command ON.

    When i press off - icon is off and sends HTTP command OFF.

     

    Please login or register to see this attachment.

    Share this post


    Link to post
    Share on other sites
    • 0

    If I understand well and depends of limitation of HCL you need use second REST command:

    /api/callAction?deviceID=62&name=setProperty&arg1=ui.Label1.value&arg2=label%20text

    or use the auto scene for change label like this:

    Please login or register to see this image.

    /monthly_2018_03/image.png.5fa247cab6650d4a1100e2967384e624.png" alt="image.png.5fa247cab6650d4a1100e2967384e624.png" />

     

    Share this post


    Link to post
    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...