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

Scene with arguments from REST API


Question

Posted

So I built a rain sensor using an Arduino that I would like to talk to my HC2. My first attempt was using the REST API to set a global variable "raining" depending on the state of the sensor. This works, but unfortunately scenes that use the "raining" global as a trigger do not trigger when it is changed though the REST API. That seems like a bug to me.

 

My second solution is to call two different scenes from the Arduino instead: "rainStarted" and "rainStopped" and have those scenes set a global variable, or call other scenes. That should work, but it would be nice to only have a single scene and send an argument or parameter to it to indicate if it is raining or not. The REST API documentation seems to indicate that you can send arguments to scenes; The POST /scenes/{sceneID}/action/{action} endpoint takes a 

SceneAction {

  args (arrayoptional),
  pin (stringoptional)

}

as a parameter. But I can't find a way to retrieve the argument in the scene. Any ideas?

 

Or any other suggestions for solving my problem?

 

Thanks!

 

2 answers to this question

Recommended Posts

  • 0
Posted

Hi @stalar and welcome to Fibaro forum!

 

To trigger scene when changing global variable using REST API please check solution here:

 

  • 0
  • Inquirer
  • Posted (edited)

    Aha! Looks like what I need. Too bad the documentation does not mention this. 

     

    Thanks!

    Edited by stalar

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