ollo69 / ha-samsungtv-smart

📺 Home Assistant SamsungTV Smart Component with simplified SmartThings API Support configurable from User Interface.
Apache License 2.0
464 stars 59 forks source link

OSErrors when using send media key #308

Open Daniel-dev22 opened 8 months ago

Daniel-dev22 commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

I noticed when trying to send media keys I'm getting OSErrors in the log. If I reload the integration sending keys works for awhile and eventually it stops and I get OSError.

It looks like Smartthings sees the TV as offline when it's not so the keys don't send which may be the cause of the OSError? Are the keys sent locally or to smart things API?

Expected behavior If applicable, a clear and concise description of what you expected to happen.

Send media keys to always send when the TV is on.

Screenshots If applicable, add screenshots to help explain your problem.

Environment details:

Output of HA logs Paste the relavant output of the HA log here.

2024-02-25 16:46:00.455 DEBUG (SyncWorker_14) [custom_components.samsungtv_smart.api.samsungws] Sending key KEY_ENTER
2024-02-25 16:46:00.455 DEBUG (SyncWorker_14) [custom_components.samsungtv_smart.media_player] Error in send_command() -> OSError
2024-02-25 16:46:00.602 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': 'mytvid', 'state': 'OFFLINE', 'lastUpdatedDate': '2024-01-16T00:29:41.710Z'}
2024-02-25 16:46:05.267 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': 'mytvid', 'state': 'OFFLINE', 'lastUpdatedDate': '2024-02-15T06:39:50.790Z'}
2024-02-25 16:46:05.468 DEBUG (MainThread) [custom_components.samsungtv_smart.api.upnp] 
2024-02-25 16:46:05.669 DEBUG (MainThread) [custom_components.samsungtv_smart.api.upnp] 

Additional context Add any other context about the problem here.

github-actions[bot] commented 6 months ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 6 months ago

This issue was closed because it has been stalled for 7 days with no activity.

Daniel-dev22 commented 6 months ago

Still an issue can we re-open it?

Daniel-dev22 commented 4 months ago

@ollo69 should I open a new issue because this is still an issue and I can't reopen this one.

ollo69 commented 4 months ago

Ok, I reopen. Sorry but I'm very busy with my job on last months so my activity on this repository is very limited. Please next time remember just to give an "up" on the issue when you receive stale notification to avoid auto-closure.

Daniel-dev22 commented 4 months ago

Ok, I reopen. Sorry but I'm very busy with my job on last months so my activity on this repository is very limited. Please next time remember just to give an "up" on the issue when you receive stale notification to avoid auto-closure.

No worries thank you. I'll make sure to give a up when I get the stale notification.

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Daniel-dev22 commented 2 months ago

Not stale

github-actions[bot] commented 1 month ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Daniel-dev22 commented 1 month ago

This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days.

Still an issue

returnofthem commented 4 weeks ago

I'm also having this issue, but running HAOS directly on a raspberry pi.

Example debug log output

2024-10-20 23:32:02.944 DEBUG (SyncWorker_15) [custom_components.samsungtv_smart.api.samsungws] Sending key KEY_CHUP
2024-10-20 23:32:02.946 DEBUG (SyncWorker_15) [custom_components.samsungtv_smart.media_player] Error in send_command() -> OSError
2024-10-20 23:32:02.994 DEBUG (MainThread) [custom_components.samsungtv_smart.api.smartthings] {'deviceId': '46926259-97a8-3916-d744-067be2082a93', 'state': 'ONLINE', 'lastUpdatedDate': '2024-10-20T22:16:44.752Z'}