SDR3078 / ps3-home-assistant

Home Assistant integration for Sony PlayStation® 3 devices
Apache License 2.0
11 stars 3 forks source link

Device becomes unavailable when Physical PS3 is turned OFF. #16

Closed Midifreakz closed 1 month ago

Midifreakz commented 1 month ago

Hi SDR3078,

Hope you are doing well.

I have noticed that when the PS3 is off for a while, the entire PS3 device becomes unavailable. This makes it impossible to turn the ps3 back on from Home Assistant. You might want to look in to this.

Screenshot 2024-06-26 at 08 02 26
SDR3078 commented 1 month ago

Hi @Midifreakz! Thanks for bringing this to my attention! Could you post the logs related to the ps3 integration from around when the entities became unavailable? This way it would be easier to define the root cause, thanks!

Dante2202 commented 1 month ago

I am also getting this error, these are what my logs show: error1

error2

error3

SDR3078 commented 1 month ago

@Dante2202 could you open another issue for this? From the logs, it seems unrelated to the above mentioned issue.

Dante2202 commented 1 month ago

Sure I can open a new issue I just figured these were related to this issue because I am getting the same exact issue as the original post.

SDR3078 commented 1 month ago

Aha ok, my apologies! It seems like for some reason, no data is returned. Does it help to delete your device, and reconfigure the integration?

Dante2202 commented 1 month ago

I deleted my device and integration then re added everything and so far I have not gotten that error again. Although when I check my logs I do see an error however the on my dashboard I am not the “this entity is no longer being revised by the ps3 integration”. Not sure if the error below is expected or related I just noticed it so I wanted to charge just in case it had something to do with it.

IMG_1147

Dante2202 commented 1 month ago

Looks like after a while the error comes back: Screenshot 2024-07-08 150050

SDR3078 commented 1 month ago

Hi @Dante2202 , I am not able to replicate this error so unfortunately I cannot fix it for now.

@Midifreakz I was able to reproduce the original error and it might have to do with an error on the server side of the integration where webMAN stops responding, even to calls made outside of the integration. Normally turning the PlayStation on and off should help. I will leave the issue open for a bit more time in case there is more occurrences.

SDR3078 commented 1 month ago

@Dante2202, is it possible to open webMAN through an unrelated browser? You can check https://github.com/aldostools/webMAN-MOD/wiki/Web-Commands for the commands.

Midifreakz commented 1 month ago

Hi @SDR3078

I have installed the integration freshly through HACS yesterday (The Main Branch was latest I presume?) Unfortunately the issue persists. I have enable debug logging in the integration pane (the red bug icon).

Not sure how to provide you with logs tho. Are the events you are looking for logged in system settings > system > logs?

Grts

SDR3078 commented 1 month ago

@Midifreakz and @Dante2202,

Part of the reason why I could not figure out what was wrong is because I am not implementing the proper error handling for the update function. I am pushing a new commit to main with some fixes. Could you download this again through HACS (make sure to choose 'main') so the log is properly updated and I can see what is going wrong?

Dante2202 commented 1 month ago

I updated and got the error pretty fast this time: 1 2

SDR3078 commented 1 month ago

I fixed the issue. The library that was used to make connections with the PS3 throws a couple of errors when it cannot connect (when the PS3 is off). Normally I caught them in an exception to report the off status, but I forgot to catch the aiohttp.client_exceptions.ClientConnectorError, which made it not recognize the status. This is fixed as of now in main. I will soon prepare a new release with the bugfixes included.

Midifreakz commented 1 month ago

Hi @SDR3078

I usually got the problem after a HASS restart. It indeed seems to be fixed now! I will keep an eye on it for the next few days.

Good job!