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


  • 0

Question

Posted

Hello

I have been using UHAS V1.0.4 for some time now, and it works very well and, in my opinion, should not cause any problems. However, for some time now, my HC2 has been requiring more and more RAM. I already have 4GB of RAM, but as soon as more than 50% is used, the HC2 becomes increasingly sluggish. This is always the HCServer process in multiple instances. I have root access to my HC2 and was able to clean up the database from crontab, with a previous backup. But now I can't figure out what is causing this memory consumption. I have also cleaned up my global variables. Eliminated unnecessary scenes, etc.

How can I find out?

 

Fibaro support is not responding to my support ticket.

 

Best regards,

speedoxx007

19 answers to this question

Recommended Posts

  • 0
Posted

My installation:

 

Hardware: HC2 with 4Gb RAM and 116 z-wave devices included.

Software: UHAS v1.0.4 with 152 VD's installed of which 48 are with running main loop and 103 scene installed of which 3 are constantly running.

 

CPU utilization:

Please login or register to see this spoiler.

 

During the day only in the morning after waking up and starting morning part of the day HC2 can be sluggish for a period of time depending on how many ALC scenes are running in parallel with other scenes that are running periodically like two Philips HUE scenes, weather provider scenes and some other scenes for integrated devices.

 

System in this configuration is running for several years now with only some minor problems.

 

Lately I noticed that every month or two months HCServer stops responding. It is not possible to connect to HC2 neither with browser or mobile app, but interestingly automation is still working and even WiFi integrated devices are controlled.

 

In last two years also z-wave service stopped responding several times and required rebooting HC2, but after reboot and starting up UHAS everything get back and working as expected.

 

Still I can confirm what @speedoxx007 wrote that HC2 is slowing down. I was thinking that this is because of the increased database, but since @speedoxx007managed to clean it up and still have problems then I have no clue why this slugging is happening.

 

