Custom Component: SkyQ Media Player

Also with 2.1.5 i get the urllib3 error for the box that is in standby:

`2020-04-25 02:19:49 WARNING (SyncWorker_19) [pyskyqremote.skyq_remote] W0020 - Control URL not accessible: 192.168.1.242 : http://192.168.1.242:49153/description34.xml
2020-04-25 02:19:50 ERROR (SyncWorker_19) [pyskyqremote.skyq_remote] X0070 - Connection error: 192.168.1.242 : HTTPConnectionPool(host='192.168.1.242', port=49153): Max retries exceeded with url: /description35.xml (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f636bc31160>: Failed to establish a new connection: [Errno 113] No route to host'))
Traceback (most recent call last):
  File "/home/pi/hassmar20/lib/python3.7/site-packages/urllib3/connection.py", line 160, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/home/pi/hassmar20/lib/python3.7/site-packages/urllib3/util/connection.py", line 84, in create_connection
    raise err
  File "/home/pi/hassmar20/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
OSError: [Errno 113] No route to host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/hassmar20/lib/python3.7/site-packages/urllib3/connectionpool.py", line 677, in urlopen
    chunked=chunked,
  File "/home/pi/hassmar20/lib/python3.7/site-packages/urllib3/connectionpool.py", line 392, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.7/http/client.py", line 1229, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1275, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1224, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/usr/local/lib/python3.7/http/client.py", line 1016, in _send_output
    self.send(msg)
  File "/usr/local/lib/python3.7/http/client.py", line 956, in send
    self.connect()
  File "/home/pi/hassmar20/lib/python3.7/site-packages/urllib3/connection.py", line 187, in connect
    conn = self._new_conn()
  File "/home/pi/hassmar20/lib/python3.7/site-packages/urllib3/connection.py", line 172, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7f636bc31160>: Failed to establish a new connection: [Errno 113] No route to host

During handling of the above exception, another exception occurred:

There’s a way to handle that? I’ve read a previous post from @MadmanMonty but can’t find how to implement that solution on @RogTP updated version.

Anyway, thanks for that

Does you HA get rebooted during the night? I’m pretty sure that error can only occur during startup. I’ll have a look why it got a warning and an exception. Pretty sure I haven’t changed that logic recently.

Yes, once a week. It seems to occur only during startup and only from the box that is in standby (2 others works well). Didn’t know about previous version, I’ve updated yesterday from the first 4n0nD3v3l0p3r version (that has the similiar issue) to Your v2.1.5.

With that error the media_player entity (for that box) is not created at all.

I’ve done a fairly substantial re-working of the previous versions, plus adding new features, so any ‘fix’ for versions before v2 will not apply here.

I’ll PM you details of a test version, when I’ve worked it through.

How do you get that scrolling channel bit below your media player? Love that!!!

That’s created using the swiper card

The above post has some great examples to work with…I’m just using a call-service with the tap_action.

Happy to share my config

1 Like

Thanks Dan! Are you using a custom button card with image for your PS4 games or a picture element?

Cannot work out how to use custom button with an image that fills the button.

Do you mind sharing your config?

Sorry I forgot that part, it’s picture-entity

 - type: custom:swipe-card
        card_width: '185px'
        start_card: 2
        parameters:
          effect: 'coverflow'
          grabCursor: true
          centeredSlides: true
          slidesPerView: 'auto'
          coverflowEffect:
            rotate: 50
            stretch: 0
            depth: 100
            modifier: 1
            slideShadows : true
          pagination:
            type: 'bullets'
        cards:
          - type: picture-entity
			entity: media_player.skyq
			image: /local/skyq/images/bbc.png
			tap_action:
			  action: call-service
			  service: media_player.select_source
			  service_data: BBCOne

Good job! It works great. thank you very much

1 Like

My pleasure.

Could this be submitted to official HA Integrations? thanks

At the moment no. This is because it does not support configuration via the ui, it can only be configured by YAML. This is something I intend to get to, but I’m trying t get it properly stable first. So I’m ‘improving’ the code and structure, and I’ve added Italy support (which is a real challenge, because I don’t have an Italian sky box to gets against, but I’ve had some very tolerant helpers).

So still quite a lot to do first.

1 Like

Where did you find all the sky channels images?

Just a google image search

Can I just say I love this app now! the live pictures etc are great!

Is there a way I can change my background image so that if I am watching Netflix it has the netflix logo?

I have an image for when the box is off, and your images for when its on and watching a channel but one for when its on Netflix would be great, even if I need to add this somehow to the mini media code?

If you have a look at my GitHub site, you will see some instructions on what to do for that. Basically put some images in <config directory>/www/community/skyq/. I have some, including Netflix on the Github.

Perfect thanks.

I have noticed an error in my logs too, doesnt seem to impact anything but not sure if you’ve seen it before:

Logger: homeassistant.components.homekit.type_media_players
Source: components/homekit/type_media_players.py:408
Integration: HomeKit (documentation, issues)
First occurred: 4:13:40 PM (6 occurrences)
Last logged: 4:24:23 PM

media_player.skyq_living_room: Sources out of sync. Restart Home Assistant

Actually, ignore me, in pasting it I can see its homekit related not skyq related as such!

Over the last 10 days or so, I’ve made some quite substantial changes to the SkyQ component. Hopefully many of the changes make it more stable, but some of them are to do with bringing it more in line with current design practices for HA.

On the outside that has little visible impact. Along the way I’ve fixed a few bugs as well. Also some enhancements, such as the removal of the need to provide country in the config for non-UK countries since it now picks this up from the SkyQ box (GBR and ITA only at the moment).

If you get a chance and are willing, I’d appreciate people to take a look at the latest beta (currently beta6), and let me know if you have any problems. If you do encounter problems then the following information is helpful:

  • What were you doing at the time ?
  • What channel are you on ?
  • What time did the problem occur (because then I can go back and look at EPGs) ?
  • Provide a copy of any errors in the logs from the skyq custom component, or pyskyqremote.
  • Anything else you think might be useful

If you can post the info on GitHub, that would help, rather than doing debugging on this thread.

1 Like

Hi Roger, I’ve dropped a bug/issue into GitHub just now.
Turns out the component worked fine with country code IRL too for Irish SkyQ boxes but now with the 2.1.6beta6 version it’s no longer working (citing invalid country code, which I suppose is pretty much by design for now but hopefully can be added back in)
Hopefully have enough info in GitHub for you…shout if not :+1: