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


Start Scene from HA-Bridge and pass parameters


Dave_H

Recommended Posts

Please login or register to see this link.

 is often used for turning devices off and on or dim lights using the following API calls:

Please login or register to see this code.

It can also be used to set sliders on Virtual Devices, as I've done in my 

Please login or register to see this link.

 using this API call:

Please login or register to see this code.

And another common use-case is to call a scene, which can use either of the following API calls:

Please login or register to see this code.

However, the Scene Action API also allows parameters (arguments) to be sent to the scene, by embedding a json message in the HTTP body as an array of values.  To start a scene from HA-Bridge and send parameters, then setup the device in HA-Bridge as follows:

Please login or register to see this code.

Where <nn> is the scene number, eg:

Please login or register to see this code.

And the value in the HTTP Header after the word 'Basic' is your Fibaro user id and password separated by a colon, and encoded in Base64.  Use a site, such as 

Please login or register to see this link.

 to do this encoding for you.  So for example:

Please login or register to see this code.

Please login or register to see this code.

Please login or register to see this code.

It seems that it's necessary to send the userid and password using this method, rather than the more commonly seen method of adding the credentials before the Fibaro IP address, otherwise an error (HTTP 405) is returned by Fibaro.

 

The HTTP Body contains the json with the list of parameters in an array. So if you want to pass in, let's say, a device number and the 'lux' value, then you could send something like this:

Please login or register to see this code.

In the scene, you can fetch the parameters using the fibaro:args() function, eg:

Please login or register to see this code.

Please login or register to see this code.

Link to comment
Share on other sites

  • 3 months later...

Hi,

Is it possible to push any button of VD?

Above it is described how to turn ON / OFF and Dimm.

I would like to push button X of my VD number Y. Is it possible? If so what is call for this?

 

---

Got it: 

http://user:password@hc2ipaddress/api/callAction?deviceID=xx&name=pressButton&arg1=xx

Edited by Bezan
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...