RogerSelwyn / Home_Assistant_SkyQ_MediaPlayer

Home Assistant SkyQ Media player component
MIT License
103 stars 17 forks source link

[BUG] Volume controls error #171

Closed SparkyDan555 closed 1 month ago

SparkyDan555 commented 2 months ago

Describe the bug

The "Media player entity to control volume of" is set to an LG WebOS TV. The volume can be controlled directly from the TV media player but not via the Sky Q media player. The following error is produced:

IMG_0012

To reproduce

Set the "Media player entity to control volume of" to an LG TV (not sure if other media players are affected) and try to control volume from Sky Q media player entity.

Expected bahavior

Sky Q controls the volume of the LG TV

What version of SkyQ has the issue?

v2.11.9

What was the last working version of Sky Q Integration?

No response

What version of Home Assistant Core has the issue?

core-2024.8.3

Configuration type

UI

Configuration UI

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.8.3",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.4",
    "docker": true,
    "arch": "x86_64",
    "timezone": "Europe/London",
    "os_name": "Linux",
    "os_version": "6.6.46-haos",
    "supervisor": "2024.08.0",
    "host_os": "Home Assistant OS 13.1",
    "docker_version": "26.1.4",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "skyq": {
      "documentation": "https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer",
      "version": "v2.11.9",
      "requirements": [
        "pyskyqremote==0.3.26"
      ]
    }
  },
  "integration_manifest": {
    "domain": "skyq",
    "name": "Sky Q",
    "codeowners": [
      "rogerselwyn"
    ],
    "config_flow": true,
    "dependencies": [
      "ssdp"
    ],
    "documentation": "https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer",
    "integration_type": "device",
    "iot_class": "local_polling",
    "issue_tracker": "https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/issues",
    "quality_scale": "silver",
    "requirements": [
      "pyskyqremote==0.3.26"
    ],
    "ssdp": [
      {
        "nt": "urn:schemas-nds-com:device:GatewaySkyControl:2"
      },
      {
        "nt": "urn:schemas-nds-com:device:MRSkyControl:2"
      }
    ],
    "version": "v2.11.9",
    "is_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 3.7641999995230435e-05
    },
    "a1f396121d46043d3584f3e8aeb3b378": {
      "wait_import_platforms": -0.01859963800000486,
      "config_entry_setup": 0.8187321119999993
    }
  },
  "data": {
    "config_entry_data": {
      "host": "skyq.lan",
      "name": "Sky Q"
    },
    "config_entry_options": {
      "output_programme_image": true,
      "live_tv": true,
      "get_live_record": true,
      "generate_switches_for_channels": false,
      "volume_entity": "media_player.living_room_tv",
      "advanced_options": true,
      "channel_sources": [
        "BBC One Y&L HD",
        "BBC Two HD",
        "ITV1 HD",
        "Channel 4 HD",
        "Channel 5 HD",
        "SkyShowcaseHD",
        "Sky Witness HD",
        "Sky Atlantic HD",
        "alibi HD",
        "GOLD HD",
        "U&Dave HD",
        "ComedyCentHD",
        "Sky Max HD",
        "Sky Comedy HD",
        "BBC Three HD",
        "BBC Four HD",
        "ITV2 HD",
        "ITV3 HD",
        "ITV4 HD",
        "SkyDocmntrsHD",
        "Sky Crime HD",
        "Sky HistoryHD",
        "Sky Nature HD",
        "Discovery HD",
        "MTV HD",
        "ComedyXtra",
        "5STAR",
        "Nat Geo HD",
        "Sky Arts HD",
        "ITV Be HD",
        "U&W HD",
        "TLC HD",
        "S4C HD",
        "E4 HD",
        "4seven",
        "More4 HD",
        "E4 Extra",
        "Sky Sci-Fi HD",
        "Food Network",
        "5 USA",
        "Really",
        "U&Drama",
        "QUEST HD",
        "Challenge",
        "TRUE CRIME",
        "TRUE CRIME X",
        "LEGEND",
        "Quest Red",
        "5ACTION",
        "Sky Mix HD",
        "Sky Replay",
        "5SELECT",
        "ID",
        "U&Yesterday HD",
        "Crime+Inv HD",
        "GREAT! tv",
        "HGTV",
        "DMAX",
        "Disc.Turbo",
        "Animal Planet",
        "SkyHistory2HD",
        "BLAZE",
        "NatGeoWild HD",
        "Eden",
        "Disc.Science",
        "BBC ALBA HD",
        "Together",
        "That's TV",
        "PBS America",
        "Disc.History",
        "Court TV",
        "Channel 7",
        "Travelxp",
        "Ayozat TV",
        "BBCScotlandHD",
        "That's TV 2",
        "Rewind TV",
        "ITV1+1",
        "Channel 4+1",
        "Channel 5+1",
        "SkyShowcase+1",
        "Sky Witness+1",
        "Sky Atlantic+1",
        "alibi+1",
        "GOLD+1",
        "U&DaveJaVu",
        "ComedyCent+1",
        "ITV2+1",
        "ITV3+1",
        "ITV4+1",
        "Sky Crime+1",
        "Sky History+1",
        "Discovery+1",
        "5STAR+1",
        "Nat Geo+1",
        "U&W+1",
        "TLC+1",
        "E4+1",
        "More4+1",
        "Food Netwrk+1",
        "5USA+1",
        "U&Drama+1",
        "QUEST+1",
        "TRUE CRIME+1",
        "Quest Red+1",
        "ID+1",
        "U&Yesterday+1",
        "Crime+Inv+1",
        "GREAT! tv+1",
        "HGTV+1",
        "DMAX+1",
        "Disc.Turbo+1",
        "Animal Plnt+1",
        "Eden+1",
        "Disc.Sci+1",
        "Disc.History+1",
        "SkyPremiereHD",
        "Sky Greats HD",
        "SkyAnimationHD",
        "Sky Family HD",
        "Sky Action HD",
        "Sky Comedy HD (308)",
        "Sky Thriller HD",
        "Sky Drama HD",
        "Movies24",
        "Film4 HD",
        "Film4+1",
        "Movies24+",
        "LEGEND XTRA",
        "LEGEND XTRA+1",
        "GREAT! romance ",
        "G! romance+1",
        "GREAT! movies",
        "GREAT! movies+1",
        "GREAT! action",
        "GREAT!action+1",
        "TalkingPictures",
        "MTV MUSIC",
        "MTV HITS",
        "MTV 90s",
        "MTV 80s",
        "Clubland TV",
        "NOW 70s",
        "NOW 80s",
        "NOW 90s & 00s",
        "NOW ROCK",
        "That's Dance",
        "SkySpMainEvHD",
        "SkySp PL HD",
        "SkySp F'ball HD",
        "SkySpCricket HD",
        "SkySp Golf HD",
        "SkySp F1 HD",
        "SkySp Tennis HD",
        "SkySp ActionHD",
        "SkySp News HD",
        "TNT Sports 1",
        "TNT Sports 2",
        "Eurosport 1 HD",
        "Eurosport 2 HD",
        "SkySp Racing HD",
        "SkySp Mix HD",
        "TNT Sports 3",
        "MUTV HD",
        "Premier 1 HD",
        "Premier 2 HD",
        "TNT Sports 4",
        "LFCTV HD",
        "Racing TV HD",
        "TNTSBoxOffHD",
        "SkySpBoxOffHD",
        "TNTUltimateUHD",
        "TNTSBoxOff2HD",
        "Sky News HD",
        "Bloomberg HD",
        "BBC NEWS HD",
        "BBC Parl HD",
        "CNBC HD",
        "CNN HD",
        "NHK World HD",
        "Euronews",
        "NDTV 24x7",
        "FRANCE 24 HD",
        "Al Jazeera HD",
        "GB News HD",
        "TRT World HD",
        "Channels 24",
        "Arise News",
        "Arirang TV HD",
        "WION HD",
        "India Today",
        "NTD",
        "TVC News",
        "GOD Channel",
        "revelation",
        "TBN UK",
        "DAYSTAR HD",
        "LoveWorld HD",
        "EWTN Catholic",
        "Word Network",
        "Faith World TV",
        "KICC TV",
        "Faith UK",
        "Dunamis TV",
        "SonLife",
        "Cartoon Net HD",
        "CN+1",
        "Boomerang HD",
        "NickelodeonHD",
        "Nick Spongebob",
        "Nick Jr. HD",
        "CBBC HD",
        "CBeebies HD",
        "Sky Kids HD",
        "NickJrPAWPatrol",
        "Nick Jr+1",
        "Cartoonito",
        "Boomerang+1",
        "POP",
        "POP Max",
        "Nickelodeon+1",
        "POP Max+1",
        "POP+1",
        "Cartoon Netwrk",
        "QVC Beauty",
        "BabyTV",
        "Boomerang",
        "Nickelodeon",
        "Nick Jr.",
        "QVC HD",
        "Home Shop TV",
        "TJC HD",
        "QVC Style HD",
        "Gems TV",
        "High Street TV 1",
        "High Street TV 2",
        "Ideal World HD",
        "Best Direct",
        "HobbyMakerHD",
        "QVC Extra",
        "High Street TV 3",
        "Create&CraftHD",
        "JewelleryMaker",
        "High Street TV 4",
        "TV Warehouse",
        "Craft Extra",
        "Cruise1st.tv",
        "B4U Movies",
        "B4U Music",
        "SONY TV HD",
        "Utsav Bharat",
        "Utsav Plus HD",
        "COLORS HD",
        "Zee TV HD",
        "Zee Cinema",
        "MATV National",
        "AAJ TAK",
        "Dangal",
        "ColorsRishtey",
        "ColorsCineplex",
        "SONY MAX HD",
        "Utsav Gold HD",
        "SONY MAX 2",
        "Aastha",
        "SONY SAB",
        "Sanskar",
        "MTA1 World HD",
        "HUM Masala",
        "GEO News",
        "Noor TV",
        "IQRA TV",
        "Islam TV",
        "Ahlebait TV",
        "Takbeer TV",
        "GEO TV",
        "New Vision TV",
        "Islam Channel",
        "HUM EUROPE",
        "Islam Ch Urdu",
        "Madani Chnl",
        "Eman Channel",
        "ARY Digital",
        "Samaa TV",
        "Siraj TV",
        "QTV Religious",
        "Sikh Channel",
        "PBC",
        "PoliticsPunjab",
        "Pitaara ",
        "Kanshi TV",
        "Akaal Channel",
        "Sangat",
        "Brit Asia TV",
        "PTC PUNJABI",
        "Zee Punjabi",
        "CHSTV",
        "IQRA Bangla",
        "ATN",
        "NTV",
        "TV One",
        "iON TV",
        "Deen TV",
        "Islam Bangla",
        "SkyNewsArabia",
        "PCNE Chinese HD",
        "ColorsGujarati",
        "ITV1",
        "Channel 4",
        "Channel 5",
        "Sky Showcase",
        "Sky Witness",
        "Sky Atlantic",
        "alibi",
        "GOLD",
        "U&Dave",
        "ComedyCentral",
        "Sky Max",
        "Sky Comedy",
        "ITV2",
        "SkyDocumntrs",
        "Sky Crime",
        "Sky History",
        "Sky Nature",
        "Discovery",
        "MTV",
        "Nat Geo",
        "Sky Arts",
        "U&W",
        "TLC",
        "S4C",
        "E4",
        "More4",
        "QUEST",
        "Sky Sci-Fi",
        "Crime+Inv",
        "Sky History2",
        "Nat Geo Wild",
        "U&Yesterday",
        "Film4",
        "SkySpF1 UHD",
        "SkySpME UHD",
        "SkySp News",
        "TNTSports1 HD",
        "TNTSports2 HD",
        "Eurosport 1",
        "Eurosport 2",
        "SkySp Racing",
        "SkySp Mix",
        "TNTSports3 HD",
        "TNTSports4 HD",
        "Racing TV",
        "Sky News",
        "TRT World",
        "SONY TV",
        "Utsav Plus",
        "COLORS",
        "SONY MAX",
        "Utsav Gold",
        "Zee TV",
        "Sky Intro",
        "Television X",
        "Adult Channel",
        "Xpanded TV",
        "babes&brazzers",
        "Babenation",
        "TVX 40+",
        "XXX Girl Girl",
        "Climax",
        "Sky Intro (950)",
        "BBC One Lon HD",
        "BBC One NE HD",
        "BBC One NW HD",
        "BBC One Yks HD",
        "BBC One WM HD",
        "BBC One EMidHD",
        "BBC One EastHD",
        "BBC One SE HD",
        "BBC One Wst HD",
        "BBC One Sth HD",
        "BBC One SW HD",
        "BBC One CI HD",
        "BBC One ScotHD",
        "BBC One Wal HD",
        "BBC One NI HD",
        "BBC Two Wal HD",
        "BBC Two NI HD",
        "BBC RB 1 HD",
        "ITV1+1 (973)",
        "Sky Intro (998)",
        "BBC R1",
        "BBC R2",
        "BBC R3",
        "BBC R4",
        "BBC R5L",
        "Classic FM",
        "talkSPORT",
        "Capital",
        "Heart",
        "Heart 80s",
        "Radio X",
        "Capital XTRA",
        "BBC World Sv",
        "BBC R Scot",
        "BBC R Wales",
        "BBC R Ulster",
        "BBC Asian Net",
        "BBC R6 Music",
        "Gold",
        "WRN Europe",
        "LBC",
        "Smooth",
        "Panjab Radio",
        "BBC R4 Extra",
        "BBC R1X",
        "TWR",
        "BBC RnG\u00e0id",
        "BBC R5SX",
        "Heart Dance",
        "BBC R Cymru",
        "RT\u00c9 Radio 1",
        "RT\u00c9 2FM",
        "RT\u00c9 Lyric fm",
        "RT\u00c9 R na G",
        "EWTN Catholic (0147)",
        "BFBS Radio",
        "Virgin Radio",
        "Heart 90s",
        "BBC R Cymru 2",
        "BBC R Foyle",
        "LBC News",
        "Chl Line-up"
      ],
      "tv_device_class": true,
      "epg_cache_len": 20,
      "add_backup": false
    },
    "device_information": {
      "ASVersion": "Q270.000.08.00-AS_31.3.0",
      "IPAddress": "10.2.1.120",
      "countryCode": "GBR",
      "used_country_code": "GBR",
      "hardwareModel": "ES240",
      "hardwareName": "Falcon",
      "deviceType": "GATEWAYSTB",
      "gateway": true,
      "gatewayIPAddress": "not MR",
      "manufacturer": "Sky",
      "modelNumber": "Q270.000.08.00L (5u193c0)",
      "serialNumber": "0623620411 5",
      "versionNumber": "32B107",
      "bouquet": 4101,
      "subbouquet": 29,
      "wakeReason": "RESET",
      "systemUptime": 143207,
      "hdrCapable": true,
      "uhdCapable": true,
      "presentLocalTimeOffset": 3600,
      "utc": 1724783407,
      "futureLocalTimeOffset": 0,
      "futureTransitionUtc": 1729990800
    }
  }
}

