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

  • Topic Author
  • Posted
    2 hours ago, FrankT said:

    @jgab testing event_runner B14. Got this error :

     

    Program starting as '"C:\Program Files (x86)\ZeroBraneStudio\bin\lua.exe" -e "io.stdout:setvbuf('no')" "C:\Users\F\AppData\Local\Temp\.C16A.tmp"'.
    Program 'lua.exe' started in 'C:\Program Files (x86)\ZeroBraneStudio\myprograms\2B14' (pid: 21328).
    Debugging session started in 'C:\Program Files (x86)\ZeroBraneStudio\myprograms\2B14\'.
    Fri/Apr/12,12:55:55:[HC2 ] HC2 SceneRunner v0.7 fix2
    Fri/Apr/12,12:55:55:[HC2 ] Running speedtime
    Fri/Apr/12,12:55:55:[HC2 ] Local mode, will not access resources on HC2
    Fri/Apr/12,12:55:55:[HC2 ] Created Event server at 192.168.1.127:6872
    Fri/Apr/12,12:55:55:[HC2 ] Web GUI at http://192.168.1.127:6872/emu/main
    Fri/Apr/12,12:55:55:[HC2 ] Reading and decoding configuration from HC2.data
    Program completed in 1.20 seconds (pid: 21328).
    HC2.lua:687: attempt to index local 'rsrc' (a nil value)
    stack traceback:
        HC2.lua: in function 'loadConfigFromFile'
        HC2.lua:63: in function 'main'
        HC2.lua:204: in function 'startup'
        HC2.lua:3077: in main chunk
        [C]: in function 'dofile'
        BelysningER2_B14.lua:11: in main chunk
    Debugging session completed (traced 0 instructions).
     

    Could it be the structure of my HC2.data file? 

     

    [{"devicemap":"{\"toa_dusch\":{\"takdimmer\":207},\"iOS\":{\"FranksiPad\":350,\"MargarethasiPhone\":138,\"samsungSM-T700\":203,\"iPhone10,6\":89},\"scene\":{\"TwoSpottarKoek\":45,\"LarmTelegramText\":304,\"TimeOfDay\":62,\"MarkisSovrum\":211,\"DoorBirdMotion\":178,\"MarkisTVrum\":213,\"ArmAlarmScene\":...……..

     

    And if that is the case what structure would HC2.lua expect?

    Unfortunately, the old eventrunner format is not supported. You have to create a new file by uncommenting HC2.copyConfigFromHC2(...) in HC2.lua in its main.

    It will read globals and devices from the HC2.

    Posted
    1 hour ago, jgab said:

    Unfortunately, the old eventrunner format is not supported. You have to create a new file by uncommenting HC2.copyConfigFromHC2(...) in HC2.lua in its main.

    It will read globals and devices from the HC2.

    Ok, thank you. Does work fine! Btw, what is the use of this statement  --dofile("HC2verify.lua")  in HC2.lua?

     

     

     

  • Topic Author
  • Posted
    28 minutes ago, FrankT said:

    Ok, thank you. Does work fine! Btw, what is the use of this statement  --dofile("HC2verify.lua")  in HC2.lua?

     

     

     

    Oh, it's just a file with test code that I run to see that there are no major errors in the emulator.

    Btw, I will fix so that it doesn't crash if the data file is in wrong format - thanks for spotting that.

    /J

  • Topic Author
  • Posted (edited)

    I have been busy restructuring most of the emulator. Have released v0.8 of the emulator.

    EventRunner is up to 2.0, B14

     

    -New emulator Web GUI with "main page" that have buttons for speeding the scene or jump 1 or 24 hours. Creating HC2.data file. Also scene triggers are available. 

    -

    Please login or register to see this link.

     that opens the Emulator GUI with a keyboard shortcut (Ctrl-Alt-E, or Option-Cmd-E on Mac). Also adds links to EventRunner and Emulator thread on the Fibaro Forum under the Help menu. Very useful actually.

    -The HC2.data format is new so please regenerate it (GUI or via HC2.lua main())

    -All resources start out as local/emulated (devices,globals etc). In your code you can enable them as "remote" (see below)

    -New functions available in _System.* to call the emulator from scene - see <

    Please login or register to see this link.

    >

    -Emulator per default starts in "realtime" mode. If you want to speed call _System.speed(true) or use Speed button in web GUI

    -_System.* is callable from ER rules, which gives better control over how the emulation should run.

    Ex.

    Please login or register to see this code.

    Wrap _System.* calls in _EMULATED as they are not available on the HC2.

     

    Oh,

    Please login or register to see this link.

    Edited by jgab
    • Thanks 2
    Posted

    very nice :) Thanks @jgab

     

    Posted

    I'm trying new version:

     

    I have this error in HC2.lua:974: attempt to index local 'd' (a string value)

    in this row:  for _,d in pairs(list) do if filter(d) then d._local=tp end end

     

  • Topic Author
  • Posted
    6 minutes ago, petrkl12 said:

    I'm trying new version:

     

    I have this error in HC2.lua:974: attempt to index local 'd' (a string value)

    in this row:  for _,d in pairs(list) do if filter(d) then d._local=tp end end

     

     

    I assume you are doing a HC2.setLocal or HC2.setRemote that causes it.

    How does the call look like?

    1 minute ago, jgab said:

     

    I assume you are doing a HC2.setLocal or HC2.setRemote that causes it.

    How does the call look like?

     

    and have you generated a new HC2.data file?

    Posted

    I have this:

     

    Please login or register to see this code.

     

    Posted
    41 minutes ago, jgab said:

    and have you generated a new HC2.data file?

     

    No, so I did it,

    Now it works 

    Thanks

     

  • Topic Author
  • Posted
    42 minutes ago, petrkl12 said:

    I have this:

     

    Please login or register to see this code.

     

    If you set a breakpoint there what is d? Looks like the data file is corrupt...?

    Posted

    Now it works. I had old structure of data file.

    Thanks

  • Topic Author
  • Posted
    56 minutes ago, petrkl12 said:

    I have this:

     

    Please login or register to see this code.

     

    If you set a breakpoint there what is d? Looks like the data file is corrupt...?

    Posted

    @jgab

    with %autostart it works without any problems

    but without %autostart scene is not possible to run - I have tried all options  - speed, 1 hour, 24 hours

    Posted (edited)

    In one scene on HC2 I have got this error:

    [DEBUG] 19:39:09: Error loading rules:fibaro:get(nil)
     

    In ZBS it works ...

    In previous version it also works...

    Edited by petrkl12
  • Topic Author
  • Posted
    1 hour ago, petrkl12 said:

    @jgab

    with %autostart it works without any problems

    but without %autostart scene is not possible to run - I have tried all options  - speed, 1 hour, 24 hours

    If it doesn't have autostart it either need to be started by a sourceTrigger of type 'other' or with a trigger declared in the header.

    The "main" GUI page list sourceTriggers of type value or global declared in the header of registered scenes. And you can start a scene by setting their values to cause a sourceTrigger to be posted - like in my recorded youtube video.

    Otherwise, you can go into the "Scenes" tab in the Web GUI and press the "startScene" button for the scene. It will generate a 'other' scene trigger. You can also in son give an argument to startScene.

  • Topic Author
  • Posted
    1 hour ago, petrkl12 said:

    In one scene on HC2 I have got this error:

    [DEBUG] 19:39:09: Error loading rules:fibaro:get(nil)
     

    In ZBS it works ...

    In previous version it also works...

     

    This is tricker... Seems like you call fibaro:get with a nil value - typically a variable that is not initialised (HomeTable?).

    Do you have any idea what rule it is that causes it? 

    Posted (edited)
    17 minutes ago, jgab said:

    If it doesn't have autostart it either need to be started by a sourceTrigger of type 'other' or with a trigger declared in the header.

    The "main" GUI page list sourceTriggers of type value or global declared in the header of registered scenes. And you can start a scene by setting their values to cause a sourceTrigger to be posted - like in my recorded youtube video.

    OK but there is error - Aborting: Server not started yet - because main scene doesn't work

     

    17 minutes ago, jgab said:

    Otherwise, you can go into the "Scenes" tab in the Web GUI and press the "startScene" button for the scene. It will generate a 'other' scene trigger. You can also in son give an argument to startScene.

    This is work. Thanks

     

    Maybe could be prefect to add button for run scene in main page.

    8 minutes ago, jgab said:

     

    This is tricker... Seems like you call fibaro:get with a nil value - typically a variable that is not initialised (HomeTable?).

    Do you have any idea what rule it is that causes it? 

     

    I don't have idea. It's interesting that it runs in ZBS and in previous version. Issue is that error message is not too much specific (ie. number of row)

    Edited by petrkl12
  • Topic Author
  • Posted
    10 hours ago, petrkl12 said:

    OK but there is error - Aborting: Server not started yet - because main scene doesn't work

     

    This is work. Thanks

     

    Maybe could be prefect to add button for run scene in main page.

     

    I don't have idea. It's interesting that it runs in ZBS and in previous version. Issue is that error message is not too much specific (ie. number of row)

     

    Yes, maybe a start/stop button in the main page for registered scenes.

    [DEBUG] 19:39:09: Error loading rules:fibaro:get(nil) 

    ...I think I know why and it was all my fault - did you turn on logging of fibaro:get and getValue? _debugFlags.fget=true ?

    Anyway it was a bug in logging code that I fixed. Pushed a new version of both HC2.lua and EventRunner.lua

    See if it works for you.

    If this is the reason I'm not sure why it worked on ZBS...

    /J

    Posted (edited)

    still error but with better description :)

     

    [DEBUG] 21:05:36: Error loading rules:fibaro:get(Koupelnaprizemi.Vypinacuzrcadla,"TCPPort"),/opt/fibaro/scenes/228.lua:3206: attempt to compare nil with number

     

     row 3206:   if id < 10000 then return fibaro._get(obj,id,...) else return fibaro._idMap[id].get(obj,id,...) end
     

    Edited by petrkl12
  • Topic Author
  • Posted

    Looks like Koupelnaprizemi.Vypinacuzrcadla is nil?

    unfortunately I’m away on a trip and will not be able to to any tests until Saturday. 

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