Ziggo mediabox next

Hi,

Just installed your Ziggo Next plugin, and it works great.
I also have a google home mini, I have exposed the media_player component to google home via Home Assistant Cloud.

However if I look in my google home app it is listed as a Switch rather than a media player item. Because of it being a switch I can turn on and off my Ziggo Next with the Mini but im not able to change the source to another channel.
Is it possible to integrate this??

Regards Jordy

I’ll try to find that one out. Not sure how to achieve this…

i thought it should be yeloplay.be instead of telenettv.be?
No popup there.

It uses openid OAuth with username and password at https://login.prd.telenet.be/openid/login

login.prd.telenet.be/openid/oauth/authorize?client_id=yelo&state=somecode&nonce=somecode&redirect_uri=https%3A%2F%2Fwww.yeloplay.be%2Fopenid%2Fcallback&response_type=code&prompt=login

yeloplay.be/openid/callback?code=somecode&state=somecode

@sholofly after updating to 106.2 the Ziggo next integration is not working anymore.
More people with this issue?

I’m on that version and it does well here. What is the problem?

Sensor and media player are not updating.

Logboekdetails ( ERROR )
Logger: homeassistant.helpers.entity
First occured: 21:36:10 (1 occurences)
Last logged: 21:36:10

Update for media_player.ziggonext_beneden fails
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
    (self._dns_host, self.port), self.timeout, **extra_kw
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 61, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/usr/local/lib/python3.7/socket.py", line 752, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
    chunked=chunked,
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
    self._validate_conn(conn)
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
    conn.connect()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 300, in connect
    conn = self._new_conn()
  File "/usr/local/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
    self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x6aef1790>: Failed to establish a new connection: [Errno -3] Try again

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
    timeout=timeout
  File "/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
    method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='web-api-prod-obo.horizon.tv', port=443): Max retries exceeded with url: /oesp/v3/NL/nld/web/channels (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6aef1790>: Failed to establish a new connection: [Errno -3] Try again'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update
    await self.hass.async_add_executor_job(self.update)
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/ziggonext/media_player.py", line 69, in update
    self.api.load_channels()
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 178, in load_channels
    response = requests.get(self._api_url_channels)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='web-api-prod-obo.horizon.tv', port=443): Max retries exceeded with url: /oesp/v3/NL/nld/web/channels (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x6aef1790>: Failed to establish a new connection: [Errno -3] Try again'))
Logger: homeassistant.setup
First occured: 8:32:49 (1 occurences)
Last logged: 8:32:49

Error during setup of component ziggonext
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 174, in _async_setup_component
    component.setup, hass, processed_config  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/ziggonext/__init__.py", line 30, in setup
    api.initialize(_LOGGER)
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 122, in initialize
    self.get_session_and_token()
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 88, in get_session_and_token
    self._get_token()
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 115, in _get_token
    jsonResult = self._do_api_call(self.session, self._api_url_token)
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 111, in _do_api_call
    raise ZiggoNextConnectionError("API call failed: " + str(response.status_code))
ziggonext.exceptions.ZiggoNextConnectionError: API call failed: 403

Yep, issues here… 403 forbidden…

Strange, can’t reproduce it, but i have an idea. Hard to check though. Does a reboot solve the issue?

No, unfortunately a reboot doesn’t solve the issue.

Now updated to version 106.5 and the ziggonext is working again.

Update:
I was a little too fast. After it has been running for a day, it does not work optimally. Have the same as with the 106.2 update. The sensor and the media player are not updated. The media player indicates that he is playing something but does not show anything.

Found the issue! Did some requests manually in order to get the ‘X-OESP-Token’, these failed too.
Until i changed the uppercase letters in my username to lowercase, now it’s working again! :grinning:

Strange, cause it worked the last weeks great…

Hello,

I have the same Issue right now.
Ziggo Next is not working after upgrading to version 0.106.5.

2020-03-07 07:03:04 ERROR (MainThread) [homeassistant.setup] Error during setup of component ziggonext
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 174, in _async_setup_component
    component.setup, hass, processed_config  # type: ignore
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/ziggonext/__init__.py", line 30, in setup
    api.initialize(_LOGGER)
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 122, in initialize
    self.get_session_and_token()
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 88, in get_session_and_token
    self._get_token()
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 115, in _get_token
    jsonResult = self._do_api_call(self.session, self._api_url_token)
  File "/usr/local/lib/python3.7/site-packages/ziggonext/ziggonext.py", line 111, in _do_api_call
    raise ZiggoNextConnectionError("API call failed: " + str(response.status_code))
ziggonext.exceptions.ZiggoNextConnectionError: API call failed: 403

Reinstalling the component (HACS) or rebooting does not help…

How to resolve this one?

Have you tried to lower case your username?

1 Like

I did not try that one. I have read it already above.

I was asuming that changing the username (partly uppercase) would give me a login faillure.
But I give it a try. And your correct! Now this component is working again!

Thanks for pointing me in the right direction and for this component!
Thumbs up!

André

any news on the telenet integration?

Hello, many thanks for this integration! I have been using it for some time now. But every now and then my credentials stop working (also on the Ziggo site) and I need to reset my password. After this it works fine again! Is this a known issue with this integration? Or do I need to look somewhere else?

If it’s the same on the website,It isn’t a component related thing i guess. I do not recognize the problem!

Sorry, it’s very hard for me to test this, can you share your config?

It is just the standard config, didn’t change anything. But I understand it is difficult to test, I was just wondering more people have the issue. I thought that maybe after X amount of logins it automatically resets or something (even though I don’t get an email about this from Ziggo).

Strange issue, I will continue my investigation

For logging in, a token is involved. That token has an expiry time but the component should automatically refresh its token when it’s expired. Do you see errors in the log?