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

    Please login or register to see this code.

    1 hour ago, Neo Andersson said:

    Jan, this error catcher is absolutelly a game changer for me. It is brilliant. Having so many installations, now i can follow the problems, and identify them quickly. However, the catcher logs out the text in incomprehensible format. All the &nbsp and \n stuff is written out and everything is melted together. Sorry i forgot to snap a picture, but i think you know what does this mean.

    I am using it like this to get msg to my phone 

    Please login or register to see this code.

     

     

    Please login or register to see this code.

     

  • Topic Author
  • Posted
    3 hours ago, minsad79 said:

    hi jgab

    Operating in ER4

      TimeOfDayQA = 2108
       rule([[states = {
         {label="Morning", name='morning'},
         {label="Day", name='day'},
         {label="Evening", name='evening'},
         {label="Night", name='night'},
         {label="Dawn", name='dawn'},
       }
       ]])

       --rule("TimeOfDayQA:positions=states; if TimeOfDayQA:position=='' then TimeOfDayQA:position='day' end")
      
       rule("@sunrise+00:30 => TimeOfDayQA:position='morning'")
       rule("@12:00 => TimeOfDayQA:position='day'")
       rule("@sunset-01:00 => TimeOfDayQA:position='evening'")
       rule("@22:00 => TimeOfDayQA:position='night'")
       rule("@05:00 => TimeOfDayQA:position='dawn'")
      
       rule("TimeOfDayQA:position=='morning' => log('morning')")
       rule("TimeOfDayQA:position=='day' => log('day')")
       rule("TimeOfDayQA:position=='evening' => log('evening')")
       rule("TimeOfDayQA:position=='night' => log('night')")
       rule("TimeOfDayQA:position=='dawn' => log('dawn')")

    It doesn't run

    Have the rules changed?

    thank you always

    Does it crash?

    Doesn't it trigger?

    I tested and it worked for me. 

    Are you sure about the deviceId?

  • Topic Author
  • Posted
    1 hour ago, ChristianSogaard said:

    Hi Jan

     

    It seems there still is a bug on this one

     

    Please login or register to see this code.

     

    If I select YES - 1:tryArm runs and works

    If I select No - i get a QA Crash, BUT only the first time the rule runs. Second time no problem, and then again the first time after QA restart

     

    [21.12.2023] [13:14:07] [ERROR] [QUICKAPP2059]: QuickApp crashed
    [21.12.2023] [13:14:07] [ERROR] [QUICKAPP2059]: Unknown error occurred:

    I managed to reproduce it and made a change that made the error go away...

    The problem is that I don't understand why - next release (tomorrow morning)  will have the fix and you can also try if it works for you...

     

    • Thanks 1
    Posted

    Hi Jan

     

    Best as I thought I was close to done, I can see that my initialization of LastPerson with a person value is causing lots of problems.

    What i did was ...

    Please login or register to see this code.

    because if its empty - im getting errors in

    But its seems that initialization like above is hardcoding LarstPerson to 2120

     

    Please login or register to see this code.

     

    [21.12.2023] [15:59:58] [ERROR] [ER2059]: [Rule:5:4]>> [Rule:5:People:value:bin:sum == 1 & HouseIsEmpty => LastPerson = [_:isOn in People][1]; log('First person arrived at Home %s', [_:isOn in People]) ; HouseIsEmpty = false; PeopleMap[LastPerson].id:msg=fmt('%..] Runtime: No devices found for :msg
     

    But also here...

    [Rule:2:1]>> [Rule:2:HouseIsEmpty & ask(PeopleMap[LastPerson].phone,'Vil du aktivere alarm?', 'Tryk yes at aktivere alarm?', 10) => 1:tryArm] Runtime: table is 'nil' for array reference
    HouseIsEmpty & ask(PeopleMap[LastPerson].phone,'Vil du aktivere alarm?', 'Tryk yes at aktivere alarm?', 10) => 1:tryArm

     

    My People map looks like this, why do i only have "id =" at 2120 section ? 

    Please login or register to see this code.

     

    There is something Basale i misses ?!

     

    Posted

    I have aQA who crashes today 2 times same QA as earlier this week.

    Change QA>> crash >>> cut modified  save >>> ok >>> add modified part >>> ok

    Posted

    jan, what can we do with this? Do you have any idea? Should we keep using ER5? Is this something that can ruin the system?

  • Topic Author
  • Posted (edited)

    Ok, my working assumption for now is that if you have a large QA (not necessarily rules, but lines of code) and you update it with QAUpdater, something can go wrong (a bug in the unsupported file-update api)  and you end up with a doppelganger process for the QA.

    I think I know how to verify that and will do some tests today.

    If that is the case, there may be some way to work around it - including the new QAUpdater I'm working on.

    So, in your case, that seems to be hit by this all the time, I would recommend and not use QAUpdater until I have a fix..

     

    When the system gets this "doppelganger" it seems like only a reboot of the HC3 helps.

    Edited by jgab
    Posted
    1 hour ago, jgab said:

    Ok, my working assumption for now is that if you have a large QA (not necessarily rules, but lines of code) and you update it with QAUpdater, something can go wrong (a bug in the unsupported file-update api)  and you end up with a doppelganger process for the QA.

    I think I know how to verify that and will do some tests today.

    If that is the case, there may be some way to work around it - including the new QAUpdater I'm working on.

    So, in your case, that seems to be hit by this all the time, I would recommend and not use QAUpdater until I have a fix..

     

    When the system gets this "doppelganger" it seems like only a reboot of the HC3 helps.

    Jan . Your skills are impressive. Big respect 🫡 

  • Topic Author
  • Posted (edited)

    Ok, 

    I managed to create a doppelganger using the 'SHS ER 5 (v 0.90)' fqa from @Neo Andersson and doing several updates with QAUpdater until I got a doublet.

     

    It's kind of interesting as the old QA continues to run in the background but there is no way to stop it. Updating or even removing the new QA version, the old version continues to run in the background...

    The only way to get rid of it was to restart the HC3.

     

    I'm not sure why it happens to  'SHS ER 5 (v 0.90)' and not to other ER5 fqas I tried, I don't know but it could have to do with the file size (> 400kb). It could also be a combination of the file size and the "condition" of the specific HC3 system... or just the HC3 system.

     

    Anyway, I have released a new version of QAUpdater (v0.72) that disables the QA to be updated, then updates, and then enables the QA again. For me it seems to work as I have not been able to create another zombie process of 'SHS ER 5 (v 0.90)'

     

    So, @Neo Andersson, try the new updater. It can be updated with QAUpdater.

     

    If this doesn't work, we have to wait for the new updaterQA with the new update strategy....

    Edited by jgab
    • Thanks 2
    Posted

    Jan some info

    System resources 6% mem free used 58% after 3 hours uptime time seems to high.

    Perhaps some stuff does't give memory back as it was a time ago?

    QA Livingroom crashes no indication why

    I toke a fresh QA from Updater copied my rules into it

    Changed some optical issues saved about 20 times and no crash at all, I hope it will stay

    Restart HC3 sytem resource 21% free used 51% after 15 min uptime

    Posted
    20 hours ago, jgab said:

    I managed to reproduce it and made a change that made the error go away...

    The problem is that I don't understand why - next release (tomorrow morning)  will have the fix and you can also try if it works for you...

     

    Please login or register to see this code.

    Hi Jan - a small update...

    im still getting Crash for the ASK function, if nothing is answered at the Phone

     

    rule([[HouseIsEmpty & ask(PeopleMap[LastPerson].phone,'Vil du aktivere alarm?', 'Tryk yes at aktivere alarm?', 10) => 
        log('Ask Lastperson to ARM '++LastPerson);
        log('PeopleMap[LastPerson]. '++PeopleMap[LastPerson].phone);
        1:tryArm
    ]])

     

    Posted

    @ChristianSogaard I also have QA crash with unknown error> I don't use ask function.

    In my case remove your rule, save, paste rule, save and I hope as by y QA your error QA crash will be gone.

    I am curious.

    Posted
    8 minutes ago, Sjakie said:

    @ChristianSogaard I also have QA crash with unknown error> I don't use ask function.

    In my case remove your rule, save, paste rule, save and I hope as by y QA your error QA crash will be gone.

    I am curious.

    Ill test, but re-create the Crash, buy following a specific procedure, and if I delete my ASK rule, its gone.
    Thank you for sharing @Sjakie

    • Like 1
    Posted

    @jgab Jan, is it something normal, to have 10 000 invocations /day for a system with 102 rules? Just for curiosity. It doesnt have ghost processes, as i have restarted the HC3.

    On the other hand, after a longer period of time these numbers will get to really high values, as it goes to inifinity by time. Will that be okay in system to handle these numbers?

    Like having millions and millions of fails, invocationis, successes etc..and all that will be written out to UI..

    Posted

    @ChristianSogaard not delete >>ctrl_X and copy it in some other .TXT file

    Posted (edited)

    Jan, it's okay, that we will have a better QAupdater for avoiding ghost processes. But how should I work on those systems? What is your recommendation? Because every time i edit the code, or add something new into it / ex customer called that he needs something ?

    Every time  i change the code, and save the QA the ghost processes arrive. Every new save of the QA creates a paralell running process. So this way i am not able to maintain the code,manage it, or fix some issues. Am i? If so, how to do it?

    Edited by Neo Andersson
    Posted (edited)

    How do i create my own trigger ??

     

    I have a GAS meter im reading consumption from a pulse counter

    Please login or register to see this attachment.

    .

    Using Swagger i see my Data is stored in properties.parameters.value 

     

     

    Please login or register to see this spoiler.

     

    Please login or register to see this code.

     

    Please login or register to see this code.

    How do a get the properties.value into a variable ? 

     

    I also tried this 

    Please login or register to see this code.

    But here, i never gets a trigger

     

    Here I get the trigger, but no Value

    rule("#device{id=2046, value='$value'} =>  log('Gasmåling .... trigger fra ',value) ")

     

    Edited by ChristianSogaard
    Typo
  • Topic Author
  • Posted (edited)
    6 hours ago, Neo Andersson said:

    @jgab Jan, is it something normal, to have 10 000 invocations /day for a system with 102 rules? Just for curiosity. It doesnt have ghost processes, as i have restarted the HC3.

    On the other hand, after a longer period of time these numbers will get to really high values, as it goes to inifinity by time. Will that be okay in system to handle these numbers?

    Like having millions and millions of fails, invocationis, successes etc..and all that will be written out to UI..

    Well, it's a lua math.maxinteger (9223372036854775807) so with 10000 invocations / day it will last for 2526951242973 years.

    However, 10000 invocations seems high - but as long as fails + successes ~= invocations it's probably right.

    Edited by jgab
  • Topic Author
  • Posted (edited)
    6 hours ago, Neo Andersson said:

    Jan, it's okay, that we will have a better QAupdater for avoiding ghost processes. But how should I work on those systems? What is your recommendation? Because every time i edit the code, or add something new into it / ex customer called that he needs something ?

    Every time  i change the code, and save the QA the ghost processes arrive. Every new save of the QA creates a paralell running process. So this way i am not able to maintain the code,manage it, or fix some issues. Am i? If so, how to do it?

     

    Ok, that's interesting because if I edit your qa and save it, it will not generate a ghost for me. I had to really abuse it with QAUpdater before I got a ghost.

    I actually suspected that saving the QA from the editor could also causes ghosts because I assume the editor and QAUpdater use the same APIs to save the QA files.

    That would also explain issues that people had in the past with other QAs.

     

    So, there could be a couple of reason (and maybe combined)

    So, a QA that has a lot of active timers and outstanding http requests could have issues if code is replaced and being forced to restart.

    That's why I'm now disabling the QA before updating because then no timers or http requests are active when the files are updated.

     

    I'm not sure what to do in your case. Try to slim down the QA by removing unnecessary QA files (I saw that some of them only had commented code lines)

    May disable the QA before editing it and then enable it using the web ui?

     

     

    Edited by jgab
  • Topic Author
  • Posted
    11 hours ago, jgab said:

     

    Ok, that's interesting because if I edit your qa and save it, it will not generate a ghost for me. I had to really abuse it with QAUpdater before I got a ghost.

    I actually suspected that saving the QA from the editor could also causes ghosts because I assume the editor and QAUpdater use the same APIs to save the QA files.

    That would also explain issues that people had in the past with other QAs.

     

    So, by editing the QA in the web UI causes a ghost than it's really a bug for Fibaro to fix...

    ...and because it happens seldom and to a few systems, I also suspect it has something to 

    do with the systems "condition"...

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