Scenarios and API (home+control)

christian.olgaard

Hi

I am a little confused how to use the API on scenarios

If I use getScenarios I get a list with different types by default (type matches the example)

If I change the name for one of the 4 other - and select a device, I get a new type

How do I use the setState to execute a scenario - I would think I should use ID as it does not change, but the documentation says to use scenario and shows example of calling with "home" (one of the types) -  but by default there are 4 of type "other" - how to specify which one of the 4 ?  and if I give it a new name do I still use the type, but it looks like I can still have multiple of the same type???

Thanks 

0

Comments

1 comment

  • Comment author
    Leslie Community moderator

    Hello Christian,

    When it deals with the custom scenarios, you can't use them via the name you set for them but by using custom_1/2/3/4

    Here is an example of a working /setstate request : 

    {
      "home": {
      "id": "5a2fe8a5b48xxxxxx",
        "modules": [
          {
          "id": "00:04:74:xxxxxx",
            "scenario": "custom_3"
          }
        ]
      }
    }

    Where home_id is the one of concerned Home

    module_id is your gateway

    Have a good day,

    Leslie - Community Manager

     

    0

Please sign in to leave a comment.