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

HC3 | Scene start other scene


Question

Posted

In HC3 is it possible in a scene to execute other scene with command: fibaro.scene("execute", {000})

Is it possible to see with scene has trigger the other one?

 

When I run scene manual, I get (json.encode):

{"property":"execute","type":"user","id":2}

 

When scene execute other scene, I get (json.encode):

{"type":"user","property":"execute"}

 

How I make in this scene the difference in this triggers.. with a "if" statement....?

5 answers to this question

Recommended Posts

  • 0
Posted (edited)

Look, I do it that way!

 

Please login or register to see this code.

 

Please login or register to see this code.

This is just an example and copied from some scenes together.

 

Gruss Frank

Edited by FBerges
  • 0
Posted
On 1/18/2021 at 1:30 PM, twanve said:

In HC3 is it possible in a scene to execute other scene with command: fibaro.scene("execute", {000})

Is it possible to see with scene has trigger the other one?

 

When I run scene manual, I get (json.encode):

{"property":"execute","type":"user","id":2}

 

When scene execute other scene, I get (json.encode):

{"type":"user","property":"execute"}

 

How I make in this scene the difference in this triggers.. with a "if" statement....?

 

@twanveDid you find a solution? i have the same issue and have no solution so far, besides some stuff with globals.

 

grt

jn

 

  • 0
  • Inquirer
  • Posted (edited)

    @okidoki try this

     

    --- scene manual triggerd ----
    if sourceTrigger.property == "execute" and sourceTrigger.id ~= "null" then
        -- you code
    end


    --- scene triggerd  scene ---
    if (sourceTrigger.property ~= "cron" and sourceTrigger.type ~= "date") and json.encode(sourceTrigger.id) == "null" then
        -- you code
    end

    Edited by twanve
    • 0
    Posted
    21 hours ago, twanve said:

    @okidoki try this

     

    --- scene manual triggerd ----
    if sourceTrigger.property == "execute" and sourceTrigger.id ~= "null" then
        -- you code
    end


    --- scene triggerd  scene ---
    if (sourceTrigger.property ~= "cron" and sourceTrigger.type ~= "date") and json.encode(sourceTrigger.id) == "null" then
        -- you code
    end

     

    Thks @twanve, but this not solve the issue which scene does call the scene, right? It excludes the option that is is a manual or cron start.

    But, hey, its a start :-)

     

    i was hoping that they stored the ID of the calling scene in Id, buts thats not the case.

    • 0
  • Inquirer
  • Posted

    I know what you mean, a wish to Fibaro team tot make this....

    For now, I make a globalVaribale named StartTriggerID en set this to a specified number.

    Before start the Scene xx, I set this:  fibaro.setGlobalVariable("StartTriggerID", "2230");

     

    In the Scene xy where I need this scene trigger from scene xx, I use:   if startTriggerID == 2230 then... 

    At the end the scene set:   fibaro.setGlobalVariable("StartTriggerID", "-1");

    For now it works perfect in all scenes where I need this.

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