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

Start scene with certain attributes through http api


3JL
 Share

Question

Hi,

Is it possible to start a scene through an http command with specific attributes?

e.g. /api/SceneControl?action=start&id=sceneID&var1=5

 

Or should I change a global variable using /api/globalVariables first?

I feel I will then get in trouble when multiple instances of a scene are ran simultaneously.

 

Thanks, J

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

No, you can't do both at same time, but:

 

you can add in scene trigger section

 

Please login or register to see this code.

 

to let only the current one instance, or you can trigger directly based on variable change (of course if possible) if you worry about extern triggering.

 

Link to comment
Share on other sites

  • 0
1 minute ago, tinman said:

you can add in scene trigger section

Please login or register to see this code.

to let only the current one instance, or you can trigger directly based on variable change (of course if possible) if you worry about extern triggering.

 

Wow, that is great we could use that. I wonder why Fibaro developers did not use it in generating lua code after making block scene. This could save a lot of troubles from my point of view, instead of limiting instances to 10.

Link to comment
Share on other sites

  • 0

it is by default for magic scenes, but they have only one trigger. For block scenes one need sometimes to trigger even twice without killing the already running (e.g. to not break up something middle of the process, but simply run both one after the other or block before run with max. instances). 

 

 

Link to comment
Share on other sites

  • 0

I don't know if my case is isolated one, but when I try to use %% killOtherInstances with my Very Smart Light scene (LUA) that is triggered by either device or global variable it didn't work as I expected. First instance that was triggered with motion sensor breached was killed by scene instance that was triggered by motion sensor going to safe. So at the end I had lights remaining turned on and no running instances of the scene.

 

In short, it seems to me that using this option only last triggered instance stay running while instance that was running before is killed. This is OK for some cases but not if you want to keep first instance running and prevent other instances to start.

Link to comment
Share on other sites

  • 0
2 minutes ago, Sankotronic said:

I don't know if my case is isolated one, but when I try to use %% killOtherInstances with my Very Smart Light scene (LUA) that is triggered by either device or global variable it didn't work as I expected. First instance that was triggered with motion sensor breached was killed by scene instance that was triggered by motion sensor going to safe. So at the end I had lights remaining turned on and no running instances of the scene.

 

In short, it seems to me that using this option only last triggered instance stay running while instance that was running before is killed. This is OK for some cases but not if you want to keep first instance running and prevent other instances to start.

If I remember correctly, this %%Killotherinstances was introduced in the (Beta?) FW that had auto scene creation. But this was removed at the next update.

You could only see this when you used the HC2 toolkit to backup the scene.

 

Jim

Link to comment
Share on other sites

  • 0
1 minute ago, jimicr said:

If I remember correctly, this %%Killotherinstances was introduced in the (Beta?) FW that had auto scene creation. But this was removed at the next update.

You could only see this when you used the HC2 toolkit to backup the scene.

 

Jim

 

Don't know when was this introduced, but it can be used at least in LUA scenes on FW 4.120 (tested on that version), but as I noted when this is added to the code then Max. running instances is set to 1 and only last started instance is running while instance that was already running is killed with shotgun. Buuum! :ninja:

I still have it added in Main scene FTBE on 4.130, but it doesn't have any influence since scene is anyway running only one instance. To check if there is any influence I need to run test.

Link to comment
Share on other sites

  • 0
2 minutes ago, Sankotronic said:

 

Don't know when was this introduced, but it can be used at least in LUA scenes on FW 4.120 (tested on that version), but as I noted when this is added to the code then Max. running instances is set to 1 and only last started instance is running while instance that was already running is killed with shotgun. Buuum! :ninja:

Ok, i will not using these :D.

 

3 minutes ago, Sankotronic said:

I still have it added in Main scene FTBE on 4.130, but it doesn't have any influence since scene is anyway running only one instance. To check if there is any influence I need to run test.

Maybe some unnoted "update". There is few of them. Eg. i was restarting HC2/HCL during 503 by calling GET method folowing URL "http://HC_IP/restart.php". Now, that will give me 503, when i try to call it.

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

 Share

×
×
  • Create New...