Custom Component: SkyQ Media Player

I thought that is what I installed.

My last HACS install attempt was v 2.4.3, which is why it is showing update available.

HACS_skyq

This is what the info says:

I am running HACS version 1.6.2 with Frontend version 202009091732 and I am running 54 repositories.

It looks to me like you have added it as a Lovelace rather than as an Integration. It shows as Lovelace in your first screenshot, which I don’t think it should. Lovelace I think would put it in the www directory.

Oops :grimacing:

That’s embarrassing :rofl:

That fixed it.

Thank you

1 Like

This looks like an excellent piece of work.

I’ve gone through the installation but all I’m seeing in options is this:

What am I missing?

What language do you have set in HA?

Thanks for replying, Roger.

I’m using English (GB).

If you could tell me what each section is, I could at least get started with setting things up.

A quick screenshot will do.

Strange. In theory Italian and German should work as well, so maybe worth changing to those and back again.

Thank you. Changing the language and then back fixed it.

What I can’t find now are the switches.

Should I be able to use something like:

service: switch.turn_on
entity_id: switch.bbc1

Or is am I misunderstanding the switch functionality?

Channels aren’t switches :grinning: If you could do a Turn On, you could logically do a Turn Off, which wouldn’t make sense.

The item you are looking for is media_player.select_source with an entity_id and a source.

Thank you, Roger.

What I was hoping for was to use it to automatically change channels and recording rather than triggering my Harmony IR.

Can it only be used as part of Lovelace and not automations?

Is medai_player.select_source a service that can be called?

Do you have links to any usage examples?

Yes it can be used in automations. Yes it is a service. If you go to the Developer/Services tab and select the media_player.select_source service it will show an example.

The media player services are documented here - https://www.home-assistant.io/integrations/media_player/ - though of course some do not work for SkyQ such as shuffle_set or repeast_set because they aren’t relevant.

I should add, you can use media_player.play_media to send button commands. The list of available commands is shown on my GitHub page. The media_content_type for a button command is ‘skyq’.

1 Like

Hi, i’ve installed your version through HACS, previously i had used yaml configuration for 3 sky q (1 platinum and 2 mini). I’ve correctly done, but i can’t use the media browser and i receive this errors:

Logger: homeassistant.components.media_player
Source: helpers/entity_platform.py:490
Integration: Lettore multimediale ([documentation](https://www.home-assistant.io/integrations/media_player), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+media_player%22))
First occurred: 18:21:16 (2 occurrences)
Last logged: 18:21:49

Platform skyq does not generate unique IDs. ID ITA04902930646 already exists - ignoring media_player.skyq_mansarda

And this one:

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/skyq/classes/mediabrowser.py:87
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: 18:26:37 (7 occurrences)
Last logged: 18:33:18

[140688746604288] Error handling message: Unknown error

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response await func(hass, connection, msg) File "/usr/src/homeassistant/homeassistant/components/media_player/__init__.py", line 1060, in websocket_browse_media payload = await player.async_browse_media(media_content_type, media_content_id) File "/config/custom_components/skyq/media_player.py", line 431, in async_browse_media return await self._media_browser.async_browse_media( File "/config/custom_components/skyq/classes/mediabrowser.py", line 35, in async_browse_media channellist = await self._async_prepareChannels(hass, channel_list) File "/config/custom_components/skyq/classes/mediabrowser.py", line 63, in _async_prepareChannels channels = await asyncio.gather( File "/config/custom_components/skyq/classes/mediabrowser.py", line 87, in _async_get_channelInfo programme = await hass.async_add_executor_job( File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.8/site-packages/pyskyqremote/skyq_remote.py", line 223, in getProgrammeFromEpg sidint = int(sid) ValueError: invalid literal for int() with base 10: 'M13e-4-218c-ffff'

The first error i think it’s because i still have the “old” config in the yaml file isn’t it? Should i remove the yaml config before usint the UI config? How can i add more then one SkyQ boxes? I can’t on the UI, but still working with the yaml (in the integration page show only 1 entity).

Can’t get the reason of the second one, i think it’s related to the media browser error

I would suggest getting no errors from the basic install first, before worrying about the media browser.

You should remove your yaml config (just comment it out) and reboot HASS before adding via the ui. Yes you can add multiple boxes via the ui, just keep adding new instances of the integration, they will get consolidated under one item in the Integrations dialogue.

Thank you, Roger.

Is this the kind of thing:

media_player.media_play
entity_id: media_player.sky_q
data:
  id: record
  type: skyq

I keep getting an ‘extra keys not allowed’ error.

Please look at the Services tab in the Developer pane for examples. In there you will see that it is:

  • media_player.play_media
  • media_content_id
  • media_content_type

I’m afraid I don’t use HASS Automations, I use Node Red to give myself some flexibility for complex routines, so I can’t comment on the actual structure of the automation.

following this as I would like to be able to have the Q box change channel at 6pm to BBC 1 for the news regardless of what is currently on.

I imagine it can be done, I know it can be done in Node Red. I don’t use HASS automations, so I can’t advise on the specific code to do it.

That’s how I use my Harmony at the moment, mainly for changing to timed events, and the automation I use work great but this SkyQ integration is so much better than Harmony control.

I just can’t figure how to use the buttons in yaml automations.

Thanks, Roger.

What happens for you when you click on ‘Call Service’ in your example?

All I get is an ‘Extra Keys not allowed @datat[media_content_id:]’ error.

media_player.play_pause, for example, works fine, but any buttons that don’t have a service just cause an error.