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

Jan, i have tried to use the inbuilt :last property for my purpose, but it seems to not fit my requirements, as PIR sensor do not have this value reported at all. I am attaching the swagger Json too .

They have lastBreached value.

So i decided to create my own property lastBreached and use it 

Please login or register to see this code.

 

 

then used it in our previous example

Please login or register to see this code.

 

but this doesnt work. Throws error

 

Please login or register to see this attachment.

Please login or register to see this attachment.

Posted
14 minutes ago, Neo Andersson said:

Jan, i have tried to use the inbuilt :last property for my purpose, but it seems to not fit my requirements, as PIR sensor do not have this value reported at all. I am attaching the swagger Json too .

They have lastBreached value.

So i decided to create my own property lastBreached and use it 

Please login or register to see this code.

 

 

then used it in our previous example

Please login or register to see this code.

 

but this doesnt work. Throws error

 

Please login or register to see this attachment.

Please login or register to see this attachment.

Okay i realized that :last gives me the same as lastBreached relative to 00:00 i think, but for some reason when i run the test it still lists out a sensor that was breached today at 9:53

 

 

So if i keep using the :last property check, and test it with only one sensor, that i am sure was breached recently it still lists me out that sensor as it was not breached in last 24 hour

 

 

Please login or register to see this code.

 

  • Topic Author
  • Posted
    36 minutes ago, Neo Andersson said:

    Okay i realized that :last gives me the same as lastBreached relative to 00:00 i think, but for some reason when i run the test it still lists out a sensor that was breached today at 9:53

     

     

    So if i keep using the :last property check, and test it with only one sensor, that i am sure was breached recently it still lists me out that sensor as it was not breached in last 24 hour

     

     

    Please login or register to see this code.

     

    :last should be relative to now, the number of seconds since it was last changed.

    Posted
    6 minutes ago, jgab said:

    :last should be relative to now, the number of seconds since it was last changed.

    Jan, the sensor above in the example was last breached / see ot swagger screenshot / at 9:53 today, but it is still listed in the  :devs = [ _:last > 24:00 in SensorsToCheck]

  • Topic Author
  • Posted (edited)
    47 minutes ago, Neo Andersson said:

    Okay i realized that :last gives me the same as lastBreached relative to 00:00 i think, but for some reason when i run the test it still lists out a sensor that was breached today at 9:53

     

    for the sensor that was breached 9:53 and see what you get

    Just now, jgab said:

    for the sensor that was breached 9:53 and see what you get

    test a 

    rule("id:last")

    and see what you get

    Edited by jgab
  • Topic Author
  • Posted
    12 minutes ago, jgab said:

    for the sensor that was breached 9:53 and see what you get

    test a 

    rule("id:last")

    and see what you get

     

    9.53 today, or 9:53 yesterday, or 9:53 last month?

    Posted
    2 minutes ago, jgab said:

     

    9.53 today, or 9:53 yesterday, or 9:53 last month?

    It was definitely today, but i cant cjeck it anymore, as my colleague stepped into that room,..but in previous pics you see it.

    On the other hand, this rule should log either the sensor is longer inactive than 24 or log me that is okay..

    It says uknonwn token type. 

    Last err: [Rule:62:@12:39 => local devs = [ _:last > 24:00,fmt("%s:'%s'++\n",_,_:name) in Sensors..] Parser: unknown token type: rpar || size(devs) == 0 >> log('All devices are okay')) ^

    Isn't the size the right syntax for getting the lenght of a table?

     

     

    Please login or register to see this code.

     

  • Topic Author
  • Posted
    9 minutes ago, Neo Andersson said:

    It was definitely today, but i cant cjeck it anymore, as my colleague stepped into that room,..but in previous pics you see it.

    On the other hand, this rule should log either the sensor is longer inactive than 24 or log me that is okay..

    It says uknonwn token type. 

    Last err: [Rule:62:@12:39 => local devs = [ _:last > 24:00,fmt("%s:'%s'++\n",_,_:name) in Sensors..] Parser: unknown token type: rpar || size(devs) == 0 >> log('All devices are okay')) ^

    Isn't the size the right syntax for getting the lenght of a table?

     

     

    Please login or register to see this code.

     

    Yes, but the last has an additional ')'

    Please login or register to see this code.

     

    • Like 1
    Posted

    Jan if i got this warning ? Seemingly everything works, but for case i show you

     

    Host not found (authoritative) fetching https://raw.githubusercontent.com/jangabrielsson/TQAE/master/jgabs_QAs/Updater/MANIFEST.json

     

     

  • Topic Author
  • Posted
    27 minutes ago, Neo Andersson said:

    Jan if i got this warning ? Seemingly everything works, but for case i show you

    Host not found (authoritative) fetching https://raw.githubusercontent.com/jangabrielsson/TQAE/master/jgabs_QAs/Updater/MANIFEST.json

    Well, it's the hc3 (QAUpdater) that accesses the GitHub server to get the updates info - and couldn't find it...

    I would say that your DNS had a hiccup  - if it was github that was down we would have heard about it ...

    Posted

    Jan, can we use += syntax? Like value += 15  (substitution for value = value + 15)

    I tried inside a rule: ... blind:value += 30, and it threw an error

  • Topic Author
  • Posted
    10 minutes ago, Neo Andersson said:

    Jan, can we use += syntax? Like value += 15  (substitution for value = value + 15)

    I tried inside a rule: ... blind:value += 30, and it threw an error

    You can but not to :value - only to variables, ER variables, $variables, and $$variables (quickAppvariables).

    Because not all :properties have a set version, it's too complex to test.

     

     

     

     

  • Topic Author
  • Posted

    Pushed v0.62

    It's a candidate for v1.0

    Bugfixes and cosmetics.

     

    There is a rule stats that lists the last 10 rule actions in the QA UI.

    There is also a button that lists the last 100 actions (You need to add the button binding to your main)

     

     

    Posted

    Jan, what is the syntax of UI button press call, or UI dropdown select call in ER5

    I still have to define the callbacks as class functions? like

    Please login or register to see this code.

    If not, how to catch a UI button press / like if i have created a button on ER5 interface

    How to cacth dropdown change etc

    I cant find description for ER5 about UI event hanbdling

     

    Thanks

  • Topic Author
  • Posted
    15 hours ago, Neo Andersson said:

    Jan, what is the syntax of UI button press call, or UI dropdown select call in ER5

    I still have to define the callbacks as class functions? like

    Please login or register to see this code.

    If not, how to catch a UI button press / like if i have created a button on ER5 interface

    How to cacth dropdown change etc

    I cant find description for ER5 about UI event hanbdling

     

    Thanks

    Well, it's not recommended to add your own buttons to ER. The reason is that the QAUpdater will restore the interface to the standard and you loose the buttons you have added. 

    I would recommend that you create another QA that serves as the UI and sends commands (events) to ER.

    Posted

    Jan I just see this error don't know when it started to be an error.

    Please login or register to see this code.

     

  • Topic Author
  • Posted (edited)

    badkamer is a number.

    It's a strange expression - it's not a rule because there is no "=>" in the expression.

    So, it will always do all the statements...

    Edited by jgab
    • Like 1
    Posted
    8 hours ago, jgab said:

    Well, it's not recommended to add your own buttons to ER. The reason is that the QAUpdater will restore the interface to the standard and you loose the buttons you have added. 

    I would recommend that you create another QA that serves as the UI and sends commands (events) to ER.

    Okay, rather i have created child devices..i suppose, they wont be affected by Updater right?

  • Topic Author
  • Posted
    10 minutes ago, Neo Andersson said:

    Okay, rather i have created child devices..i suppose, they wont be affected by Updater right?

    No, they won't.

    Posted
    7 minutes ago, Neo Andersson said:

    @jgab Jan why is this error?

    Please login or register to see this code.

     

    [07.12.2023] [19:31:00] [ERROR] [ER1302]: [Rule:188:2]>> [Rule:188:@19:31 => local devs = [ _:last > 24:01,fmt("\n%s ► %s",_,_:name) in Sensors..] Runtime: ./include/utils.lua:37: bad argument #2 to 'insert' (position out of bounds) flsetup

    Sorry, found it.

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