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


HC2 scene emulator


jgab

Recommended Posts

  • Topic Author
  • 1 hour ago, jgab said:

     

    Thanks, that was a bug - fixed

    Dang, I think I broke <Hue deviceID>:isOn... in ER B73.

    I will fix it this evening.

    Link to comment
    Share on other sites

    58 minutes ago, jgab said:

    Dang, I think I broke <Hue deviceID>:isOn... in ER B73.

    I will fix it this evening.

    Looks like something more is broken also. I found this while testing new stuff

     

    Please login or register to see this code.

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, jompa68 said:

    Looks like something more is broken also. I found this while testing new stuff

     

    Please login or register to see this code.

    Please login or register to see this code.

     

    I guess that 326 is both a sceneID and a deviceID?

    Link to comment
    Share on other sites

    6 minutes ago, jgab said:

    I guess that 326 is both a sceneID and a deviceID?

    i don't even have that kind of scene in my HC2 ?

     

    ah, in my home table of course

    Edited by jompa68
    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, jompa68 said:

    i don't even have that kind of scene in my HC2 ?

     

    ah, in my home table of course

    And if you have same values somewhere in the HomeTable the log function may chose the wrong "path" to display. 

    In the case of scene and device having the same value it is a bit unfortunate. 

    If you store non-device/scene related in the HomeTable it's good to put them in a separate branch and not give that branch to 

    Util.reverseMapDef.

    • Like 1
    Link to comment
    Share on other sites

    • 1 year later...
    • 9 months later...
    On 4/16/2021 at 8:27 AM, jack_zhou said:

    i'm using emulator under guide,i can't see any triggers in web,how i can do?

     

    Same here. 

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • 4 hours ago, olafkatzer said:

     

    Same here. 

    Please login or register to see this attachment.

    You can go in under "Devices" and call simple devices (turnOn/turnOff)

    If you are running an emulated scene, the scene triggers will be listed at the bottom of the page you included so you could call a setValue on them etc.

    Link to comment
    Share on other sites

    18 hours ago, jgab said:

    You can go in under "Devices" and call simple devices (turnOn/turnOff)

    If you are running an emulated scene, the scene triggers will be listed at the bottom of the page you included so you could call a setValue on them etc.

    Thanks, i did fix the problem

    I used the example from the first Post, this did not work.

    After I changed to this line 

    Please login or register to see this code.

    everything was ok.
     

    Link to comment
    Share on other sites

    • 1 year later...

    Hi,

     

    I'm trying to getting this to work, but what i noticed is that when the sceneExample is started just like in the YouTube video, and i'm using the breaks to step by step run the code, the Emulator website doesn't seem to work anymore, its not responding; just if it is shutdown or something.

     

    But when i don't run with breaks; the emulator site is responding.

     

    Also i noticed that in the youtube video, the sleep commands are shown in the debug window, but in mine not. Also i noticed that when i hover over the sec variables, they don't reduce, and stay at 240 sec's. 

     

    What am i doing wrong?

     

    It looks like the emulator is stopping just after the scene is started by the trigger or something ?

    Link to comment
    Share on other sites

  • Topic Author
  • 13 minutes ago, Circumflex_sigma said:

    Hi,

     

    I'm trying to getting this to work, but what i noticed is that when the sceneExample is started just like in the YouTube video, and i'm using the breaks to step by step run the code, the Emulator website doesn't seem to work anymore, its not responding; just if it is shutdown or something.

     

    But when i don't run with breaks; the emulator site is responding.

     

    Also i noticed that in the youtube video, the sleep commands are shown in the debug window, but in mine not. Also i noticed that when i hover over the sec variables, they don't reduce, and stay at 240 sec's. 

     

    What am i doing wrong?

     

    It looks like the emulator is stopping just after the scene is started by the trigger or something ?

    Yes, the website is served by a web server run by the emulator so when you break/stop the emulator, the website don't work. It's a limitation with that implementation.

     

    The Lua code stops at the entry (first line) of a scene when it's activated. just play run again (F5)

    Link to comment
    Share on other sites

    ah ok, that explains it. After pressing F5, the emulator is usable again.

     

    Only my replay of the steps you are doing in the youtube video is not the same as my experience.

     

    At 06 minutes and 12 seconds in the video, you are stepping trough the code, and i noticed that when line 20 fibaro:sleep(1000*1) is passed, it shows this in the output below. But in my ZBS, it is not displayed. Also further the line 21 also should show in the output, but does not either show in my output. 

    Please login or register to see this attachment.

    Link to comment
    Share on other sites

  • Topic Author
  • It seems like I changed the default settings for flagging sleep to log (debug flag fother).

    Either add _debugFlags.fother=true in HC2.lua or add

     

    _debugFlags = { fother = true }

    in the beginning of the scene.

     

    Also, the sceneTest.lua is a bit boring and could benefit from printing out the secs in the loop, like below. and maybe change the time to 20s...

    Please login or register to see this code.

     

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