iloveicedgreentea / jvc_homeassistant

JVC Integration for Home Assistant
20 stars 4 forks source link

High CPU Usage #47

Open kernelpanic85 opened 2 weeks ago

kernelpanic85 commented 2 weeks ago

I'm seeing about 25% higher than normal CPU usage that seems to go down when I disable this integration. Debug logs show the following:

2024-04-30 23:23:26.039 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:26.282 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:26.286 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
2024-04-30 23:23:31.545 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:31.736 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:31.736 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
2024-04-30 23:23:36.993 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:37.254 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:37.255 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
2024-04-30 23:23:42.513 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:42.779 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:42.779 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK
2024-04-30 23:23:49.107 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Checking connection to JVC projector
2024-04-30 23:23:49.318 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Null command response: b'\x06\x89\x01\x00\x00\n'
2024-04-30 23:23:49.319 DEBUG (MainThread) [custom_components.jvc_projectors.remote] Connection to JVC projector is OK

I usually see NP5 in the model field when it's working but now I'm not getting anything: image

I'm running v4.4.09 on HA 2024.4.4

iloveicedgreentea commented 2 weeks ago

Is that only on the latest beta compared to previous betas? Or stable too?

To set expectations, I am really tired of developing for home assistant as I find the experience to be really poor. I learned a lot about HA internals recently that I incorporated here but to fully optimize this integration would require a complete rewrite and I don't have the motivation to do that. I have been working on building my own home automation tool in Go, which has more specific goals than HA. So far, its incredibly fast, has full HA compatibility via API, and my JVC plugin for it is much faster and reliable.

My plan in the medium term is to move all theater things to my new tool and leave HA running house stuff, but in the long term I want to implement support for more things like zwave natively. I don't know if I will open source it at this point

But anyway, I don't really have the time or motivation to keep working on HA stuff to be honest

kernelpanic85 commented 2 weeks ago

It seemed to have been occurring on the last few beta releases. I don't think it was there on stable, but I can't say for sure. That being said, I rebooted HA and the CPU returned to normal and the model is reading correctly now. I'll keep an eye on it.

kernelpanic85 commented 1 week ago

It seems reverting to stable fixed the CPU issues. But the connection reliability is not as good as the beta releases as the behavior I reported at bottom of #40 is back. Lots of these in the logs and the power status doesn't reflect the actual state.

socket.send() raised exception.
Attribute not found
Got a blank msg
Received ack: b'@\x89\x01PW0' != expected ack: b'\x06\x89\x01PW\n'

Just in case you find the motivation to work on it again ;)