bezmi / homeassistant_jvc_projector_remote

Custom components for homeassistant
Apache License 2.0
14 stars 11 forks source link

Problem parsing the power.state Standby #10

Closed ejones7 closed 1 year ago

ejones7 commented 2 years ago

First let me say thank you for time on this. I have been using it for a while and it allows me to integrate my JVC DLA-RS600U into Home Assistant. Also, thanks for restoring the extended attributes for last_command_sent, etc.

Please contact me if you have any questions on my description.

The issue began with your last update. It looks like the remote.py code is passing the power_state object (not the value) when in Standby mode. Here are the JSON errors:

Logger: homeassistant.components.websocket_api.messages Source: components/websocket_api/messages.py:197 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: May 31, 2022, 11:26:15 PM (2 occurrences) Last logged: May 31, 2022, 11:26:15 PM

Unable to serialize to JSON. Bad data found at $.event.c.remote.projector.+.a.power_state=PowerStates.standby(<enum 'PowerStates'> Unable to serialize to JSON. Bad data found at $.event(Event: state_changed).data.new_state(State: remote.projector).attributes.power_state=PowerStates.standby(<enum 'PowerStates'>

Logger: homeassistant.components.websocket_api.http.connection Source: components/websocket_api/commands.py:315 Integration: Home Assistant WebSocket API (documentation, issues) First occurred: 1:26:34 AM (2 occurrences) Last logged: 1:37:01 AM

[139859599606256] Unable to serialize to JSON. Bad data found at $.event.a.remote.projector.a.power_state=PowerStates.standby(<enum 'PowerStates'> [139859610471584] Unable to serialize to JSON. Bad data found at $.event.a.remote.projector.a.power_state=PowerStates.standby(<enum 'PowerStates'>

ziptbm commented 2 years ago

I'm seeing this as well. Have you figured out a way to downgrade to the previous version that works?

I ended up restoring my HA backup from 1AM this morning, and this appears to restored functionality, however I am now getting this error as well. I can remotely control the projector, however the power state appears to be unavailable due to this error.

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom component author for jvcprojector doing blocking calls at custom_components/jvcprojector/remote.py, line 100: self._power_state = self._jvc.power_state()

ejones7 commented 2 years ago

I believe the issue started with version 1.0.2 which rolled out at the end of May. Any backup before ~ May 20th should be okay.

ziptbm commented 2 years ago

@bezmi have you seen this issue on your end?

I have a DLA-RS1000 (same as NX5), but immediately saw the issue above upon upgrading to the latest build yesterday. And after restoring a backup from 24 hours earlier, I am seeing the detected blocking call issue I reported above. Let me know if there's anything I can try on my end to mitigate or adjust. Really appreciate this integration!

bezmi commented 2 years ago

Sorry guys, I'll get this sorted ASAP. The enum stuff seems to be a relatively simple bug in the upstream python library. The "blocking call to sleep" error is possibly just because something is spamming the power_state() command (which is bugging out). There is an async version in the works, but hopefully fixing the main bug should fix the sleep issue also.

bezmi commented 2 years ago

Hi guys, I've rolled back a change in the python library and pushed a release. The manifest for this plugin should now point to the new release. Could someone please test it and let me know if it is working as expected?

ziptbm commented 2 years ago

Hi guys, I've rolled back a change in the python library and pushed a release. The manifest for this plugin should now point to the new release. Could someone please test it and let me know if it is working as expected?

Success! Just updated and it’s now showing lamp status and appears to reporting status correctly for me. Will keep an eye on it and report back if anything changes. Thank you!

update - I am seeing this in my logs still.

Detected blocking call to sleep inside the event loop. This is causing stability issues. Please report issue to the custom component author for jvcprojector doing blocking calls at custom_components/jvcprojector/remote.py, line 102: self._power_state = self._jvc.power_state()

bezmi commented 2 years ago

Thanks for the update. I'll have to investigate this sleep issue when time permits. Is it actually causing any noticeable stability issues for your homeassistant install?

ziptbm commented 2 years ago

Thanks for the update. I'll have to investigate this sleep issue when time permits. Is it actually causing any noticeable stability issues for your homeassistant install?

Nothing I can tell. I only see the error in logs when I “power off” the projector.

bezmi commented 1 year ago

@ziptbm I have released a version called 1.0.2-testing_fix that may fix the "detected blocking call" issue. It should be visible in HACS. The current version that you're using is released as 1.0.2 (can also just use the default branch). If you have time, could you please install the testing version and let me know if the issue has been fixed?

Edit: issue persists. I will attempt to fix and report back

bezmi commented 1 year ago

closing, as it is fixed in the latest alpha version #12. Please see the community post here.