[Component] Experiabox V10A device tracker (KPN)

Can you try host: mijnmodem.kpn ?

Thanks. This tracking method works better than any other tracking events I have used. Cheers.

Hi FrankZZ, thanks for this script! I was looking for this. Got it installed but get an error in HA. Tried both the IP adres and “mijnmodem.kpn”

any idea what goes wrong? I run HA in docker on a synology NAS ds218+. Below is my configuration and the error code.

device_tracker:
  - platform: experiaboxv10a
    host: mijnmodem.kpn
    username: admin
    password: ********
    interval_seconds: 10
    consider_home: 180
    new_device_defaults: 
      track_new_devices: true
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 485, in wrap_socket
    cnx.do_handshake()
  File "/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1934, in do_handshake
    self._raise_ssl_error(self._ssl, result)
  File "/usr/local/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1671, in _raise_ssl_error
    _raise_current_error()
  File "/usr/local/lib/python3.7/site-packages/OpenSSL/_util.py", line 54, in exception_from_error_queue
    raise exception_type(errors)
OpenSSL.SSL.Error: [('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')]
` ` `

Hi FrankZZ,

In this script for the V10a I noticed device tracking is also possible on the Experia WiFi devices.
I see your script is based on the Experiabox V10 and I was wondering if it would be possible to change the script so that device tracking is also possible on WiFi versterkers connected to a V10?

Thanks,
Erik

Hi Chronos,

I had the same error. I managed to solve it by adding “verify=False” to the session initialisation in the device_tracker.py
I also changed all “http” to “https” for good measure at the same time, so it might be that both are needed.

This is my first dabble at python and the only development experience I have is light scripting, so don’t pin me on this be the end all solution for this, but I hope it might steer you in the right direction.

Cheers

It’s cool to see people using my component. I will update it probably tomorrow or Friday to fix the issues you are having, please stay tuned!

Hi Erik, this component is specific for the V10A. There is a device_tracker already for the V10:

Hi FrankZZ, I know about and installed the device_tracker for the V10. :+1:
The problem is that it doesn’t track the 3 (witte) WiFi versterkers (configured as Accesspoint) connected to my V10. Once it connected to only 1 of the 3 but also no device connected to the WiFi versterker were tracked.

Update: I’ve pushed and released version 0.2.1 of this component which includes the fixes for HTTPS verification.
It’s also a tad quicker because I could shave off one request every time it updates devices.

Tested it and worked for me, please let me know!

Hi Erik,

Are you talking about this particular device?
https://gathering.tweakers.net/forum/list_messages/1882915

if so, I can try to spend some time later to scrape it, which will probably be a separate component

Hi FrankZZ,

No I’m talking about the old ones:
https://tweakers.net/pricewatch/457255/kpn-wifi-versterker-dualband-arcadyan/specificaties/

Ah, I see. I don’t own such a device, which makes it very hard to support it.

I gave this component another try, but I can’t get it to work. This is my config (the # is the ones I tried to turn on and off, but no luck). Can anyone see what I am doing wrong?

device_tracker:

#device tracker experia
  - platform: experiaboxv10a
    host: mijnmodem.kpn
#    host:  
    username: admin
    password: !secret routerwachtwoord
#    new_device_defaults:
#      track_new_devices: true
#      hide_if_away: False
Log Details (ERROR)
Wed Apr 22 2020 20:58:28 GMT+0200 (Midden-Europese zomertijd)
Error setting up platform legacy
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 748, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

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 334, 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 0x703d78f0>: Failed to establish a new connection: [Errno -2] Name does not resolve

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='mijnmodem.kpn', port=443): Max retries exceeded with url: /login.htm (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x703d78f0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 65, in async_setup_legacy
    self.platform.get_scanner, hass, {DOMAIN: self.config}
  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/experiaboxv10a/device_tracker.py", line 32, in get_scanner
    return ExperiaBoxV10ADeviceScanner(config[DOMAIN])
  File "/config/custom_components/experiaboxv10a/device_tracker.py", line 58, in __init__
    self.success_init = self._update_info()
  File "/config/custom_components/experiaboxv10a/device_tracker.py", line 96, in _update_info
    page_initial = session.get(login_url_initial, timeout = 10, verify = self.ca_cert_bundle)
  File "/usr/local/lib/python3.7/site-packages/requests/sessions.py", line 546, in get
    return self.request('GET', 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='mijnmodem.kpn', port=443): Max retries exceeded with url: /login.htm (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x703d78f0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

I have the same issue, i also run HASS from a syno DS218+, can’t get it working.

I programmed it like this:

device_tracker:

  • platform: experiaboxv10a
    host: mijnmodem.kpn
    username: admin
    password: mysecret!
    interval_seconds: 10
    consider_home: 180
    new_device_defaults:
    track_new_devices: true

Error setting up platform legacy
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 160, 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 -2] Name does not resolve

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 677, in urlopen
chunked=chunked,
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 381, in _make_request
self._validate_conn(conn)
File “/usr/local/lib/python3.7/site-packages/urllib3/connectionpool.py”, line 976, in _validate_conn
conn.connect()
File “/usr/local/lib/python3.7/site-packages/urllib3/connection.py”, line 308, in connect
conn = self._new_conn()
File “/usr/local/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.HTTPSConnection object at 0x7fa2b0f15150>: Failed to establish a new connection: [Errno -2] Name does not resolve

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 725, 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 439, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host=‘mijnmodem.kpn’, port=443): Max retries exceeded with url: /login.htm (Caused by NewConnectionError(’<urllib3.connection.HTTPSConnection object at 0x7fa2b0f15150>: Failed to establish a new connection: [Errno -2] Name does not resolve’))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py”, line 64, in async_setup_legacy
self.platform.get_scanner, hass, {DOMAIN: self.config}
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/experiaboxv10a/device_tracker.py”, line 32, in get_scanner
return ExperiaBoxV10ADeviceScanner(config[DOMAIN])
File “/config/custom_components/experiaboxv10a/device_tracker.py”, line 58, in init
self.success_init = self._update_info()
File “/config/custom_components/experiaboxv10a/device_tracker.py”, line 96, in _update_info
page_initial = session.get(login_url_initial, timeout = 10, verify = self.ca_cert_bundle)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 543, in get
return self.request(‘GET’, url, **kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 530, in request
resp = self.send(prep, **send_kwargs)
File “/usr/local/lib/python3.7/site-packages/requests/sessions.py”, line 643, 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=‘mijnmodem.kpn’, port=443): Max retries exceeded with url: /login.htm (Caused by NewConnectionError(’<urllib3.connection.HTTPSConnection object at 0x7fa2b0f15150>: Failed to establish a new connection: [Errno -2] Name does not resolve’))
Verbinding verbroken. Opnieuw verbinden…

Since the host “mijnmodem.kpn” is probably served by the DNS server of the KPN box, can you verify that you are using the DNS server of your Experiabox?
If you are not, you could add an alias to your /etc/hosts for it?

Hi Frank,

i tried to get this working on Telfort with the experiabox v10a. But unfortunately no succes.
if filled in the ip-address as the host (mijnmodem.kpn or similar does not exist in telfort environment)
I don’t think the telfort software works with SSL as well. Could you guide me to achieve this?

Is this project still alive? I have tried to get it running, but i can’t (i get a platform not found error). Or is there a new way?

I’m also interested for somebody who has a experiabox. I only want to use it to see some traffic from the wan port.

Greetings Thetmar.

I was hoping I could use this tracker but I get the following error:

Configuration warnings

Platform error ‘device_tracker’ from integration ‘experiaboxv10a’ - Integration ‘experiaboxv10a’ not found.