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

55 minutes ago, ChristianSogaard said:

Its strange what happend - but i follow you now

What about this? This also used to work . but now i got tokenizer failed at  & keyPrim 

 

i looks like that central.keyId is not working anymore

 

Please login or register to see this code.

matrix4Alarm = 439 -- Device for (Dis)arming the alarm
rule([[matrix4Alarm:central & keyPrim =>
     post({type=fmt('%s_%s_%s',keyPrim,matrix4Alarm:central.keyId,matrix4Alarm:central.keyAttribute)}); 
     keyPrim=nil
]])

 

Error in 'matrix4Alarm:central & keyPrim =>      post({type=fmt('%s_%s_%s',keyPrim,matrix4Alarm:central.keyId,matrix4Alarm:central.keyAttribute)});       keyPrim=nil ': ./include/EventRunner.lua:1649: attempt to index a nil value (local 'e')

 

Something has for sure changed in EV4 ? - 

central is not working anymore - seems to be replaced with centralSceneEvent.

Setting variable keyPrim=nil  seems to not work anymore

Link to comment
Share on other sites

  • Topic Author
  • 19 hours ago, Sjakie said:

    Check your line 66 and 68 wrong character

    //Sjakie

     

    Yes, @Sjakie is on to something here.

    You have inserted unicode characters in your file - probably using some editor with unicode and cut&paste to the HC3 editor.

    The dreaded error

    Please login or register to see this code.

     

    says that it sees the character 194 (that is the first byte of a 2 byte unicode character) and it's not allowed and the QA crashes. It crashes as soon as the HC3 tries to load the QA code.

     

    If I run this short lua program that fetches your QA (570) and searches the code for 194 (0xC2) 

     

    Please login or register to see this code.

     

    I get a lot of 194,160 unicode combos in the code. It's not a problem in  comment or strings but in code it will make the Lua crash.

    Please login or register to see this code.

     

    • Thanks 1
    Link to comment
    Share on other sites

    Thank you Jan

     

    But what about this ? - this is not character 194 

     

    [19.09.2021] [11:34:25] [DEBUG] [QUICKAPP1268]: tokenizer failed at  =>   || 1:alarm.armed >> 1:alarm=false; log('disarming 1'); log('#Disarmed from Matrix as Keypad');  || !1:alarm.armed >> 1:alarm=true; log('arming 1'); log('#Armed from Matrix as Keypad');
    [19.09.2021] [11:34:25] [DEBUG] [QUICKAPP1268]: #Key439_2_Pressed3_4_Pressed2 => 
     || 1:alarm.armed >> 1:alarm=false; log('disarming 1'); log('#Disarmed from Matrix as Keypad');
     || !1:alarm.armed >> 1:alarm=true; log('arming 1'); log('#Armed from Matrix as Keypad');
     = {"type":"Key439_2_Pressed3_4_Pressed2"}

    Link to comment
    Share on other sites

  • Topic Author
  • If 194 has sneaked into a string it may not match the string you expect.

    If I run this program that patches all "Non-breaking spaces" \xC2\xA0 to regular spaces in your QA, the QA loads.

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    11 minutes ago, jgab said:

    If 194 has sneaked into a string it may not match the string you expect.

    If I run this program that patches all "Non-breaking spaces" \xC2\xA0 to regular spaces in your QA, the QA loads.

    Please login or register to see this code.

     

    not like this? - you mean in zerobrane studio?

    Please login or register to see this attachment.

     

    3 minutes ago, ChristianSogaard said:

    not like this? - you mean in zerobrane studio?

    Please login or register to see this attachment.

     

    Jan ... you are the man ?. I truly dont know what I should do without your assistance ?

    • Like 2
    Link to comment
    Share on other sites

    7 hours ago, ChristianSogaard said:

    Jan ... you are the man ?. I truly dont know what I should do without your assistance ?

     well i second that !!!!! One of the reasons we keep on using HC3 is Jan !!! 

    • Like 2
    • Thanks 2
    Link to comment
    Share on other sites

    Please login or register to see this code.

    Is there a way to create a rule like this - using this HT Structure - so the rule run if one of the three sensores is breached.


    rule("terasse.lille:breached  => terasse.lille.lys:on; lilleTerrasseBreachedORManuelt=true")

     

    Link to comment
    Share on other sites

  • Topic Author
  • 18 minutes ago, ChristianSogaard said:

    Please login or register to see this code.

    Is there a way to create a rule like this - using this HT Structure - so the rule run if one of the three sensores is breached.


    rule("terasse.lille:breached  => terasse.lille.lys:on; lilleTerrasseBreachedORManuelt=true")

     

    The problem is that terasse.lille is a key-value table, and the rule needs an array

    You could define something like

    Please login or register to see this code.

    I'm unsure what terasse.lille.lys is as it is not part of your HT.

    • Thanks 1
    Link to comment
    Share on other sites

    Good morning Jan, 

    Regalar I have an error about

    Please login or register to see this code.

    If I exucute this rule now it does not generate an error.

    Why I get that error at 23:37?

    Rule:

    Please login or register to see this code.

    Please advice,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 31 minutes ago, Sjakie said:

    Good morning Jan, 

    Regalar I have an error about

    Please login or register to see this code.

    If I exucute this rule now it does not generate an error.

    Why I get that error at 23:37?

    Rule:

    Please login or register to see this code.

    Please advice,

    //Sjakie

    Some device, in stekkers or the other tables are not a device that not have a value property that is a number or boolean (i.e. not a switch/dimmer type). Check your device IDs. I would guess that it's in stekkers?

    Link to comment
    Share on other sites

    Jan,

    why it give sometimes an error and not always?

    I have plugs as;

    -binary switch>>Other brand

    -wallplug>>Fibaro

     

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 32 minutes ago, Sjakie said:

    Jan,

    why it give sometimes an error and not always?

    I have plugs as;

    -binary switch>>Other brand

    -wallplug>>Fibaro

     

    //Sjakie

    Can be different reasons.

    Ex. a device, 99,  that always cause an error because it's value property is nil.

    But your test looks like

    {88, 99}:isOn

    where is returns true when 88 is on and never goes on to test 99. When 88 is off then it will test 99 and you get the error.

     

    Can also be that you have a broken device that sometimes return nil for fibaro.getValue(99,"value")

     

    If you have a device that you suspect you could make a rule like this that check it every 10s

    rule("@@00:00:10 & 99:value == nil => log('ERROR: Device 99 returns nil for value!!!')")

    Link to comment
    Share on other sites

    Jan, 

    Thank you!

    I adapted my QA lets see what is comming out.

    //Sjakie

     

    Link to comment
    Share on other sites

    Jan,

     

    I saw in the other thread something about batteries.

    Is it possible for you in ER 4 to get warning(Push notification) empty batterie?

    In HC3  Fibaro gives me the notification but only the name and not the room so I need to scroll to device list to discover wich device needs replacement.

    It should be also nice to set the percentage for warning manually, if I am at home 5% and if we go on holiday I can manually change % so I dont have empty bats if we are gone.

    Thanks in advance,

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • Well, devices do report property 'batteryLevel' changes. Something like this would work

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    Jan, getting an error

    Please login or register to see this code.

    Please login or register to see this code.

    941= doorsensor

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 2 hours ago, Sjakie said:

    Jan, getting an error

    Please login or register to see this code.

    Please login or register to see this code.

    941= doorsensor

    //Sjakie

    Sorry, Lua variables that we want to be used inside rules can't be local.

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

    Hello Jan,

    Its not working!

    Please login or register to see this code.

    592,608 value  < 45%   650=0%

    there is after 24 hours no log or push message

    Please advice,

    //Sjakie

    Jan here I have some difficulties to let the HUE color change

    Please login or register to see this code.

    If I post #concentratie no change in color.

    What am I doing wrong?

    //Sjakie

    Link to comment
    Share on other sites

  • Topic Author
  • 1 hour ago, Sjakie said:

    Hello Jan,

    Its not working!

    Please login or register to see this code.

    592,608 value  < 45%   650=0%

    there is after 24 hours no log or push message

    Do you get any batteryLevel events?

    rule([[#device{id=devices,property='batteryLevel'} => log("BatteryLevel event:%s",env.event)")

    The rule will only run when a  device report a battery change.

    You could prime it at startup

    rule("for _,d in pairs(devices) do post(#device{id=d,property='batteryLevel',value=d:bat}) end")

     

     

    1 hour ago, Sjakie said:

    Jan here I have some difficulties to let the HUE color change

    Please login or register to see this code.

    If I post #concentratie no change in color.

    What am I doing wrong?

    //Sjakie

     

    This rule does not work. You can only trigger on #event at left side of <=

    You are trying to do too many things in one rule....

     

    Link to comment
    Share on other sites

    Jan, fixed

    Please login or register to see this code.

    Error was in push>>user wast defined (lost it somewhere).

    Thanks,

    //Sjakie

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