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

How to trigger scene from REST API?


Question

Posted

Hi All,

 

Maybe a simple one but I want to check before I do it. Basically I just want to make an external call to my HC2 to start a scene.

 

So, having not done this before, I guess I need to port forward to my HC2 and do something like this:

 

Please login or register to see this link.

callAction? then what?

 

​I know you can do for a device like so : deviceID=51&&name=setArmed&arg1=0 

 

But obviously I want to start scene

 

Help much appreciated whilst I trawl forums for answer! I looked on Developer but can only see the above for devices....which doesn't help me personally.

 

KR, Dave

Please login or register to see this image.

/emoticons/default_icon_biggrin.gif" alt=":-D" />

11 answers to this question

Recommended Posts

  • 0
  • Inquirer
  • Posted

    Found....for anyone who needs to know it should be:

     

    username:password@ip:port/api/sceneControl?id=YOURID&action=start 

     

    OR

    Please login or register to see this code.

    • Thanks 1
    • 0
    Guest azevenhuizen
    Posted

    Where did you find this?
    I'dd like to change a globalVar by an external call from my webserver.​

    • 0
    Posted

    change global you can using python

    Please login or register to see this code.

    with invokeScenes using trigger scenes

     

    • 0
    Posted

    Where did you find this?

    I'dd like to change a globalVar by an external call from my webserver.​

     

    You can either look it up on developer.fibaro.com or use firebug pluguin for your browser to check paths and payloads.

    • 0
    Posted

    Hi,

    I tried the invokeScenes-Parameter and changed a global Variable from Rest-API. In this case the scene did not run. Could someone confirm this behaviour. I tried it with HC2 on version 4.056.

    I would very pleased if it is possible to trigger a Scene by changing a global Variable by Rest-API.

     

    Best regards

    • 0
    Guest azevenhuizen
    Posted

    Work with me in version 4.054.

    I only use this format when calling from php script.

     

    $data = array("name" => $strGlobalVar, "value" => $strValue, "invokeScenes" => true);

    • 0
    Posted

    Hi,

     

    I tried it with curl.

     

    curl -v -H "Content-Type: application/json;charset=UTF-8" -X PUT --data '{"name": "AtHome", "value": "1", "invokeScenes":True}' 

    Please login or register to see this link.

     

    But this HTTP-Request does not trigger any Scene with the following header. The value of the varibale changed, but no scenes running.

     

    --[[
    %% properties
    55 value
    61 value
    %% globals
    AtHome
    --]]

     

    Could someone give me another hint, or could try it?

     

    Thanks

    • 0
    Posted

    Please use the documentation at 

    Please login or register to see this link.

    IP OF YOUR HC2>/docs/

     

    There you can also make queries and issue actions from and to your live system. Very handy.

    • 0
    Posted

    Hi Tomme,

     

    this is not what I want. I would like to trigger a scene from other system automatically.

     

    I use iButtons to check which one is at home. In the case of changing home-status the global variable is changed.

     

    Now i will trigger a scene when the state of a global variable is changed through REST-Api.

     

    It wont work at me.

     

    Greets

    • 0
    Posted

    Hi,

    could you (or Fibaro) solve the problem to trigger a scene from other system automatically.?

    Are there new information?

     

    Regards Hoggle

    • 0
    Posted

    We are using Control4 to control Fibaro and our external programmer wrote a driver to start a scene. It is old driver (for version 3.xxx) so i cannot tell if it works for 100%.

    I also made VD example for our dealers. At the end, i had to use double enter to get this works. And i believe starting scenes from Control4 works similiar like this:

     

    POST /api/scenes/ID/action/start HTTP/1.1

    Host: IP

    Authorization: BASIC username:password ---- it is encoded in Base64

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