Regarding RAM usage on my system lowest free memory is about 38%, but mostly between 45 and 50%. I'm aware that my HC2 is a bit sweating with all this automation installed and running, so a bit lagging is expected and luckily accepted by me and my family.

 

  • 0
  • Inquirer
  • Posted

    Hi @Sankotronic

     

    I think I've found the problem. There was an error in the Philips Hue Preview scene.

     

    Please login or register to see this image.

    /monthly_2025_12/image.png.0088e74a894bce877baf65a4365edf95.png" />

     

    Since I disabled the scene, memory usage has remained the same.

    Some time ago, I migrated my old Philips Hue Bridge to the new Philips Hue Bridge Pro and was able to continue using my existing setup. Yesterday, I noticed that I seem to have a problem with the existing hueUser on the new Hue Bridge Pro. I think I now need to re-integrate the hueUser. I tried this yesterday, but I think I need to delete a variable and have it recreated.

     

    Best regards

    speedoxx007

    • 0
    Posted

    Hi @speedoxx007,

     

    I'm still waiting on my Philips HUE Pro bridge. I hope I get it before I will have to leave home for my work.

    Regarding the error in the scene. I quickly check and see that it fails on checking lights of the group (rooms and zones), but first I need to beautify my own code to be able to understand what it does :-) 

     

    I Hope I will get my HUE Pro soon and then will be able to check HC2 UHAS code and also start working on code for new Yubii UHAS.

    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    I was now able to read and set the new HueUser. The debug output from the main loop of Hue2 Preview VD now looks like this:

     

    Please login or register to see this code.

     

    and thats the result ef Debug from Philips Hue Preview Scene:

     

    Please login or register to see this code.

     

    However, I cannot set any lights or groups because I do not have them at the moment.

     

    The VD and the scene keep running into errors.

     

    That's very strange.

     

    Please login or register to see this attachment.

    • 0
    Posted

    Hi @speedoxx007,

     

    Thank you for reporting yet another bug in my code. I analyze it and found problem. If any other device besides lights are added to the room or zone then script fails because switches and sensors do not have light state, but rather measurement or buttons. When I was writing my HUE2 solution I had only lights included to the HUE bridge and that is why script was running smoothly.

     

    In the meantime I added some HUE switches, but I never assigned the room (zone) so script still run properly. After you reported this problem, I moved some of the switches to the room (zone) and now I have the same error.

     

    Give me a a bit of time to fix it and I will provide here corrected scene code.

     

    • Like 1
    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    I now had to delete the VD Philips Hue Preview and deactivate the Philips Hue Preview scene to see whether memory consumption would continue to increase or not.

     

    But don't stress, I can live with it :-)

    Best regards,

    Speedoxx007

     

     

    • 0
    Posted

    But I can't live with it. My code must work stable on HC2 so I can use it for HC3. Of code from scene will be moved to Quick app and modified.

    • Like 1
    • 0
    Posted

    Hi @speedoxx007,

     

    here is corrected code for HUE2 Preview scene v1.0.4:

     

    Please login or register to see this attachment.

     

    I found just a wrong check during looping through room (zone) lights and therefore if any other device like dimming switch was added to the room (zone) then scene failed.

    Thank you for using UHAS for HC2 and reporting bugs! This will help me to avoid same mistakes while developing Yubii UHAS!

    • Like 1
    • 0
  • Inquirer
  • Posted (edited)

    hi @Sankotronic,

     

    It works fine again with Philips Hue Preview scene v1.0.4.

    But now I've noticed something else strange. VD Select lang and Icon Preview keep restarting and updating the search for scenes and VDs. This slows down the whole HC2. Why? I tried stopping VD Watchdog, but the two VDs continue scanning. 😒

    Is there a problem with the Update List button from Watchdog VD?

    Please login or register to see this attachment.

    Edited by speedoxx007
    Additional Info
    • 0
    Posted

    Hi @speedoxx007,

     

    Watchdog VD itself will scan for scenes and VD's that needs periodical checks only when it is restarted or when user presses button [♻️ 📦 📄] to update list.

    Its main loop only checks status of the Watchdog scene if it is running.

     

    Update list button [♻️ 📦 📄] new code v1.5.5 when pressed will always restart all VD's with main loop not running by design. Since this button code is run automatically only once when HC2 is rebooted or when UHAS is restarted it should not affect resources of the HC2 during normal operation.

     

    This part is added to make sure that all VD's main loop code is really run once to check global variables after reboot or restart. I added this because I noticed that sometimes some of this VD's, after reboot, main loop code do not finish execution or do not run at all and therefore do not check global variables and do not update them with any new changes on the system. This can of course cause that some features or actions do not work as expected anymore.

     

    New restart VD button that is added [🔄 📦] that only restarts VD's with main loop not running by design does the same, except that does not scan for scenes and VD's with running main loop. It is added to be used by user in the case that there was some changes done to the system or after HC2 reboot and if noticed any problems related to those VDs.

     

    To sum up, this two buttons are to be used only after HC2 or UHAS are restarted and eventually if any changes to the system was done and not under normal operation.

    Hope this explains how Watchdog works and the role of this two buttons.

     

    Regarding HC2 becoming sluggish, it would help if you share more info like I did in my first post. It would help if I know what parts of UHAS you have installed.

     

    I noticed that running more than few ALC scenes at the same time can slow down HC2 response and eat some of the RAM and CPU resources. That is why I changed ALC scene to run in manual mode for the evening and night time. Also, all special light scenes like watch TV, dining, cooking etc. I setup ALC scene to turn on lights and then stop running (manual mode). This helped a lot to save some resources and keep HC2 less sluggish. This is because I have dozen of other scenes that run periodically like Netatmo weather station, Netatmo coach, Netatmo cameras, Weather state & forecast, Tempest weather station besides always running Main timers, FTBE and Watchdog scenes.

     

    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

    I understand the function of Watchdog VD, but the fact that it repeatedly restarts VD Select Lang and VD Icon Preview during normal operation is not normal on my HC2. I have now set the non-functioning code to the update list button again, and now my HC2 is running with 19% constant RAM usage and the two VDs are no longer constantly restarting.

    • 0
    Posted

    In  that case check Select lang VD and Icon preview VD and provide their main loop debug. Both VD's mail loop should not run in loop and local variable delay_second setting should be 2 and therefore they should not be added to the list of scenes and VDs to be monitored by watchdog scene.

     

    Since you provided debug from Watchdog VD update list button I wrote my previous post. Hopefully you did understand it and apologies for my bad English. Let me know if you have any other questions, I'll be happy to answer in the best way I can.

     

     

    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    No problem, my English isn't perfect either. I've now made a few more videos of individual MainLoops. The MainLoop from VD Watchdog is controlled via FTBE with Repeat_Time=1. Maybe that's where the problem lies. It's like a chain reaction.
    Well, I've set up the Code Update List 1.5.4 again. So my HC2 is fast again :-)
    In VD Select_Lang; Icon Preview and System Debug, delay_second is set to 2.
    If you want, I can give you access to my HC2 for Troubleshooting.

    • 0
    Posted

    Hi @speedoxx007,

     

    From your videos I can see that problem is with Watchdog VD main loop, which is stopping and then restarting and therefore pressing update list button it seems every minute.

     

    Check Watchdog VD main loop settings and setup as follows:

    Please login or register to see this code.

    Also check that you don't have any setup in FTBE scene that interacts with Watchdog VD.

     

    BTW - you just found another bug in my code :-) 

    Since Watchdog VD main loop is setup not to loop, then by mistake, whenever Watchdog VD is started and activates VD list button then it restarts itself and keeps doing that.

    I forget to check if Watchdog VD is setup not to run main loop and then not to restart itself if its main loop is setup not to run in the loop.

     

    Thank you again for your patience and help in finding those bugs!

     

    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    I have now set up MainLoop from VD Watchdog as you mentioned and deleted the entry in FTBE. It looks better now :-)

    • 0
    Posted

    I will correct code for VD update list button to skip restarting Watchdog VD when main loop is set to stop running and provided it here.

    I should do better testing of the code before publishing it.

    • Like 1
    • 0
    Posted (edited)

    Hi @speedoxx007,

     

    Watchdog VD code corrected and can be found here:

    After solving this problem, let me know if situation with memory and lagging get better or we still have to investigate further.

    Thank you again!

    Edited by Sankotronic
    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    Thank you very much for your solution. I have implemented your codes and my HC2 is working very quickly again with a confirmed memory usage of around 20%. I will monitor this over the next few days.

     

    In any case, thank you very much for your support and solution.

     

    I'll wait until I switch from HC2 to HC3 or Yubii Home Pro 😆

     

    I wish you a wonderful Christmas season

    • Like 1
    • 0
  • Inquirer
  • Posted

    Hi @Sankotronic,

     

    After testing and normal operation of the HC2, memory consumption now remains stable and the CPU is under less strain since your corrections.

    Thank you again for your support.

     

    Best regards

    speedoxx007

     

    • Thanks 1

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Answer this question...

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