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
22 hours ago, Neo Andersson said:

This says that garageport device is either missing or has wrong id given in HT table

 

Tanx  i found the problem  .. speling mistake :)    

Posted

Jan, sometimes I modify QA and make a mistake and not always I get error.So QA will stop without me notice it directly only when I discover some rules are not executing.

I created in each ER5 QA 

Please login or register to see this code.

In QA 1565

Please login or register to see this code.

Please login or register to see this code.

or is there a better way to do?

Thanks in advance

Posted

Awesome work Jan. ER5 prompted me to finally get to work on Fibaro automation.

Tried getting Terminal 5 working, getting this error:
 

[2024-08-31] [14:28:27] [TRACE] [QA_ER5_693]: onAction: {"deviceId":693,"manual":true,"args":["elog('%l',[_:isOn in devices])"],"actionName":"eval"}
[2024-08-31] [14:28:27] [DEBUG] [QA_ER5_693]: ./include/engine.lua:276: attempt to call a nil value (local 'e_pcall')
[2024-08-31] [14:28:27] [ERROR] [QUICKAPP693]: QuickApp crashed
[2024-08-31] [14:28:27] [ERROR] [QUICKAPP693]: Unknown error occurred: handleJsonRpc

  • Topic Author
  • Posted

    Terminal 5 probably needs an update as ER5 has evolved a bit since I last looked at it. Will see if I get some time next week to fix it…

    • Like 1
    • Thanks 1
    Posted (edited)
    On 8/29/2024 at 1:12 PM, Sjakie said:

    Jan, sometimes I modify QA and make a mistake and not always I get error.So QA will stop without me notice it directly only when I discover some rules are not executing.

    I created in each ER5 QA 

    Please login or register to see this code.

    In QA 1565

    Please login or register to see this code.

    Please login or register to see this code.

    or is there a better way to do?

    Thanks in advance

    Hi @Sjakie. I am using this little line for Error catching, and it is really helpful.. Using this you will always get en error message to you phone and email , if some error occours. I used to create a kinda installerUser user on all my customre's systems, so i have a user ID for myself everywhere, and so if some error come up, i get notification to my mobile, and i can quickly react.

     

    Please login or register to see this code.

     

    Edited by Neo Andersson
    • Like 1
    Posted (edited)

    @Neo Andersson, thank you very much!

    If I add your rule the result is:

    Please login or register to see this code.

     

    Excellent!

    Edited by Sjakie
    Excellent!
    Posted (edited)

    @jgab Jan, i have a little complex question..

     

    I need to store values from a sensor into a table, and later in other rule use the average of these measurments. The problem is, i need only 10 measurements, so when there is already 10 values in the table, and a new is coming, i want the oldest one to be removed, and so i will get always the 10 last measurement's average..

     

    My approach was so far

    Please login or register to see this code.

    any idea please?

    Edited by Neo Andersson
    Posted
    9 hours ago, Neo Andersson said:

    @jgab Jan, i have a little complex question..

     

    I need to store values from a sensor into a table, and later in other rule use the average of these measurments. The problem is, i need only 10 measurements, so when there is already 10 values in the table, and a new is coming, i want the oldest one to be removed, and so i will get always the 10 last measurement's average..

     

    My approach was so far

    Please login or register to see this code.

    any idea please?


    I did somthing like this once xD

    But I guess it is ineffective 😅 

     

    function update_values()
    self.store.line10 = self.store.line9
    self.store.line9 = self.store.line8
    self.store.line8 = self.store.line7
    self.store.line7 = self.store.line6
    self.store.line6 = self.store.line5
    self.store.line5 = self.store.line4
    self.store.line4 = self.store.line3
    self.store.line3 = self.store.line2
    self.store.line2 = self.store.line1
    self.store.line1 = hub.getValue(Sensorid, "value")
    end
     
    function QuickApp:setupStorage()
       local storage,qa = {},self
       function storage:__index(key) return qa:internalStorageGet(key) end
       function storage:__newindex(key,val)
          if val == nil then qa:internalStorageRemove(key)
          else qa:internalStorageSet(key,val) end
        end
       return setmetatable({},storage)
    end


    @Neo Andersson, the setupstorage is somthing jgab have made. It stores the data for restarts to :D 



     

    • Thanks 1
    Posted

    Hi @Neo Andersson ,

     

    Since this is very small table array with only 10 values, you can use LUA functions table.insert and table.remove. For example, you have table:

    Please login or register to see this code.

    To add new value to the beginning of the table:

    Please login or register to see this code.

    and table will be:

    Please login or register to see this code.

    to remove last value:

    Please login or register to see this code.

    to get:

    Please login or register to see this code.

     

    Why I mention that this two functions are good for small table arrays, maybe up to few hundred values? Because this function needs to move other values in the array when adding or removing one value depending on its position in the array.

    Posted
    8 minutes ago, Sankotronic said:

    Hi @Neo Andersson ,

     

    Since this is very small table array with only 10 values, you can use LUA functions table.insert and table.remove. For example, you have table:

    Please login or register to see this code.

    To add new value to the beginning of the table:

    Please login or register to see this code.

    and table will be:

    Please login or register to see this code.

    to remove last value:

    Please login or register to see this code.

    to get:

    Please login or register to see this code.

     

    Why I mention that this two functions are good for small table arrays, maybe up to few hundred values? Because this function needs to move other values in the array when adding or removing one value depending on its position in the array.

    Yeah i know this, but thanks anyway..as you see i tried to use some Jgabs inbuilt table functions, but the  <adde> function doesnt seem to work for me...

    Posted
    15 minutes ago, Sankotronic said:

    Hi @Neo Andersson ,

     

    Since this is very small table array with only 10 values, you can use LUA functions table.insert and table.remove. For example, you have table:

    Please login or register to see this code.

    To add new value to the beginning of the table:

    Please login or register to see this code.

    and table will be:

    Please login or register to see this code.

    to remove last value:

    Please login or register to see this code.

    to get:

    Please login or register to see this code.

     

    Why I mention that this two functions are good for small table arrays, maybe up to few hundred values? Because this function needs to move other values in the array when adding or removing one value depending on its position in the array.

     

     

    This is what I should have used i Guess? 😅

     

     

    Posted (edited)

    @jgabCan Eventrunner 5 be used in HC3L?

    Edited by lux
    Posted
    On 9/6/2024 at 6:15 PM, lux said:

    @jgabCan Eventrunner 5 be used in HC3L?

    JGAB is probably busy, but i can answer this...YES you can use it

    Posted (edited)

    Please login or register to see this code.

     

    i user it in Hc3l,the wait(1) debug display :wait 00:00:00,but hc3 is OK

    [11.09.2024] [17:09:04] [TRACE] [QUICKAPP214]: [Rule:9:2]>> FALSE #device{id=110,val.. -> remote_xican_l:central.keyAttribute == ..
    [11.09.2024] [17:09:07] [TRACE] [QUICKAPP214]: [Rule:9:2]>> suspended triggered - wait 00:00:00
    [11.09.2024] [17:09:10] [TRACE] [QUICKAPP214]: [Rule:9:2]>> suspended triggered - wait 00:00:00
    [11.09.2024] [17:09:13] [TRACE] [QUICKAPP214]: [Rule:9:2]>> suspended triggered - wait 00:00:00
    [11.09.2024] [17:09:17] [TRACE] [QUICKAPP214]: [Rule:9:2]>> suspended triggered - wait 00:00:00
     

    Edited by lux
    Posted (edited)
    1 hour ago, lux said:

    Please login or register to see this code.

     

    i user it in Hc3l,the wait(1) debug display :wait 00:00:00,but hc3 is OK

    [11.09.2024] [17:09:04] [TRACE] [QUICKAPP214]: [Rule:9:2]>> FALSE #device{id=110,val.. -> remote_xican_l:central.keyAttribute == ..
    [11.09.2024] [17:09:07] [TRACE] [QUICKAPP214]: [Rule:9:2]>> suspended triggered - wait 00:00:00
    [11.09.2024] [17:09:10] [TRACE] [QUICKAPP214]: [Rule:9:2]>> suspended triggered - wait 00:00:00
    [11.09.2024] [17:09:13] [TRACE] [QUICKAPP214]: [Rule:9:2]>> suspended triggered - wait 00:00:00
    [11.09.2024] [17:09:17] [TRACE] [QUICKAPP214]: [Rule:9:2]>> suspended triggered - wait 00:00:00
     

    Where is functiontime coming from?

    I think wait(1) is an incorrect format..What time do you want to wait? 1 second? 1 hour? or 1 minute?..

    Wait function needs to have the argument in format i think hh:mm:ss..So just reformat it, and it will work..thats my guess

    Edited by Neo Andersson
    Posted

        rule("functiontime = 1")

    or

    functiontime = 1
    or

        local HT = { -- Test Home Table with "fake" devices - create your own...
            functiontime = 1,
        }
    Posted
    15 minutes ago, lux said:

        rule("functiontime = 1")

    or

    functiontime = 1
    or

        local HT = { -- Test Home Table with "fake" devices - create your own...
            functiontime = 1,
        }

    As i wrote you...you cant use wait(1)..at least i think you can't. What should the 1 mean? 1 sec or 1 hour or 1 minute????

    Use format hh:mm:ss

    Posted

    1 second

    Posted

    01:00 >> 1 hour

    01:10 >> 1 hour and 10 min

    00:00:01 1 sec

    wait(0); in a rule means all above this wait(0) will be executed first before we contimue

     

    Guys, switch 2 buttons on and off

    press, release, hold properties

    on and off no problem

    but

    how to write in a rule if 1:'Holddown' raise britness fa in steps with 10%

     

    • Like 1
    Posted (edited)

     

    3 hours ago, Sjakie said:

    01:00 >> 1 hour

    01:10 >> 1 hour and 10 min

    00:00:01 1 sec

    wait(0); in a rule means all above this wait(0) will be executed first before we contimue

     

    Guys, switch 2 buttons on and off

    press, release, hold properties

    on and off no problem

    but

    how to write in a rule if 1:'Holddown' raise britness fa in steps with 10%

     

    this is the general pattern for the dim command

    <id>:dim = { time, direction, steps, curve, startValue, stopValue }

     

    example

     

    Ex.

    rule("@sunrise-00:30 => lamp:dim = {00:30, 'up', 5, 'Linear', 0, 99}")

    Edited by Neo Andersson

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