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
    15 minutes ago, Neo Andersson said:

    Thanks Jan, well actually i have a lot lot of QAs based on fibaroExtra. Mostly those, where user needs their own dashboards. Many many dynamically created/deleted events.

    Every single one is using the event/time based functions. Posting, Cronjobs, etc. But hopefully they will be compatible,,I am awaiting the new fibaroExtra, because beside ER5 this is the most used helper tool in my work. And it is great.

    The only concerns i am having still is about the removed events as we talked about many times. For me it doesn't make any sense, that TIMERS ID numbers that are insisde an event post are increasing drastically after dynamic re-creating events.

    This is my major concern about all the things apart of some other things that we always work out somehow.

     

    In my logic

    Please login or register to see this code.

    Maybe i am overconcerned, but i am hunting the reason behind inexplicable inscreasing RAM usage day by day without addign any new device to the system. I am having even some unusual system restarts.
    All these symptoms are gone, when i don't use my QAs, so thats why i am hunting the reason down.

    You will never get a reused ID, it's always a unique ID - an increasing number (until you restart the QA)

    The reference could have been a random string - it just needs to be unique - and an increasing number is a simple way to create uniqueness.

    The next fibaroExtra you will be able to log how many active timers you have...

    • Like 1
    Posted (edited)

     

     

    8 minutes ago, jgab said:

    You will never get a reused ID, it's always a unique ID - an increasing number (until you restart the QA)

    Yes that sounds okay, and i was kinda thinking about this too, but in this case the timer number should always increase by one..I have QAs where this number increases by hundreds, or sometimes thousands..Like on QA start it give me for some particular reference ID 3, and after user SAVE (so the dynamic recreation happens) it gives me 728 etc, that is where my concern origins from..and if these numbers were affected by the entire HC3 system timers number, i could take this, but these are not..these are related to one single QA, becuase when you restart the QA it always starts with 1..anyway, i will dig even deeper to find the reason behind those memory problems and system restarts..

    8 minutes ago, jgab said:

    The next fibaroExtra you will be able to log how many active timers you have...

    That sounds fantastic

    Edited by Neo Andersson
    • 1 month later...
    Posted (edited)

    Hi jgab,

    I was using successfully your fibaroExtra (v0.964(*)) up to now...

    Today, I update HC3 FW to 5.160.42 and now the encapsulation of self.debug, self.trace, self.onAction,... functions does not work anymore (ie your functions does not seem to be called, 'root’ function called instead).

    I am afraid that some other goodies that you have added to functions that you have 'renamed' (post, setTimeout,...) are also not available???

     

     

    Am I the only one to use your tool?

    Thanks for your great work(s)!!!!

     

    Yves

    (*)  At first glance it seems that last available version (V0.966) does not show modification addressing 5.160...

     

    NEWS: (solved???)

    I try this morning to upgrade a second HC3 box (used for maintenance).

    There is only 1 QA on it, to test self.debug, self.trace, self.onAction,... functions.

    And : it works there!!! ????

    I will re-try to update the full configuration later...

    Edited by yves.guern
    Posted (edited)

    Hi jgab,

    I confirm that there is a bug when going to FW 5.160, my previous analysis was simply too simple.

    The ‘bug’ is that with FW 5.160, fibaro_EXTRA v0.964 does not filter any more “onAction” or “uievent” prints; whatever the values of debugFlags.onaction & debugFlags.uievent are.

    As I am using lots of posts & subscribes, I get many ‘onAction’ trace events, not really useful for most of my QAs

     

    To solve this, I have modified your code:

     

    Please login or register to see this code.

     

    Into:

    Please login or register to see this code.

     

    I am sure that you will find where the real modification is in V5.160, and a better way to solve the issue😀!!!

    Best Regards

    Edited by yves.guern
    • 2 weeks later...
    Posted

    Hi,

    I have found why 5.160 does not manage “onAction” & “uievent” prints:

    It is juste because it does not use print but fibaro.trace

     

    So I have replaced my previous modifications of fibaro.trace with a much cleaner code:

    Please login or register to see this code.

     

    Regards

    • Like 1
  • Topic Author
  • Posted
    24 minutes ago, yves.guern said:

    Hi,

    I have found why 5.160 does not manage “onAction” & “uievent” prints:

    It is juste because it does not use print but fibaro.trace

     

    So I have replaced my previous modifications of fibaro.trace with a much cleaner code:

    Please login or register to see this code.

     

    Regards

    Actually, I think it uses QuickApp:trace (that then uses fibaro.trace)

    I will move the inibitPrint check to QuickApp:trace in the next release of fibaroExtra....

    • 3 weeks later...
    Posted

    @jgab Jan, for some reason, sunrise, sunset times are incorrect for me. Using fibaroextra toTime function lile this

     

    Please login or register to see this code.

     

    but this gives me 1 hour + to the correct values..

    Should i somehow use some offset argument?

    Or just do a simple add to the result, like sunr = sunr - 3600?

    • 1 month later...
    Posted

    @jgab Jan, i am listening to events using

    Please login or register to see this code.

     
    but if i want to unregister
     

    Please login or register to see this code.

     

     

    i am getting error

     

     

     

    Please login or register to see this image.

    /monthly_2024_08/image.png.09ff45ac98352f2d2ab0b9aa556f7aa5.png" />

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

    @jgab Jan, i am listening to events using

    Please login or register to see this code.

     
    but if i want to unregister
     

    Please login or register to see this code.

     

     

    i am getting error

     

     

     

    Please login or register to see this link.

    Yes it's buggy, Should be defined as

    Please login or register to see this code.

     

    Posted
    14 hours ago, jgab said:

    Yes it's buggy, Should be defined as

    Please login or register to see this code.

     

    still error

     

    Please login or register to see this attachment.

    Posted

    I did't use ICAL for 2 years but now I want to reinstall again.

    It does't show the calendar items.

    If I copy and paste the link .ics in google it download the file and if I look into it I see some items.

    Where I go wrong?

    • 4 weeks later...
    Posted

    @jgab Jan, i am trying to run a function, only when a device property has not change in last 10 second. Trying this

     

    Please login or register to see this code.

    so the actioni print("Function called") should be called only when 3420 device's value has not changed over 10 second. Why is this not working? I am getting the logging text written always. It is delsayed but still triggered anytime the device changes the property, 

    Posted
    35 minutes ago, Neo Andersson said:

    @jgab Jan, i am trying to run a function, only when a device property has not change in last 10 second. Trying this

     

    Please login or register to see this code.

    so the actioni print("Function called") should be called only when 3420 device's value has not changed over 10 second. Why is this not working? I am getting the logging text written always. It is delsayed but still triggered anytime the device changes the property, 

     

     

     

    try make a function to be called from the fibaro.event 


    I think it might not have acces to the clearTimeout(TIMEOUTREF) inside the fibaro.event  🤔

     

    I do the same with the Eventlib jgab have made because you dont have acces to everything inside of the event handler :)

     

     

    fibaro.event ({type='device', id={3420}, property="value"},
      function (env)
     
          callthis()
      end)
     
    function callthis()
     
     if TIMEOUTREF then clearTimeout(TIMEOUTREF) end
     
                    TIMEOUTREF = setTimeout(function()
     
                  print("Funciont called")
     
                end, 10000)
      end
     
     

     

     

     

     

     

    Posted
    26 minutes ago, Brors94 said:

     

     

     

    try make a function to be called from the fibaro.event 


    I think it might not have acces to the clearTimeout(TIMEOUTREF) inside the fibaro.event  🤔

     

    I do the same with the Eventlib jgab have made because you dont have acces to everything inside of the event handler :)

     

     

    fibaro.event ({type='device', id={3420}, property="value"},
      function (env)
     
          callthis()
      end)
     
    function callthis()
     
     if TIMEOUTREF then clearTimeout(TIMEOUTREF) end
     
                    TIMEOUTREF = setTimeout(function()
     
                  print("Funciont called")
     
                end, 10000)
      end
     
     

     

     

     

     

     

    will try thanks

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

    @jgab Jan, i am trying to run a function, only when a device property has not change in last 10 second. Trying this

     

    Please login or register to see this code.

    so the actioni print("Function called") should be called only when 3420 device's value has not changed over 10 second. Why is this not working? I am getting the logging text written always. It is delsayed but still triggered anytime the device changes the property, 

     

    So, there are a couple of versions of fibaroExtra these days...

    I spotted a bug in one of them that defined clearTimeout wrongly

    It should look like

    Please login or register to see this code.

    especially this part is important

    Please login or register to see this code.

    ...then your code should work.

    • Like 1
    Posted
    3 minutes ago, jgab said:

     

    So, there are a couple of versions of fibaroExtra these days...

    I spotted a bug in one of them that defined clearTimeout wrongly

    It should look like

    Please login or register to see this code.

    especially this part is important

    Please login or register to see this code.

    ...then your code should work.

    would you please include this into fibaroExtra file, on forum page download link (the raw file) and on github please? SO i can loop through all my quickapps and all the customers quickapps and change them? Thanks

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

    would you please include this into fibaroExtra file, on forum page download link (the raw file) and on github please? SO i can loop through all my quickapps and all the customers quickapps and change them? Thanks

    The latest is on GitHub and the link in the beginning of this forum thread points to the latest.

    • Thanks 1
    Posted

    @jgab Jan, is there any difference in using fibaor.event, or simlply checking device state in a loop? I mean in terms of effectivity or speed or any other aspect that one can have benefit from one or from the other?

  • Topic Author
  • Posted
    On 10/5/2024 at 4:03 PM, Neo Andersson said:

    @jgab Jan, is there any difference in using fibaor.event, or simlply checking device state in a loop? I mean in terms of effectivity or speed or any other aspect that one can have benefit from one or from the other?

    Event react immediately when the device change state, if you pol you need to choose an interval.

    Event also makes a http request with 30s timeout. E.g. if an event happens while it waits it returns immediately, if there is no event within 30s it will make another 30s requests. This is more efficient than continuously polling.

    Alos, Events only runs one request loop for all device states you want to check.

    However, if you have a termometer where you are only interested in values every 10min, you can as easily do a poll every 10min.

     

     

    • Like 1
    Posted
    3 hours ago, jgab said:

    Event react immediately when the device change state, if you pol you need to choose an interval.

    Event also makes a http request with 30s timeout. E.g. if an event happens while it waits it returns immediately, if there is no event within 30s it will make another 30s requests. This is more efficient than continuously polling.

    Alos, Events only runs one request loop for all device states you want to check.

    However, if you have a termometer where you are only interested in values every 10min, you can as easily do a poll every 10min.

     

     

    Nice to have you @jgab, Love your explanations :D
     

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