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

Hello Jan,

When I load one of my scenes in ZB it will give the next error:

[31mWed/Jun/12,22:37:52:[20:1] Error loading rules:Error evaluating 'hal.tussendeur:breached & eetkamer.luxsensor:lux < 12 & once(05:00..08:30) => keuken.ledkastjes:on ; wait(00:00:45); remote(_myNodeRed,#speak{data='goede morgen'}) ' attempting to index non table with key:'tussendeur'[0m
[32mWed/Jun/12,22:37:52:[HC2 ] Scene [20:1] terminated (thread: 0x03385748)[0m

 

hal.tussendeur is listed in HomeTable

I have more of this kind of errors

Please advice

 

 

 

 

 

 

 

 

 

Posted

HomeTable not active in ZB?

 

 

 

 

 

 

 

Please login or register to see this image.

/uploads/monthly_2019_06/image.png.ddc32721a62e7ad8137bddb9455b31ba.png" alt="image.png.ddc32721a62e7ad8137bddb9455b31ba.png" />

Posted
6 hours ago, Sjakie said:

HomeTable not active in ZB?

 

 

 

 

 

 

 

Please login or register to see this link.

look for this line in HC2.lua and remove -- in line 2. Then all data from HC2 will be stored in HC2.data file. Then it should not be a problem

 

Please login or register to see this code.

 

  • Topic Author
  • Posted
    26 minutes ago, jompa68 said:

    look for this line in HC2.lua and remove -- in line 2. Then all data from HC2 will be stored in HC2.data file. Then it should not be a problem

     

    Please login or register to see this code.

     

     

    Another way is to open the Web GUI (http://127.0.0.1:6872/emu/main) and click the button "Copy setup from HC2". If you uncomment that line it will read the config from the HC2 at every run which adds a delay at startup that can be annoying. Btw, have you tried to install the ZBS plugin (

    Please login or register to see this link.

    )? It gives a keyboard shortcut and menu to open the web GUI when the emulator runs.

    Posted
    16 minutes ago, jgab said:

    Btw, have you tried to install the ZBS plugin (

    Please login or register to see this link.

    )? It gives a keyboard shortcut and menu to open the web GUI when the emulator runs.

    Ah, nice feature :D
     

  • Topic Author
  • Posted
    22 hours ago, jompa68 said:

    Yes, 515 is my ical.lua. All settings are standard, nothing changed.
    No extra events logged in scene.

     

    Ok, fixed the bug with ICal and multiple alarms. Pushed a new version B11, but you can patch your current version if that's quicker

    Line 315:

    Change

    Please login or register to see this code.

    to

    Please login or register to see this code.

     

    Posted
    Just now, jgab said:

     

    Ok, fixed the bug with ICal and multiple alarms. Pushed a new version B11, but you can patch your current version if that's quicker

    Line 315:

    Change

    Please login or register to see this code.

    to

    Please login or register to see this code.

     

    Great, i was spammed yesterday also with notification about remembering the garbage. 60 times ;D

    Posted

    Hello Jan,

    removed the line

    As I click on copy setup from HC2 it will give error

    url load localy

    I checked my log in credentials

    __HC2_USER           = "[email protected]" -- used for api.x/fibaro:* calls to HC2
    _HC2_PWD            = "xxxxxxxxxx"
    _HC2_IP             = "192.168.1.153"

    Now I am lost

    Please advice

    [35mThu/Jun/13,08:07:23:[HC2 ] Configuration from file, Globals:0, Scenes:0, Device:0, Rooms:0[0m
    [32mThu/Jun/13,08:07:23:[HC2 ] System trigger:{"type":"autostart"} at Thu Jun 13 08:07:23[0m
    [35mThu/Jun/13,08:07:23:[HC2 ] Reading configuration from H2C...[0m
    [31mThu/Jun/13,08:07:23:[HC2 ] HC2 returned error '401 ' - URL: 'http://192.168.1.153/api/globalVariables/'.[0m
    Program completed in 24.60 seconds (pid: 2992).
    Debugging session completed (traced 0 instructions).

     

  • Topic Author
  • Posted (edited)
    1 hour ago, Sjakie said:

    Hello Jan,

    removed the line

    As I click on copy setup from HC2 it will give error

    url load localy

    I checked my log in credentials

    __HC2_USER           = "[email protected]" -- used for api.x/fibaro:* calls to HC2
    _HC2_PWD            = "xxxxxxxxxx"
    _HC2_IP             = "192.168.1.153"

    Now I am lost

    Please advice

    [35mThu/Jun/13,08:07:23:[HC2 ] Configuration from file, Globals:0, Scenes:0, Device:0, Rooms:0[0m
    [32mThu/Jun/13,08:07:23:[HC2 ] System trigger:{"type":"autostart"} at Thu Jun 13 08:07:23[0m
    [35mThu/Jun/13,08:07:23:[HC2 ] Reading configuration from H2C...[0m
    [31mThu/Jun/13,08:07:23:[HC2 ] HC2 returned error '401 ' - URL: 'http://192.168.1.153/api/globalVariables/'.[0m
    Program completed in 24.60 seconds (pid: 2992).
    Debugging session completed (traced 0 instructions).

     

    401 means that the authorization failed. That must mean that username or password is wrong. Should be the same credentials as when you log in to the HC2.

    Do you have an "HC2credentials.lua" file with old credentials? HC2.lua reads "HC2credentials.lua" at startup and will overwrite variables set in the file header.

     

    Wait a minute. Your _HC2_USER has 2 dashes infront of the variable name. Thats the problem!

    /J

    Edited by jgab
    Posted

    Hello Jan,

    hehe this is solved but regret to say

    Test.lua:9: attempt to index global 'fibaro' (a nil value)

     

    I downloaded from Github a fresh test.lua and it hangs on:

    if fibaro:countScenes() > 1 then fibaro:abort() end


    Please advice

     

     

     

     

     

     

     

    Please login or register to see this image.

    /uploads/monthly_2019_06/image.png.ddc32721a62e7ad8137bddb9455b31ba.png" alt="image.png.ddc32721a62e7ad8137bddb9455b31ba.png" />

  • Topic Author
  • Posted
    3 hours ago, Sjakie said:

    Hello Jan,

    hehe this is solved but regret to say

    Test.lua:9: attempt to index global 'fibaro' (a nil value)

     

    I downloaded from Github a fresh test.lua and it hangs on:

    if fibaro:countScenes() > 1 then fibaro:abort() end


    Please advice

    Please login or register to see this link.

     

    Sorry, the test scenes have not been updated since the last rewrite of HC2.lua so they were not compatible anymore.

    I have updated them now also it should work.

    All scenes that you run in the emulator need the line

    Please login or register to see this code.

    in the beginning. The line is ignored when moving the scene back to the HC2 as 'dofile' returns nil on the HC2.

    Posted

    Hello Jan,

    Hehe I started to doubt on myself!

    But I copied and pasted one scene (Beveiligen) complete in ZB. File is listed in the row of test, HC2data, HC2.lua

     

    Program starting as '"C:\ZeroBraneStudioEduPack-1.80-win32\bin\lua.exe" -e "io.stdout:setvbuf('no')" "C:\Users\sjaak\AppData\Local\Temp\.BDF2.tmp"'.
    Program 'lua.exe' started in 'C:\ZeroBraneStudioEduPack-1.80-win32\myprograms' (pid: 4564).
    Debugging session started in 'C:\ZeroBraneStudioEduPack-1.80-win32\myprograms\'.
    [33mThu/Jun/13,13:51:14:[HC2 ] HC2 HC2 emulator v0.10 fix5[0m
    [33mThu/Jun/13,13:51:14:[HC2 ] Local mode, will not access resources on HC2[0m
    [32mThu/Jun/13,13:51:14:[HC2 ] Created Event server at 192.168.1.184:6872[0m
    [32mThu/Jun/13,13:51:14:[HC2 ] Web GUI at http://192.168.1.184:6872/emu/main[0m
    [35mThu/Jun/13,13:51:14:[HC2 ] Reading and decoding configuration from HC2.data[0m
    [35mThu/Jun/13,13:51:14:[HC2 ] Configuration from file, Globals:125, Scenes:82, Device:226, Rooms:21[0m
    Program completed in 2.26 seconds (pid: 4564).
    HC2.lua:1271: File load error: cannot obtain information from file `Beveiligen.lua' in C:\ZeroBraneStudioEduPack-1.80-win32\myprograms
    stack traceback:
        [C]: in function 'error'
        HC2.lua:1271: in function 'loadEmbedded'
        HC2.lua:79: in function 'main'
        HC2.lua:210: in function 'startup'
        HC2.lua:3456: in main chunk
        [C]: in function 'dofile'
        ER 57 Beveiligen.lua:52: in main chunk
    Debugging session completed (traced 0 instructions).

     

     

     

     

     

     

     

     

    Please login or register to see this image.

    /uploads/monthly_2019_06/image.png.ddc32721a62e7ad8137bddb9455b31ba.png" alt="image.png.ddc32721a62e7ad8137bddb9455b31ba.png" />

  • Topic Author
  • Posted (edited)
    14 minutes ago, Sjakie said:

    Hello Jan,

    Hehe I started to doubt on myself!

    But I copied and pasted one scene (Beveiligen) complete in ZB. File is listed in the row of test, HC2data, HC2.lua

     

    Program starting as '"C:\ZeroBraneStudioEduPack-1.80-win32\bin\lua.exe" -e "io.stdout:setvbuf('no')" "C:\Users\sjaak\AppData\Local\Temp\.BDF2.tmp"'.
    Program 'lua.exe' started in 'C:\ZeroBraneStudioEduPack-1.80-win32\myprograms' (pid: 4564).
    Debugging session started in 'C:\ZeroBraneStudioEduPack-1.80-win32\myprograms\'.
    [33mThu/Jun/13,13:51:14:[HC2 ] HC2 HC2 emulator v0.10 fix5[0m
    [33mThu/Jun/13,13:51:14:[HC2 ] Local mode, will not access resources on HC2[0m
    [32mThu/Jun/13,13:51:14:[HC2 ] Created Event server at 192.168.1.184:6872[0m
    [32mThu/Jun/13,13:51:14:[HC2 ] Web GUI at http://192.168.1.184:6872/emu/main[0m
    [35mThu/Jun/13,13:51:14:[HC2 ] Reading and decoding configuration from HC2.data[0m
    [35mThu/Jun/13,13:51:14:[HC2 ] Configuration from file, Globals:125, Scenes:82, Device:226, Rooms:21[0m
    Program completed in 2.26 seconds (pid: 4564).
    HC2.lua:1271: File load error: cannot obtain information from file `Beveiligen.lua' in C:\ZeroBraneStudioEduPack-1.80-win32\myprograms
    stack traceback:
        [C]: in function 'error'
        HC2.lua:1271: in function 'loadEmbedded'
        HC2.lua:79: in function 'main'
        HC2.lua:210: in function 'startup'
        HC2.lua:3456: in main chunk
        [C]: in function 'dofile'
        ER 57 Beveiligen.lua:52: in main chunk
    Debugging session completed (traced 0 instructions).

     

    It's important that you have HC2.lua and your scene file (Beveiligen.lua in this case) in the same working directory. Also in ZBS set project directory to the same directory (Project -> Project Directory -> Set From Current File)

    Edited by jgab
    Posted

    Hello Jan,

    Both done >>same error

    Please login or register to see this image.

    /monthly_2019_06/image.png.8e64202dca901c07a1f3f29491c62a84.png" alt="image.png.8e64202dca901c07a1f3f29491c62a84.png" />

     

     

     

     

     

     

    image.png.ddc32721a62e7ad8137bddb9455b31ba.png

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

    Hello Jan,

    Both done >>same error

    Please login or register to see this link.

     

    What button in ZBS do you press to start the scene? You need to press the single green arrow or F5. (circled in red). It starts running in debug mode.

    The other start in scratch-pad or without debug and then it doesn't work. 

    I may try to fix it in the future but it's a bit complicated...

    Please login or register to see this image.

    /monthly_2019_06/debug.png.0a4bb2930ecfbe368a679226d6aab3c1.png" style="width:300px;height:auto;" alt="debug.png.0a4bb2930ecfbe368a679226d6aab3c1.png" />

    Posted

    Hello Jan,

    Yep that button I use. I just wanted to get more familiar with ZB. It is not a big deal my tests I will do life.

    I will concentrate on my scenes to smooth them up, thanks for your time and effort!

    My scenes are still running without restarting manually

    Question:

    I have one scene with all my Hue light, all are in the living room. I extend Hue also in the garden (is a separate scene)

    In my Hue scene you advised to write Hue.define So will I use Hue in garden I need to do the same Hue.define (the garden lamps??)


    Hue.define("ambitvlight", nil, 12278)
    Hue.define("lampplafondklokzijde", nil, 12281)
    Hue.define("spotkastlinks", nil, 12312)
    Hue.define("spotschilderijrechts", nil, 12320)

     

    Can this be moved into HomeTable?>>> I tried but it goes wrong with the nil

    I already have in HomeTable:

    woonkamer{ambitvlight=12278,lampplafondklokzijde=12281,spotkastlinks=12312,spotschilderijrechts=12320,spotschilderijlinks=12321,spotstoelarleta=12322,spotbeeldlinks=12323,spotbeeldrechts=12324,lampplafondtvzijde=12325,spotstoelsjaak=12326,

    Please advice

     

     

     

     

     

     

     

     

     

     

    Please login or register to see this image.

    /uploads/monthly_2019_06/image.png.ddc32721a62e7ad8137bddb9455b31ba.png" alt="image.png.ddc32721a62e7ad8137bddb9455b31ba.png" />

    Posted

    Hello Jan,

    Apologize for all my questions but I need your expertise!

    I think I am almost ready with guarding the complex. Found some where here in the discussions use rules from one scene in another. I want to use it but need your advice/comment.

    The proposal for the change of color of my flag hue light I modified a bit and can use it also as red alert light in case alarm status is on!

    Guard the hose scene                                                                                                                woonkamer scene (Hue)

    here I have used on your advice:                                                                                                           Can I use here

    Rule.eval("hal.voordeur:breached & hal.voordeur:armed=='1' =>

    post(#AlarmState); $Telegram='Alarm, hal.voordeur breached'")                                           ule.eval("#AlarmState =>  alarmlights:on; colorIndex2=1; enable(colorShow2)") -- Start show

                                                                                                                                                             Question,  nothing further mentioned or under %%event

                                                                                                                                                                                                                                                 AlarmState  in header?

     

    Must think will become button on VD or something

    Rule.eval("429:btn=1 => signalisation:off; post(#AlarmStateOff);                                          Rule.eval("#AlarmStateOff =>  disable(colorShow2); alarmlights:off")  

    $Telegram='Alarm signals switched off '")   

     

     

    Please advice 

     

     

  • Topic Author
  • Posted (edited)
    15 hours ago, Sjakie said:

    Hello Jan,

    Apologize for all my questions but I need your expertise!

    I think I am almost ready with guarding the complex. Found some where here in the discussions use rules from one scene in another. I want to use it but need your advice/comment.

    The proposal for the change of color of my flag hue light I modified a bit and can use it also as red alert light in case alarm status is on!

    Guard the hose scene                                                                                                                woonkamer scene (Hue)

    here I have used on your advice:                                                                                                           Can I use here

    Rule.eval("hal.voordeur:breached & hal.voordeur:armed=='1' =>

    post(#AlarmState); $Telegram='Alarm, hal.voordeur breached'")                                           ule.eval("#AlarmState =>  alarmlights:on; colorIndex2=1; enable(colorShow2)") -- Start show

                                                                                                                                                             Question,  nothing further mentioned or under %%event

                                                                                                                                                                                                                                                 AlarmState  in header?

     

    Must think will become button on VD or something

    Rule.eval("429:btn=1 => signalisation:off; post(#AlarmStateOff);                                          Rule.eval("#AlarmStateOff =>  disable(colorShow2); alarmlights:off")  

    $Telegram='Alarm signals switched off '")   

     

     

    Please advice 

     

     

     

    The way to trigger rules in other scenes is to post an event to them.

    Please login or register to see this code.

    postRemote is like post but sends the event to another scene. Nothing need to be mentioned under %% event header in the  woonkamer scene.

     

    Unfortunately we can't trigger on a VD button being pressed as it doesn't generate any scene triggers (setting labels and sliders do)

    What you can do is put Lua code in the VD button to send the event to the scen,

    Please login or register to see this code.

     

    Edited by jgab
    Posted

    Hallo @jgab need again your advise .  I have a Raspberry Pi running Domoticz (for Oregon weather station RFX433 ), NodeRed, InfluxDB and Grafana. And not on a SD card but an USB-stick. Worked ok for one year but crashed(?) last week. Now I have a Pi with Domoticz and NodeRed, no Grafana,  no InfuxDB. Upgrade also my ER programs to B57. But something must have gone wrong and now I get no response to my ER from NodeRed any longer, not in ZBS and not to the HC2.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

    Please login or register to see this attachment.

  • Topic Author
  • Posted

    Ok,

    Your Pi box (node-red) has IP and port 192.168.1.158:1880 ? (what you have declared ib the ER scene)

    Have you configured the ZBS and the HC2 node urn the upper part of the node-red flow (they are in the upper part in my flow , you may have moved them)

    The ZBS should be configured to the OC running the emulator (http://192.168.1.127)

    and HC2 should be configured to point at your HC2 box.

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