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


Recommended Posts

Posted

Hi,

 

I want to deactivate (turn off) and activate (turn on) a scene in a scene in HC3.

 

In HC2 I used lua fibaro:setSceneEnable(sceneID,enabled). It looks like this command is not available any more.

 

Do you know how this works in HC3.

 

Thanks for the help.

 

Kind regards

Huub

Posted

Please login or register to see this attachment.

Posted

Please login or register to see this code.

  • Topic Author
  • Posted

    Hi RH_Dreambox. 

     

    Thanks for the response. This I knew but I wont to do it in a scene and not by hand. But thanks anyway for your responce.

     

    Hi Jgab.

     

    Is a am a beginner, I read your code as follows,

       define a function (you showed two of the), and than call this function.

     

    Am I correct? I will test this later today and will keep you informed.

     

    Thanks for this. 

    Posted
    2 hours ago, HuubNabben said:

    Is a am a beginner, I read your code as follows,

       define a function (you showed two of the), and than call this function. 

    Yes it will be like the function you use on the HC2 but with a '.' instead of a ':'

    • 4 months later...
    Posted
    On 11/29/2020 at 10:19 AM, jgab said:

    Please login or register to see this code.

    This is for use in a QuickApp, is there a possibility to use in Lua code on the HC3

    The code fibaro.setSceneEnable(11, enabled);  don't work.

     

    Who can help.....

    Posted
    1 hour ago, twanve said:

    This is for use in a QuickApp, is there a possibility to use in Lua code on the HC3

    The code fibaro.setSceneEnable(11, enabled);  don't work.

     

    Who can help.....

    fibaro.setSceneEnable(11, true) -- enable

    fibaro.setSceneEnable(11, false) -- disable

    Posted
    17 hours ago, jgab said:

    fibaro.setSceneEnable(11, true) -- enable

    fibaro.setSceneEnable(11, false) -- disable

    Tested, but nope, didn't work

    Posted
    1 hour ago, twanve said:

    Tested, but nope, didn't work

    So do you get any error message?

    If I run a scene on the HC3 with

    Please login or register to see this code.

    it works very well - disabling and enabling the scene.

    Note that if a scene disables itself it will return  an error (because the scene is interrupted), but it will still become disabled.

    A disabled scene can of course not enable itself...

     

    Posted
    11 minutes ago, jgab said:

    So do you get any error message?

    If I run a scene on the HC3 with

    Please login or register to see this code.

    it works very well - disabling and enabling the scene.

    Note that if a scene disables itself it will return  an error (because the scene is interrupted), but it will still become disabled.

    A disabled scene can of course not enable itself...

     

    The code; fibaro.setSceneEnable(11, true) -- enable ore fibaro.setSceneEnable(11, false) -- disable did nothing when you run this in the Lua, also no error.

    This new coded above tested and this works great in Lua:-)

     

    Last question; is it possible before you switch from true to false, ore false to true, you get the value from this scene number

    Example; in a scene you get first the value form the scene, when scene is false you set to true

     

    In HC2 I use:

    local Timer == fibaro:getSceneRunConfig(119); )

     if Timer == "MANUAL_ONLY" then
          fibaro:setSceneRunConfig(119, "TRIGGER_AND_MANUAL");
     else
         fibaro:setSceneRunConfig(119, "MANUAL_ONLY");

    end

     

    Thx for you help.

     

    Posted

    Have a look at this document compiled by @knuth

     

    Posted
    1 hour ago, jgab said:

    Have a look at this document compiled by @knuth

     

    I think I found it.....

    (I like examples:-))

     

    local debug_TAG = "STATUS_SCENE"

     

    function fibaro.isSceneEnabled(sceneID) 

        return api.get("/scenes/"..sceneID).enabled

    end

     

    if fibaro.isSceneEnabled(5) == false then

      fibaro.debug(debug_TAG, "scene 5 is false")

    else

      fibaro.debug(debug_TAG, "scene 5 is true")

    end

    print(fibaro.isSceneEnabled(5));

    • 1 year later...
    Posted

    there is another thing about this concept

     

    in the scene api stands isRunning=true(or false) en enabled=true(or false) the same thing☺️ but isn't better if the scene is running tru a setTimeOut and gives that a isRunnning=true(or false) en only enabled if it is only enabled or not.

    i experience that when my HC3 restart after a manual restart or some unidentified restart the scenes that are automatically running not running. An there is no why to see 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
    Reply to this topic...

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