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

Good morning @cag014

This morning at 9:32 two fatal LUA errors occured with AOS 3.1 more then 7 hours after the last change in AOS code.

One of the errors has been notified by e-mail and iPhone push.

There is only 1 Startscene in AOS which scene has run successful the last time at 8:54.

Can I do something in help debugging?

Please login or register to see this attachment.

Please login or register to see this attachment.

Posted

New e-mail:

AOS 3.1 failed at Fri Aug 28 09:32:26 2020 last debug message:

/opt/fibaro/scenes/431.lua;407: attempt to index a nil value

At a closer look the problem has nothing to do with the Startscene because all the debug messages deal with scene 431, that is my ID of AOS 3.1.

Posted

@cag014

I get an error e-mail each 2 hours:

 

the first:

AOS 3.1 failed at Fri Aug 28 09:32:26 2020 last debug message:

/opt/fibaro/scenes/431.lua;407: attempt to index a nil value

 

the following:

AOS 3.1 failed at Fri Aug 28 11:32:28 2020 last debug message:

/opt/fibaro/scenes/431.lua;1358: Assertion failed: Expected string

 

AOS 3.1 failed at Fri Aug 28 13:32:30 2020 last debug message:

/opt/fibaro/scenes/431.lua;1358: Assertion failed: Expected string

 

AOS 3.1 failed at Fri Aug 28 15:32:32 2020 last debug message:

/opt/fibaro/scenes/431.lua;1358: Assertion failed: Expected string

Posted

I am thinking on a race condition, because the DimmerHal light was off after trigger of the PIR:

First setting dimmerlevel of dimmer and then turnOn of the dimmer. But the turnOn could be faster. So I inserted a delay of 0.5 seconds before turnOn the dimmer. Let's see whether the LUA error stops.

 

trueAct={
        --Overdag: Dimlevel = DimlevelOverdag als Constant Hallicht Uit EN LampHal is Uit EN Huisstatus<>Slapen EN weinig licht in hal
          {"`DimmerHal`","setValue,@&DimlevelOverdag>value","","{&ConstantHalLicht:value=0|`LampHal`:value=false|&Huisstatus:value<>Slapen|`LichtHal`:value<40}",false},
        --Avond: Dimlevel = DimlevelAvond als Constant Hallicht Uit EN LampHal is Aan OF Huisstatus=Slapen
        {"`DimmerHal`","setValue,@&DimlevelAvond>value","","{&ConstantHalLicht:value=0|`LampHal`:value=true}|{&ConstantHalLicht:value=0|&Huisstatus:value=Slapen}",false},
           --Altijd Aan als Constant Hallicht Uit
        {"`DimmerHal`","turnOn","0.5","{&ConstantHalLicht:value=0}",false}},

 

BTW: is there a possibility for an inhibit condition of the AOS rules in case of &ConstantHalLicht:value=0, instead of repeating this condition element in each condition?

 

Posted

No improvent:

AOS 3.1 failed at Fri Aug 28 17:32:34 2020 last debug message:

/opt/fibaro/scenes/431.lua;407: attempt to index a nil value

Posted

$24Clock line : turnOn a lot of devices: just some of them were turned on.

 

