Netgear Presence Detection Errors

I have tried Setting up Netgear presence detection, but I keep getting a whole bunch of errors when I try to launch HA. I am not sure how to fix these, but I’m sure someone way smarter than me here will know what I can do to get these errors resolved.

Config:

device_tracker:
  - platform: netgear
    host: 192.168.1.1:80
    username: MyUSERNAME
    password: MyPASSWORD
    interval_seconds: 10
    consider_home: 180
    new_device_defaults:
      track_new_devices: true

First Error:

Logger: pynetgear
Source: /usr/local/lib/python3.9/site-packages/pynetgear/__init__.py:398
First occurred: 9:17:03 AM (2 occurrences)
Last logged: 9:17:03 AM

Error talking to API
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 382, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/url.py", line 394, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
  File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: http://192.168.1.1:80:5000/soap/server_sa/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pynetgear/__init__.py", line 374, in _make_request
    response = requests.post(self.soap_url, headers=headers,
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 384, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://192.168.1.1:80:5000/soap/server_sa/

Second Error:

Logger: pynetgear
Source: /usr/local/lib/python3.9/site-packages/pynetgear/__init__.py:139
First occurred: 9:17:03 AM (1 occurrences)
Last logged: 9:17:03 AM

Get attached devices failed

Third Error, which baffles me because I am sure I typed in my correct login info in the config.

Logger: homeassistant.components.netgear.device_tracker
Source: components/netgear/device_tracker.py:64
Integration: netgear (documentation, issues)
First occurred: 9:17:03 AM (1 occurrences)
Last logged: 9:17:03 AM

Failed to Login

Fourth Error:

Logger: homeassistant.components.device_tracker
Source: components/device_tracker/legacy.py:271
Integration: Device tracker (documentation, issues)
First occurred: 9:17:06 AM (1 occurrences)
Last logged: 9:17:06 AM

Error setting up platform legacy netgear

Any help would be greatly appreciated!

From your first error message

That’s two ports concatenated onto each other. Completely invalid.

Looks like it is expecting to use port 5000 but you specified 80 in the tracker host option instead of in it’s own option like this:

device_tracker:
  - platform: netgear
    host: 192.168.1.1
    port: 80
    username: MyUSERNAME
    password: MyPASSWORD
    interval_seconds: 10
    consider_home: 180
    new_device_defaults:
      track_new_devices: true

Give that a go.

Changed the port to 5000 on config file.B but I’m still getting the same error, but with port 5000 instead of 80. And ell other error code remain the same

Logger: pynetgear
Source: /usr/local/lib/python3.9/site-packages/pynetgear/__init__.py:398
First occurred: 9:55:27 AM (2 occurrences)
Last logged: 9:55:27 AM

Error talking to API
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 382, in prepare_url
    scheme, auth, host, port, path, query, fragment = parse_url(url)
  File "/usr/local/lib/python3.9/site-packages/urllib3/util/url.py", line 394, in parse_url
    return six.raise_from(LocationParseError(source_url), None)
  File "<string>", line 3, in raise_from
urllib3.exceptions.LocationParseError: Failed to parse: http://192.168.1.1:5000:5000/soap/server_sa/

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pynetgear/__init__.py", line 374, in _make_request
    response = requests.post(self.soap_url, headers=headers,
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 528, in request
    prep = self.prepare_request(req)
  File "/usr/local/lib/python3.9/site-packages/requests/sessions.py", line 456, in prepare_request
    p.prepare(
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 316, in prepare
    self.prepare_url(url, params)
  File "/usr/local/lib/python3.9/site-packages/requests/models.py", line 384, in prepare_url
    raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://192.168.1.1:5000:5000/soap/server_sa/

Seems like when I left the port number as the default, it went through without issues!

Why?

If you are sure it is port 80, just specify it this way:

device_tracker:
  - platform: netgear
    host: 192.168.1.1
    port: 80       #### <-------- LIKE THIS
    username: MyUSERNAME
    password: MyPASSWORD
    interval_seconds: 10
    consider_home: 180
    new_device_defaults:
      track_new_devices: true

Not like you had it:

device_tracker:
  - platform: netgear
    host: 192.168.1.1:80   #####  <------ NOT LIKE THIS
    username: MyUSERNAME
    password: MyPASSWORD
    interval_seconds: 10
    consider_home: 180
    new_device_defaults:
      track_new_devices: true
1 Like

Great but do you see where you went wrong in specifying the port?

You cant specify it as part of host: it has it’s own option port:

I see the port should be separate option as it states in the installation page. I just assumed the port would go with the IP address as is customary in networking.

1 Like