Netgear Enhanced (sensors and switches for router controls)

many thanks for the response,
did you just remove them from the SWITCH_TYPES list or did you edit anything else?

also which switch turns on guest wifi 2.4 or 5?

From line 30 to 55 in the netgear_enhanced/switch.py I only left this:

SWITCH_TYPES = {

    '2g_guest_wifi': [
        'Guest Wifi', 'set_guest_access_enabled',
        'get_guest_access_enabled', 'NewGuestAccessEnabled'],
    'reboot': [
        'Reboot Router', 'reboot',
        '', ''],
}

When I switch on guest 2.4ghz the guest 5ghz also changes to on from the router, so I only left the 2.4 switch.

1 Like

Thank you.

iā€™ve just installed it and started with a few of the sensors but im getting the below errors

i tried rebooting the router then restarting ha

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pynetgear_enhanced/__init__.py", line 103, in _make_request
    data=message, timeout=30, verify=False)
  File "/usr/local/lib/python3.7/site-packages/requests/api.py", line 116, in post
    return request('post', url, data=data, json=json, **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: HTTPConnectionPool(host='10.0.0.1', port=5000): Max retries exceeded with url: /soap/server_sa/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x70d92d50>: Failed to establish a new connection: [Errno 111] Connection refused'))
2019-10-21 21:41:17 ERROR (SyncWorker_15) [pynetgear_enhanced] Connection error: HTTPConnectionPool(host='10.0.0.1', port=5000): Max retries exceeded with url: /soap/server_sa/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x70d1d9f0>: Failed to establish a new connection: [Errno 111] Connection refused'))
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 84, in create_connection
    raise err
  File "/usr/local/lib/python3.7/site-packages/urllib3/util/connection.py", line 74, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

Have you added the port: line to the configuration with the correct number according to your setup?
5000 is standard by this component but not for Orbi.

Sorry it doesnā€™t mention anything about adding the port

Could you please share your setting?

I guess your port is 80, so just with the switch or sensor setup:

  • platform: netgear_enhanced
    host: 192.168.x.x
    port: 80
    username: username
    password: password

Will it work with the WN2000RPT router?

Thanks
I added it and it broken my HA I had lots or json errors and my front end wouldnā€™t load.

Ok, did you edit it first to fit you router with ip, port and username/password that you use?

Yes :slight_smile:
I did thank you for the help

Based on some feedback, i updated switches.py to allow selection of switches in config. If no resources are defined, all will be used, however you can pick and choose now without hacking the code. The new code is live on gitlab.

in your switches config

  - platform: netgear_enhanced
    host: !secret router_ip
    username: !secret netgear_user
    password: !secret netgear_pass
    resources:
      - 'access_control'
      - 'traffic_meter'
      - 'parental_control'
      - 'qos'
      - '2g_guest_wifi'
      - '5g_guest_wifi'
      - 'run_speed_test'
      - 'reboot'
2 Likes

Iā€™m really interested in getting notifications based on the monthly traffic. Iā€™m guessing I need to make a template sensor to pull the NewMonthDownload attribute out of the sensor.ng_enhanced_traffic_meter. Does anyone know how to do this or is there a better way?

hey! can you share what you do with google cal please?

@Bigrob8181
thanks so much for this, its awesome!!

any thoughts about adding this to Custom Component: HACS

2 Likes

With Google calendar and Netgear enhanced integrated into your HA, this automation makes the guest wifi follow the calendar state.

- id: auto_guest_wifi
  alias: Auto guest wifi
  trigger:
    platform: state
    entity_id: calendar.your_calendar
  action:
    - service_template: >
        {% if is_state('calendar.your_calendar','Toggle') %}
          switch.toggle
        {% else %}
          switch.turn_{{ states('calendar.your_calendar')|lower }}
        {% endif %}
      entity_id: switch.ng_enhanced_2g_guest_wifi
1 Like

Thanks! this is just what i need.
im slightly confused however, sorry!
if i have an event in my calendar called ā€œguestā€, how can i trigger this to turn on only on those days?

I have a calendar just for the guest wifi (this automation triggers on every event).
You only need to change the entity_idā€™s calendar.your_calendar (x3) and switch.ng_enhanced_2g_guest_wifi (x1) to match your IDā€™s.

If you just want trigger by special name then add a condition:

condition:
    condition: template
    value_template: "{{is_state_attr('calendar.your_calendar', 'message', 'vacation') }}"

See bottom on page:
Google Calendar Event

1 Like

Hey @Bigrob8181 - any thoughts on adding to HACS sorry?

3 Likes

hey - can you share you switch.py file please?
im getting so many errors too

Hey, I use the official version since the latest update. Now you can choose which switches to use and the modifying is not needed (for the faults I had). If you havenā€™t updated then have a look on the repo how to.