ollo69 / ha-samsungtv-smart

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

Cast issue - CastTubeNotSupported #251

Closed luzik closed 1 year ago

luzik commented 1 year ago

While I can't get app list automatically I created simple app list with YouTube in it

Then I try to call service to cast YT and got this in logs

TV is TheFrame 2022

Logger: custom_components.samsungtv_smart.api.samsungcast
Source: custom_components/samsungtv_smart/api/samsungcast.py:64 
Integration: SamsungTV Smart ([documentation](https://github.com/ollo69/ha-samsungtv-smart), [issues](https://github.com/ollo69/ha-samsungtv-smart/issues)) 
First occurred: 11:02:43 (2 occurrences) 
Last logged: 11:04:05

Failed to retrieve YouTube screenID for host 192.168.123.19

Logger: homeassistant.helpers.script.websocket_api_script
Source: custom_components/samsungtv_smart/api/samsungcast.py:51 
Integration: SamsungTV Smart ([documentation](https://github.com/ollo69/ha-samsungtv-smart), [issues](https://github.com/ollo69/ha-samsungtv-smart/issues)) 
First occurred: 11:02:43 (2 occurrences) 
Last logged: 11:04:05

websocket_api script: Error executing script. Unexpected error for call_service at pos 1:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 452, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1820, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1857, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 216, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 977, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call
    await result
  File "/config/custom_components/samsungtv_smart/media_player.py", line 1621, in async_play_media
    await self._async_play_youtube_video(video_id, enqueue)
  File "/config/custom_components/samsungtv_smart/media_player.py", line 1575, in _async_play_youtube_video
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/samsungtv_smart/media_player.py", line 1553, in _cast_youtube_video
    self._cast_api.play_video(video_id)
  File "/config/custom_components/samsungtv_smart/api/samsungcast.py", line 64, in play_video
    self._get_api().play_video(video_id)
  File "/config/custom_components/samsungtv_smart/api/samsungcast.py", line 58, in _get_api
    screen_id = self._get_screen_id(self._host)
  File "/config/custom_components/samsungtv_smart/api/samsungcast.py", line 51, in _get_screen_id
    raise CastTubeNotSupported()
custom_components.samsungtv_smart.api.samsungcast.CastTubeNotSupported

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/samsungtv_smart/api/samsungcast.py:51 
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22)) 
First occurred: 11:02:43 (2 occurrences) 
Last logged: 11:04:05

[140340989293616] Error handling message: Unknown error (unknown_error) Maciek from 192.168.123.33 (Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Safari/605.1.15)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 26, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 647, in handle_execute_script
    await script_obj.async_run(msg.get("variables"), context=context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1533, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 410, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 454, in _async_step
    self._handle_exception(
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 477, in _handle_exception
    raise exception
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 452, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 685, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1820, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1857, in _execute_service
    await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 216, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 798, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 977, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 838, in _handle_entity_call
    await result
  File "/config/custom_components/samsungtv_smart/media_player.py", line 1621, in async_play_media
    await self._async_play_youtube_video(video_id, enqueue)
  File "/config/custom_components/samsungtv_smart/media_player.py", line 1575, in _async_play_youtube_video
    await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/samsungtv_smart/media_player.py", line 1553, in _cast_youtube_video
    self._cast_api.play_video(video_id)
  File "/config/custom_components/samsungtv_smart/api/samsungcast.py", line 64, in play_video
    self._get_api().play_video(video_id)
  File "/config/custom_components/samsungtv_smart/api/samsungcast.py", line 58, in _get_api
    screen_id = self._get_screen_id(self._host)
  File "/config/custom_components/samsungtv_smart/api/samsungcast.py", line 51, in _get_screen_id
    raise CastTubeNotSupported()
custom_components.samsungtv_smart.api.samsungcast.CastTubeNotSupported
luzik commented 1 year ago
{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2023.4.6",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.10.10",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/Warsaw",
    "os_name": "Linux",
    "os_version": "5.15.0-69-generic",
    "run_as_root": true
  },
  "custom_components": {
    "samsungtv_smart": {
      "version": "0.11.6",
      "requirements": [
        "websocket-client!=1.4.0,>=0.58.0",
        "wakeonlan>=2.0.0",
        "aiofiles>=0.8.0",
        "casttube>=0.2.1"
      ]
    },
    "wiz_light": {
      "version": "0.4.5",
      "requirements": [
        "pywizlight==0.4.15"
      ]
    },
    "xiaomi_miot": {
      "version": "0.7.7",
      "requirements": [
        "construct==2.10.56",
        "python-miio>=0.5.6",
        "micloud>=0.3"
      ]
    },
    "hacs": {
      "version": "1.32.1",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "huawei_solar": {
      "version": "1.2.5",
      "requirements": [
        "huawei-solar==2.2.6"
      ]
    },
    "webrtc": {
      "version": "v3.1.0",
      "requirements": []
    },
    "imou_life": {
      "version": "1.0.13",
      "requirements": [
        "imouapi==1.0.13"
      ]
    },
    "monitor_docker": {
      "version": "1.10",
      "requirements": [
        "aiodocker==0.21.0",
        "python-dateutil==2.8.2"
      ]
    },
    "smartthinq_sensors": {
      "version": "0.31.6",
      "requirements": [
        "pycountry>=20.7.3",
        "xmltodict>=0.12.0",
        "charset_normalizer>=2.0.0"
      ]
    },
    "xiaomi_cloud_map_extractor": {
      "version": "v2.2.0",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "vasco": {
      "version": "0.1.0",
      "requirements": []
    },
    "frigate": {
      "version": "4.0.0",
      "requirements": [
        "pytz==2022.7"
      ]
    },
    "dahua": {
      "version": "0.5.0",
      "requirements": []
    },
    "cover_rf_time_based": {
      "version": "1.1.3",
      "requirements": []
    },
    "nodered": {
      "version": "1.2.0",
      "requirements": []
    },
    "pyscript": {
      "version": "1.4.0",
      "requirements": [
        "croniter==1.3.8",
        "watchdog==2.2.1"
      ]
    },
    "pgnig_gas_sensor": {
      "version": "2.3.0",
      "requirements": []
    },
    "landroid_cloud": {
      "version": "3.0.0b5",
      "requirements": [
        "pyworxcloud==3.1.4"
      ]
    },
    "smart_irrigation": {
      "version": "0.0.78",
      "requirements": []
    },
    "qr_generator": {
      "version": "1.0.3",
      "requirements": [
        "pyqrcode==1.2.1",
        "pypng==0.0.21",
        "pillow==9.4.0"
      ]
    },
    "scheduler": {
      "version": "v0.0.0",
      "requirements": []
    },
    "browser_mod": {
      "version": "2.2.1",
      "requirements": []
    }
  },
  "integration_manifest": {
    "domain": "samsungtv_smart",
    "name": "SamsungTV Smart",
    "integration_type": "device",
    "documentation": "https://github.com/ollo69/ha-samsungtv-smart",
    "issue_tracker": "https://github.com/ollo69/ha-samsungtv-smart/issues",
    "requirements": [
      "websocket-client!=1.4.0,>=0.58.0",
      "wakeonlan>=2.0.0",
      "aiofiles>=0.8.0",
      "casttube>=0.2.1"
    ],
    "dependencies": [],
    "codeowners": [
      "@jaruba",
      "@ollo69",
      "@screwdgeh"
    ],
    "config_flow": true,
    "iot_class": "cloud_polling",
    "version": "0.11.6",
    "is_built_in": false
  },
  "data": {
    "entry": {
      "entry_id": "590ce6285db443d0e16cf99b70c7d072",
      "version": 1,
      "domain": "samsungtv_smart",
      "title": "tvramka (SmartThings)",
      "data": {
        "host": "192.168.123.19",
        "name": "tvramka",
        "port": 8002,
        "ws_name": "tvramka",
        "token": "**REDACTED**",
        "id": "81b59898-2f9d-4933-bf38-6eb130454ba7",
        "device_name": "Samsung The Frame 65",
        "device_model": "QE65LS03BAUXXH",
        "device_os": "Tizen",
        "mac": "**REDACTED**",
        "api_key": "**REDACTED**",
        "device_id": "45b39e87-1654-58a0-390e-65b6119b1c3d"
      },
      "options": {
        "use_st_status_info": true,
        "use_st_channel_info": true,
        "show_channel_number": false,
        "logo_option": 2,
        "use_local_logo": false,
        "power_on_method": 1,
        "app_launch_method": 2,
        "wol_repeat": 1,
        "ping_port": 9197,
        "use_mute_check": false,
        "dump_apps": false,
        "toggle_art_mode": true,
        "sync_turn_off": [],
        "sync_turn_on": [],
        "app_list": {
          "Netflix": "11101200001/org.tizen.netflix-app",
          "YouTube": "111299001912",
          "Prime Video": "3201512006785/org.tizen.ignition"
        },
        "channel_list": {},
        "source_list": {}
      },
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "unique_id": "81b59898-2f9d-4933-bf38-6eb130454ba7",
      "disabled_by": null
    },
    "device": {
      "name": "tvramka",
      "name_by_user": null,
      "model": "QE65LS03BAUXXH (Samsung The Frame 65)",
      "manufacturer": "Samsung Electronics",
      "sw_version": "Tizen",
      "disabled": false,
      "disabled_by": null,
      "entities": {
        "media_player.tvramka": {
          "name": null,
          "original_name": "tvramka",
          "disabled": false,
          "disabled_by": null,
          "entity_category": null,
          "device_class": null,
          "original_device_class": "tv",
          "icon": null,
          "original_icon": "mdi:television",
          "unit_of_measurement": null,
          "state": {
            "state": "on",
            "attributes": {
              "source_list": [
                "TV",
                "HDMI",
                "Netflix",
                "YouTube",
                "Prime Video"
              ],
              "volume_level": 0.0,
              "is_volume_muted": false,
              "media_content_type": "video",
              "app_id": "TV/HDMI",
              "source": "TV/HDMI",
              "ip_address": "192.168.123.19",
              "device_class": "tv",
              "icon": "mdi:television",
              "friendly_name": "tvramka",
              "supported_features": 221117
            },
            "last_changed": "2023-04-23T08:25:27.864956+00:00",
            "last_updated": "2023-04-23T09:15:28.002167+00:00"
          }
        }
      }
    }
  }
}
github-actions[bot] commented 1 year 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.

luzik commented 1 year ago

ping

github-actions[bot] commented 1 year 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 1 year ago

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