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

    You could do something like this

    Please login or register to see this code.

    When the variable 'contactSpec' is set to a value it overrides what DayControl is set to. When contectSpec is set to false or nil it will trigger the rules again but it will use the DayControl.

    post #alarmOn and #alarmOff to set the alarm colors and go back to the DayControl colors. etc.

    Posted (edited)
    3 hours ago, jgab said:

    You could do something like this

    Please login or register to see this code.

    When the variable 'contactSpec' is set to a value it overrides what DayControl is set to. When contectSpec is set to false or nil it will trigger the rules again but it will use the DayControl.

    post #alarmOn and #alarmOff to set the alarm colors and go back to the DayControl colors. etc.

     

    Thank You Jan - im not sure that this will work.

    eg. when the alarm LED are enabled, that would be Led 29,31,33,35,996,998,1000,1002 in rooms.common showing blink red..

    so 29,31,33,35,996,998,1000,1002 need to be immune for next DayControl change...

     

    Perhaps i should have a rooms.alarm, and Rooms CO2, and then move the 996,998,1000,1002 from rooms.common to rooms alarm when alarm is armed ?

     

    rooms = {
                    all         = {996,998,1000,1002,101,103,105,107,137,139,141,143,77,79,81,83,113,115,117,119,53,55,57,59,161,163,165,167,89,91,93,95,245,247,249,251,221,223,225,227,185,187,189,191,125,127,129,131,173,175,177,179,41,43,45,47,416,418,420,422,65,67,69,71,149,151,153,155,29,31,33,35},
                    rooms       = {101,103,105,107,89,91,93,95,125,127,129,131},
                    baths       = {161,163,165,167,185,187,189,191},
                    common      = {996,998,1000,1002,137,139,141,143,77,79,81,83,113,115,117,119,53,55,57,59,245,247,249,251,221,223,225,227,173,175,177,179,41,43,45,47,416,418,420,422,65,67,69,71,149,151,153,155,29,31,33,35},
                 }

     

    Edited by ChristianSogaard
    Typo
    Posted
    On 12/26/2023 at 9:49 AM, jgab said:

    Please login or register to see this code.

     

    This will create a fibaro global GasCounter if it doesn't already exist.

    Every night at 23:59:55 it will record date, total consumption and daily consumption.

    The first day you run it, it will only get a total and not a daily.

    GasCounter will be a Lua list with

    { {date = <date>, total=<value>, daily=<value>}, {date = <date>, total=<value>, daily=<value>},...

    sorted so that the most recent date is first in the list.

    If the list exceeds 360 entries it starts to prune the oldest dates from the list.

    Hi Jan

     

    Just wondering. iRules has been running for two nights but GasCounter is still empty

    I dont have any logs, as they are overwritten

    Please login or register to see this attachment.

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

    Hi Jan

     

    Just wondering. iRules has been running for two nights but GasCounter is still empty

    I dont have any logs, as they are overwritten

    Please login or register to see this attachment.

    Oops, this rule

    Please login or register to see this code.

    will set GasCounter to {} every time you restart ER... ;-)

    Well, just remove the rule...

    • Like 1
    Posted (edited)
    22 hours ago, ChristianSogaard said:

     

    Thank You Jan - im not sure that this will work.

    eg. when the alarm LED are enabled, that would be Led 29,31,33,35,996,998,1000,1002 in rooms.common showing blink red..

    so 29,31,33,35,996,998,1000,1002 need to be immune for next DayControl change...

     

    Perhaps i should have a rooms.alarm, and Rooms CO2, and then move the 996,998,1000,1002 from rooms.common to rooms alarm when alarm is armed ?

     

    rooms = {
                    all         = {996,998,1000,1002,101,103,105,107,137,139,141,143,77,79,81,83,113,115,117,119,53,55,57,59,161,163,165,167,89,91,93,95,245,247,249,251,221,223,225,227,185,187,189,191,125,127,129,131,173,175,177,179,41,43,45,47,416,418,420,422,65,67,69,71,149,151,153,155,29,31,33,35},
                    rooms       = {101,103,105,107,89,91,93,95,125,127,129,131},
                    baths       = {161,163,165,167,185,187,189,191},
                    common      = {996,998,1000,1002,137,139,141,143,77,79,81,83,113,115,117,119,53,55,57,59,245,247,249,251,221,223,225,227,173,175,177,179,41,43,45,47,416,418,420,422,65,67,69,71,149,151,153,155,29,31,33,35},
                 }

     

    Hei Jan

    (contactSpec | $DayControl) == 'Wake-up' 

    This is an OR rule, right ? contactSpec OR $DayControl == Wake-up ?

    I understand the triggervar the .start() ect but not the When the variable 'contactSpec' is set to a value it overrides what DayControl is set to.

     

    if rule([[(contactSpec | $DayControl) run at 0800 because $DayContro is triggered and contactSpec = CO2 then both are true, right , but only equal to one thing ? - that will not be an overrride, 

     

     

     

    Edited by ChristianSogaard
    Typo
    Posted
    On 12/21/2023 at 1:43 PM, jgab said:

    Please login or register to see this code.

     

    Please login or register to see this code.

    @jgab Jan this throws me errors..i dont understand it

    [Rule:101:#ERerror{id='$id', msg='$msg'} => installerUser:msg = msg:gsub(' ',' '):g..] Runtime: table is 'string' for array reference
    #ERerror{id='$id', msg='$msg'} => installerUser:msg = msg:gsub(' ',' '):gsub('

     

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

     

    Sorry, bug. Pushed v0.95 with a fix.

    Posted

    @jgab Jan is there a way to use variable defined in a rule as a LUA global variable?

     

    i have a variable installerUser that is both used in rules and in other functions. Should i create it twice?

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

    @jgab Jan is there a way to use variable defined in a rule as a LUA global variable?

     

    i have a variable installerUser that is both used in rules and in other functions. Should i create it twice?

    Lua global variables can be read from within rules but you can't assign them values from within rules.

    Posted (edited)

    Please login or register to see this code.

     

    Jan, I had a typo

    ER5 disabled rule correctly?

    Quick App crashes

    Unknown Error

     

    I can't imagine it's ER5 should be Fibaro

    btw this QA crashes on a regulary base and according debug no further errors.

    Edited by Sjakie
  • Topic Author
  • Posted (edited)
    16 minutes ago, Sjakie said:

    Please login or register to see this code.

     

    Jan, I had a typo

    ER5 disabled rule correctly?

    Quick App crashes

    Unknown Error

     

    I can't imagine it's ER5 should be Fibaro

    btw this QA crashes on a regulary base and according debug no further errors.

    'oonkamer' is nil. Should it be 'woonkamer' ?

    Edited by jgab
    Posted

    Yes I corrected the typo but this was to inform you QA crash after rule disabled.

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

    Yes I corrected the typo but this was to inform you QA crash after rule disabled.

    Ah, ok. It's ~1min30s afterwards so it may be a coincidence... I'm keeping my eyes open to see if it happens to me too but nothing yet. Are you running short of memory?

    Posted

     

    At this moment not at all.

    usage 56% buffer 7% cache 27% free 10%

    it's higher as earlier  usage around 49%

     

    Jan how I can get in debug the value if it change 0.1 degree?

    Please login or register to see this code.

     

  • Topic Author
  • Posted

    Please login or register to see this code.

     

    Posted

    Jan, can you check my QA1442? It's giving me now almost every time QA crash after saving, around 10 times this morning?

  • Topic Author
  • Posted
    1 minute ago, Sjakie said:

    Jan, can you check my QA1442? It's giving me now almost every time QA crash after saving, around 10 times this morning?

    Ok, PM me the QA

    Posted

    @jgabHelloo Jan

    I am looking for some functions, abbreviations in ER5

     

    1.  getting gateway name (master)

    2. sending email / probably only to admin's email

    3. getting device parentID/parentName (if device has any)

     

    I have created custom functions for them, but if they are in ER5,i will use them rather,.

    Posted
    On 12/28/2023 at 8:40 AM, ChristianSogaard said:

    Hei Jan

    (contactSpec | $DayControl) == 'Wake-up' 

    This is an OR rule, right ? contactSpec OR $DayControl == Wake-up ?

    I understand the triggervar the .start() ect but not the When the variable 'contactSpec' is set to a value it overrides what DayControl is set to.

     

    if rule([[(contactSpec | $DayControl) run at 0800 because $DayContro is triggered and contactSpec = CO2 then both are true, right , but only equal to one thing ? - that will not be an overrride, 

     

     

     

    Hi Jan - i tried trigger the rule to check the logs :-) 

    Im getting 

    Runtime: calling 'false' - wrong number of arguments to 'insert'

     

    [29.12.2023] [22:41:55] [TRACE] [ER2059]: [Rule:2:1]>> TRUE #daily{2} -> @22:41:55 => local gc = $GasCounte..
    [29.12.2023] [22:41:55] [ERROR] [ER2059]: [Rule:2:1]>> [Rule:2:@22:41:55 => local gc = $GasCounter; local today = {date=osdate("%Y-%m-%d"), total=GAS_ID:value}; table.insert(gc,1,today); if size(gc) > 1 then today[1].daily = today.total - gc[2].total end; if si..] Runtime: calling 'false' - wrong number of arguments to 'insert'
         table.insert(gc,1,today);
               ^^^^^^

    Posted

    Jan in General tab there is an option to export data.

    Can I activate it in ER5?

    If yes is it also possible that timestamp can be a date I can read?

    Thanks

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