JoDehli / PyLoxone

Python Loxone binding
Apache License 2.0
164 stars 40 forks source link

high cpu usage under the beta release #167

Closed beber-msft closed 1 year ago

beber-msft commented 1 year ago

Which Model do you use from loxone? Miniserver? Gen1 or Gen2? Gen1 Which software version does your loxone use? 13.1.11.17 How did you install HomeAssistant? Over Hassio oder manual install? Hassio Which Version do you use of HomeAssistant? March 23 Describe the bug Since a week or so my average CPU utilization on HA server is 55% instead of 5%. Afer disabling loxone integration it goes back to 5%, after re-enabling it goes back to 55%. no changes have been made on loxone side, pyloxone addon did get an update though. no errors in logs.

JoDehli commented 1 year ago

@beber-msft I can not reproduce this issue on my system. I have multiple connections via pyloxone running and there is no increased cpu utilization.

beber-msft commented 1 year ago

can we maybe try to debug it together on my system? any logs or so I can provide? would be great to get this fixed, love your integration, but it's a bit much CPU drain.

JoDehli commented 1 year ago

@beber-msft Have tried to downgrade the pyloxone. We have 2 versions at the moment. The beta and the normal ones? If you have tried both and you still have such a cpu load we can try to disable certain platforms from pyloxone.

But 55 is not really high. My system has always 17 and it is a very very small installation. So with a bigger installation you have such a cpu load.

My loxone crashed completely when I updated to latest firmware. I had to flash the SD card new with a backup. The system was so slow and I had some disconnections from pyloxone. And after some reboots it crashed completely. I do not know but maybe your system has also some problems with the SD card after the update. After 8 years this is the first time that I had such problems.

beber-msft commented 1 year ago

same behavior with both beta and regular unfortunately but thanks for the suggestion. I don't have a bigger installatioin, and it was running with only 5% before the issue occured (and still does when I disable the integration). Loxone runs well as in fast / reponsive as always. Not saying it's not the issue I have no sign there. I tried disabling all pyloxone entities one by one in HA without any effect. how can I disable certain platforms? would like to follow that approach. Thanks again for your help, appreciate it!

JoDehli commented 1 year ago

@beber-msft if you are on the normal branch you find the platforms in the const.py

https://github.com/JoDehli/PyLoxone/blob/master/custom_components/loxone/const.py#L12

image

You can commit everything out and start with one by one.

beber-msft commented 1 year ago

been there, done that. it's none of them. commented all out, verified it indeed works as the components are not available after restart. no change in CPU utilization. stopping pyloxone integration. immediate drop from 55% to 12%. has to be something else in there or I am doing something wrong.

JoDehli commented 1 year ago

When all platforms are commented out there is nearly no communication between pyloxone and the miniserver.

I think you must wait for the next update. Or you can try the loxone beta version. Sorry but I do not know what causes this behaviour?

How did you see the CPU usage? I find it only in the config. But there the CPU is not changing at all. It stays always the same on my system. Normally it must change over time.

beber-msft commented 1 year ago

I am talking about the Homeassistant CPU Utilization, not the loxone server utilization in all of this. Just want to ensure there is no confusion around this. I am running HAos in a VM and monitoring CPU usage from the host.

I suspect an issue with something in pyloxone outside of the platform components. I have disabled pyloxone for the moment but I REALLY really like it and would like to continue to use it. The behavior changed when I moved away from 0.4. which doesn't seem to work anymore with HA.

Thanks for all the help so far!

JoDehli commented 1 year ago

@beber-msft I was completely wrong. I thought you mean the loxone CPU. Ok then there is a good change they screwed up something. The quality of home assistant is not as good as from loxone.

beber-msft commented 1 year ago

sorry if I haven't been clear on that. anything I can try to debug on the HA side of things to get to the root of this?

JoDehli commented 1 year ago

@beber-msft I have the same behavior on my system with the beta. Go back to 0.4.2. It has something to do with the new websocket implementation. I do not know why. It will be very difficult to debug. I will remove all beta versions for now.

JoDehli commented 1 year ago

@beber-msft You can try the newest beta or you use the newest normal version.

beber-msft commented 1 year ago

updating now.

beber-msft commented 1 year ago

@JoDehli it works! thank you much for fixing this, REALLY appreciate it. CPU usage back to regular levels for now. What changed?