Configuration YAML

No response

Anything in the logs that might be useful for us?

2024-08-27 19:27:17.626 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [139863882066976] Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 241, in handle_call_service response = await hass.services.async_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2763, in async_call response_data = await coro ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/core.py", line 2806, in _execute_service return await target(service_call) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 999, in entity_service_call single_response = await _handle_entity_call( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1071, in _handle_entity_call result = await task ^^^^^^^^^^ File "/config/custom_components/skyq/media_player.py", line 496, in async_volume_up await self._volume_entity.async_volume_up(self.hass) File "/config/custom_components/skyq/classes/volumeentity.py", line 105, in async_volume_up await self._async_call_service(hass, SERVICE_VOLUME_UP, data) File "/config/custom_components/skyq/classes/volumeentity.py", line 118, in _async_call_service await async_call_from_config( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 333, in async_call_from_config params = async_prepare_call_from_config( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 364, in async_prepare_call_from_config domain_service = config[CONF_SERVICE_TEMPLATE]


KeyError: 'service_template'

### Additional information

_No response_
RogerSelwyn commented 2 months ago

I’m on holiday at the moment so won’t look at this for at least a week. Also I don’t have a sky box anymore and never had an LG TV, so this may be a challenge.

I’ll try to dig out what call is being made, but pretty sure it is just calling volume up directly against the LG entity, so no idea why it is complaining about service template.

Can you post here a working call using the service tab in Developer tools, then I may be able to envision what is going on.

RogerSelwyn commented 1 month ago

Fixed with - https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/releases/tag/v2.11.10

SparkyDan555 commented 1 month ago

Can confirm, this is now fixed. Thanks!