It seems that AOS is not reliable working any more, what to do?

  • Topic Author
  • Posted
    17 hours ago, Rover said:

    $24Clock line : turnOn a lot of devices: just some of them were turned on.

     

    It seems that AOS is not reliable working any more, what to do?

    What do you mean by turning them ON? I don't see on the last executed commands line.

     

    20 hours ago, Rover said:

    No improvent:

    AOS 3.1 failed at Fri Aug 28 17:32:34 2020 last debug message:

     

    /opt/fibaro/scenes/431.lua;407: attempt to index a nil value

     

    Since code lines different between users (depends on jS2n and jM sizes) could you please post actual lines of errors.

    I mean line 407, 1358 and etc....

     

    Posted
    1 hour ago, cag014 said:

    What do you mean by turning them ON? I don't see on the last executed commands line.

     

    {0, "$24clock",{state="value=0",timeSlot="?$sunsetHour-(60*60)?~",
          trueAct={{"`Huiskamer`|`Librije`|`Keukenlamp`|`AanrechtBijkeuken`|`LampHal`|`RaamGloriaLamp`|`Achtertuin`","turnOn","",false},
            {"`ZonneschermLicht`","turnOn","","{&LEDs_Zonnescherm:value=Aan}"},{"`Kerstboom`|`OmasKast`","turnOn","","{&KerstPeriode:value=Aan}",false},
            {"&ZonsondergangMin1","setGlobal","1"},{"_`RandomLight`","startScene","",false}}}},

     

    Only `Achtertuin`","turnOn", was active last evening.

     

    1 hour ago, cag014 said:

     

    Since code lines different between users (depends on jS2n and jM sizes) could you please post actual lines of errors.

    I mean line 407, 1358 and etc....

     

    AOS 3.1 failed at Sat Aug 29 15:32:57 2020 last debug message:

    /opt/fibaro/scenes/431.lua;407: attempt to index a nil value

    line 407:  if val2get=="modified" or index=="lastBreached" then return getModificationTime(cmd) else return jDlist[index..id] and jDlist[index..id] or tostring(api.get("/devices/"..id.."/properties/"..index)[val2get]) end

     

    AOS 3.1 failed at Sat Aug 29 01:32:43 2020 last debug message:

    /opt/fibaro/scenes/431.lua;1358: Assertion failed: Expected string

    line 1358:  if autoRestart then homeTts("Warning! "..sceneName.." failed and restarted");fibaro:startScene(__fibaroSceneId,{"restart"});fibaro:setGlobal(gData.webVar,"<font color=red>Scene failed and restarted</font>")
     

  • Topic Author
  • Posted

    OK,

    I think two errors I have fixed.

    Now could you post your jM{} array...

    Posted

    jM={
    --Licht Hal
    {0,"`BewegingHal`",{state="value=true",
        trueAct={
            --Overdag: Dimlevel = DimlevelOverdag als Constant Hallicht Uit EN LampHal is Uit EN Huisstatus<>Slapen EN weinig licht in hal
              {"`DimmerHal`","setValue,@&DimlevelOverdag>value","","{&ConstantHalLicht:value=0|`LampHal`:value=false|&Huisstatus:value<>Slapen|`LichtHal`:value<40}",false},
            --Avond: Dimlevel = DimlevelAvond als Constant Hallicht Uit EN LampHal is Aan OF Huisstatus=Slapen
            {"`DimmerHal`","setValue,@&DimlevelAvond>value","","{&ConstantHalLicht:value=0|`LampHal`:value=true}|{&ConstantHalLicht:value=0|&Huisstatus:value=Slapen}",false},
               --Altijd Aan als Constant Hallicht Uit
            {"`DimmerHal`","turnOn","0.5","{&ConstantHalLicht:value=0}",false}},
        falseAct={
            --Save DimlevelOverdag als Constant Hallicht Uit EN LampHal is Uit EN Huisstatus<>Slapen
            {"&DimlevelOverdag","setGlobal","@`DimmerHal`>value","{&ConstantHalLicht:value=0|`LampHal`:value=false|&Huisstatus:value<>Slapen}",false},
            {"&DimlevelOverdag","setGlobal","50","{&ConstantHalLicht:value=0|`LampHal`:value=false|&Huisstatus:value<>Slapen|`DimmerHal`:value=0}",false},
            --Save DimlevelAvond als Constant Hallicht Uit EN LampHal is Aan OF Huisstatus=Slapen
            {"&DimlevelAvond","setGlobal","@`DimmerHal`>value","{&ConstantHalLicht:value=0|`LampHal`:value=true}|{&ConstantHalLicht:value=0|&Huisstatus:value=Slapen}",false},
               {"&DimlevelAvond","setGlobal","49","{&ConstantHalLicht:value=0|`LampHal`:value=true|`DimmerHal`:value=0}|{&ConstantHalLicht:value=0|&Huisstatus:value=Slapen|`DimmerHal`:value=0}",false},
            --Altijd Uit als Constant Hallicht Uit
            {"`DimmerHal`","turnOff","","{&ConstantHalLicht:value=0}",false}}}},
    --Licht Hal Manueel
    {0,"`DimmerHal`",{state="sceneActivation=10",
          -- 1x op Omhoog klikken
          trueAct={ {"&ConstantHalLicht","setGlobal","1"},{"`DimmerHal`","setValue,99",""},{"`DimmerHal`","turnOff","1*60",false},{"&ConstantHalLicht","setGlobal","0"},{"Dimmerlicht","sendEmail[2]","SceneActivation 10: 1x op Omhoog klikken"} } }},
    {0,"`DimmerHal`",{state="sceneActivation=11",
          -- 1x op Omlaag klikken
          trueAct={ {"&ConstantHalLicht","setGlobal","0"},{"`DimmerHal`","turnOff","",false},{"Dimmerlicht","sendEmail[2]","SceneActivation 11: 1x op Omlaag klikken"} } }},
    --Licht Overloop
    {0,"`BewegingOverloop`",{state="value=true",
          trueAct={{"`Schilderijspot`","turnOn","",false},{"`SpotsTrapOverloop`","turnOn","","{&Huisstatus:value<>Slapen}",false}},
             falseAct={{"`Schilderijspot`|`SpotsTrapOverloop`","turnOff","",false}}}},
    --GIA
    {0,"`BewegingHal`",{state="value=true",
          trueAct={{"`GIA`","turnOn","",false}},
             falseAct={{"`GIA`","turnOff","",false}}}},

    {0,"`BewegingOverloop`",{state="value=true",
          trueAct={{"`GIA`","turnOff","","{`BewegingHal`:value=true}",false},{"`GIA`","turnOn","0.4","{`BewegingHal`:value=true}",false},
            {"`GIA`","turnOff","1.1","{`BewegingHal`:value=true}",false}}}}, --korter dan 0,4 en 1,1 sec. gaat niet, want dat kan de switch niet bijhouden

    --Waterval
    {0, "$24clock",{state="value=0",timeSlot="10:00~,~22:00",
          trueAct={{"`Watervall`","turnOn","","{&Waterval:value=Aan}",false},{"&ZonsondergangMin1","setGlobal","0",false},{"Waterval","sendEmail[2]","Waterval aan"}},
          falseAct={{"`Watervall`","turnOff","",false},{"Waterval","sendEmail[2]","Waterval uit"}}}},

    --Centrale verlichting

    {0, "$24clock",{state="value=0",timeSlot="?$sunsetHour-(60*60)?~",
          trueAct={{"`Huiskamer`|`Librije`|`Keukenlamp`|`AanrechtBijkeuken`|`LampHal`|`RaamGloriaLamp`|`Achtertuin`","turnOn","",false},
            {"`ZonneschermLicht`","turnOn","","{&LEDs_Zonnescherm:value=Aan}"},{"`Kerstboom`|`OmasKast`","turnOn","","{&KerstPeriode:value=Aan}",false},
            {"&ZonsondergangMin1","setGlobal","1"},{"_`RandomLight`","startScene","",false}}}},
    {0,"&LichtenAanManueel",{trigAct={"`GIA`","turnOn",""}}},
    {0, "$24clock",{state="value=0",timeSlot="?00:00+(60*60)?~,~03:00",
          trueAct={{"`Huiskamer`|`Librije`|`Keukenlamp`|`Bijkeuken`|`LampHal`|`RaamGloriaLamp`|`Achtertuin`|`ZonneschermLicht`|`TuinFlood`","turnOff","","{&Huisstatus:value=Weg}",false},{"&ZonsondergangMin1","setGlobal","0",false},{"Weg: Lichten Uit","sendEmail[2]","Weg: Alle Lichten Uit","{&Huisstatus:value=Weg}"}},
          falseAct={{"`Huiskamer`|`Librije`|`Keukenlamp`|`Bijkeuken`|`LampHal`|`RaamGloriaLamp`|`Achtertuin`|`ZonneschermLicht`|`TuinFlood`","turnOff","","{`LampenSchouw`:value=true}",false},{"&ZonsondergangMin1","setGlobal","0",false},{"Thuis: Lichten Uit","sendEmail[2]","Thuis: Alle Lichten Uit","{`LampenSchouw`:value=true}"}}}},
     
    --System Keys
    {0, "$RAM",{state="value>85",trueAct={{"RAM>85%","sendNote","Warning. \nSystem memory is $RAM% ",true},{"|$lineId|","setStateValue","80"}},falseAct={{"|$lineId|","setStateValue","85"},{"RAM<80%","sendNote","System memory is $RAM%"}}}},
    {0, "$HC2onLine",{state="value=true",trueAct={"","tts","$dayTime, Home center is on line"},falseAct={"","tts","$dayTime, Home center is off line"}}},
    {0, "$internet",{state="value=online",trigAct={"","tts","$dayTime, Internet is $internet"}}},

  • Topic Author
  • Posted
    On 8/28/2020 at 5:11 PM, Rover said:

    BTW: is there a possibility for an inhibit condition of the AOS rules in case of &ConstantHalLicht:value=0, instead of repeating this condition element in each condition?

     

    Yes, but only if the entire line ( I mean all commands) needs same condition.

    You can use lineState="{....}" as a rule. The format is exactly the same as in conditions.

    {0,"470",{lineState="{&ConstantHalLicht:value=0}", state="vlue=xxx",trueAct={..............}...}}},

    The code checks lineState first and if it's OK the checks all other conditions.

     

  • Topic Author
  • Posted

    Another suggestion... I see in your jM{} you're trying not to execute all commands on startup by using false parameter in all of them.

    You can use rule initOnStartup=false and entire line won't be executed on startup.

    {0,"XXX","{InitOnStartup=false, state="value=xxx",trueAct={...}, falseAct={...}}},

     

    The idea of false parameter in actions table it's if only you need to avoid execution of specific command on startup.

    Posted

    Hi @cag014,

    I learn a lot from you ?

    Adding all these practical tips in the guides can teach/helps others too.

  • Topic Author
  • Posted (edited)

    I think I have found the issue... the usage of @[DEVID]>[property] format is for devices only!

    You're using same format for variables:

    @&DimlevelOverdag>value

    For variable just use variable name

    &DimlevelOverdag

     

    Will set a note in documentation.

    Please try it and let me know if it works w/o errors.

    For next release will check that as well.

    Edited by cag014
    Posted
    13 minutes ago, cag014 said:

    I think I have found the issue... the usage of @[DEVID]>[property] format is for devices only!

    You're using same format for variables:

    @&DimlevelOverdag>valu

    For variable just use variable

    &DimlevelOverdag

     

    Will seat a note in documentation.

    Please try it and let me know if it works w/o errors.

    For next release will check that as well.

    I have repaired the issues. Let's hope on good working.

    Posted
    1 hour ago, cag014 said:

    Yes, but only if the entire line ( I mean all commands) needs same condition.

    You can use lineState="{....}" as a rule. The format is exactly the same as in conditions.

    {0,"470",{lineState="{&ConstantHalLicht:value=0}", state="vlue=xxx",trueAct={..............}...}}},

    The code checks lineState first and if it's OK the checks all other conditions.

     

    {0,"`BewegingHal`",{lineState="{&ConstantHalLicht:value=0}",state="value=true",
        trueAct={

    Please login or register to see this spoiler.

     

  • Topic Author
  • Posted
    8 minutes ago, Rover said:

    {0,"`BewegingHal`",{lineState="{&ConstantHalLicht:value=0}",state="value=true",
        trueAct={

    Please login or register to see this spoiler.

    Sorry, my bad

    lineState={"{&ConstantHalLicht:value=0}"}

    Posted
    1 hour ago, cag014 said:

    Another suggestion... I see in your jM{} you're trying not to execute all commands on startup by using false parameter in all of them.

    You can use rule initOnStartup=false and entire line won't be executed on startup.

    {0,"XXX","{InitOnStartup=false, state="value=xxx",trueAct={...}, falseAct={...}}},

     

    The idea of false parameter in actions table it's if only you need to avoid execution of specific command on startup.

    {0,"`BewegingHal`",InitOnStartup=false,{state="value=true",

    Please login or register to see this image.

    /monthly_2020_08/screenshot(3).png.264582736c4fba1b996a014ff24cf2cb.png" />

  • Topic Author
  • Posted
    Just now, Rover said:

    {0,"`BewegingHal`",InitOnStartup=false,{state="value=true",

    Please login or register to see this link.

     

    it should be part of the rules and action table.

    see my example

    {0,"XXX", InitOnStartup=false, state="value=xxx",trueAct={...}, falseAct={...}}},

    Posted
    4 minutes ago, cag014 said:

     

    it should be part of the rules and action table.

    see my example

    {0,"XXX", InitOnStartup=false, state="value=xxx",trueAct={...}, falseAct={...}}},

    {0,"`BewegingHal`",{InitOnStartup=false,lineState={"{&ConstantHalLicht:value=0}"},state="value=true",

    Please login or register to see this image.

    /monthly_2020_08/screenshot(4).png.dc36cc7027717a431bbd758367c0e357.png" />

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