Netgear Enhanced (sensors and switches for router controls)

I wanted to extend the functionality of the pynetgear lib due to additional SOAP endpoints being available. I have been working on a rewrite of the lib, and have renamed it to pynetgear_enhanced. I then created a sensor and switch component to work with it. There are no conflicts with pynetgear or the device tracker, so those can stay for now.
If you want to update it to only use this lib, you can use the included device_tracker.py file.

Disclaimer: I am not the original author of the pynetgear lib.

A link to the custom components can be found here:

An updated link to github due to server issues can be found here:

I have had it running for a few days and it appears to be working well.
You can read about the supported sensors/switches in the readme.
It polls every 5 minutes to minimize strain on the router. I personally tested on the RAX80.

There are command line options in the python lib that allow other things that i am trying to figure how to integrate. for instance: performing a speed test.

The sensors and switches are prefixed with ng_enhanced_

The supported sensors are:

  • Check Firmware
  • Access Control Status
  • Traffic Meter Statistics
  • Traffic Meter Status
  • Traffic Meter Options
  • Parental Control Enabled
  • MAC Addresses
  • DNS Masq # Not currently working correctly
  • Get Router Info
  • Supported Features
  • Speed Test Resluts
  • QOS Enabled
  • Bandwidth Control
  • 2.4g Guest Access Status
  • 5g Guest Access Status
  • 2.4g WPA Key
  • 5g WPA Key
  • 2.4g Wifi Info
  • 5g Wifi Info
  • 2.4g Guest Wifi Info
  • 5g Guest Wifi Info

The supported switches are:

  • Access Control
  • Traffic Meter
  • Parental Control
  • QOS
  • 2.4g Guest WiFi
  • 5g Guest WiFi
  • Run Speed Test (switch will always toggle to off)
  • Reboot Router (switch will always toggle to off)

Let me know your thoughts.

7 Likes

Examples of what shows up in Hass:
Switches:


Sensors:

Some sensors have attributes:

Hi!
This look really intresting!! But the link seams dead…

edit: Never mind, it works today.

This component is missing a manifest file. can you provide that?

Yeah give me a fw days and I can update it. My working copy is up to date, just haven’t pushed it to the repo.

1 Like

Any news? :grinning:

Ok, i have updated my github repo, sorry for the delay. One thing to note… occasionally i have discovered my router does not like all of the incomming SOAP requests, and will start to block all SOAP requests (the webpage is still accessible). A simple reboot of the router solves the issue.

Nice, will try it out! How often do you need to reboot?

Did not work on my netgear Nighthawk® X4S R7800
log: https://pastebin.com/7qSEVF1D

Try rebooting the router. If the device_tracker from the official component works, this one should work also. Im using it with a RAX80.

will test more tomorrow when the wife is not watching tv :slight_smile:

1 Like

Hey,
this looks awesome, will test out shortly.
a quick question - does it allow you to enable the guest wifi for “x” hours only and then turn off again?

nice!
this is awesome! thank you :slight_smile:
any way we can pull the guest key too?

hey, getting a lot of errors atm

Connection error: HTTPConnectionPool(host=‘192.168.0.1’, port=5000): Max retries exceeded with url: /soap/server_sa/ (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0xb1357ff0>: Failed to establish a new connection: [Errno 111] Connection refused’))

You need to reboot the router. With all the pinging of the router it occasionally crashes the soap server. I havent figured out why yet, which is why I havent created a pr. As soon as this is resolved, I intend to make it a permanent addition to hass.

I will thing work with the netgear nighthawk x6 or x8?
I’ve not purchased it yet so cant test it

A very nice component for controlling the guest WIFI with google calendar.
I get some errors but it seems to be working fine (I have an Orbi RBR50).

Invalid response
7:12 PM custom_components/netgear_enhanced/switch.py (ERROR) - message first occured at October 16, 2019, 11:06 AM and shows up 1344 times

2019-10-18 19:57:03 DEBUG (SyncWorker_16) [custom_components.netgear_enhanced.switch] Netgear Switch update function
2019-10-18 19:57:03 DEBUG (SyncWorker_16) [custom_components.netgear_enhanced.switch] Netgear Switch Access Control: 0: False
2019-10-18 19:57:03 DEBUG (MainThread) [custom_components.netgear_enhanced.switch] Netgear Switch: check if Access Control is on.
2019-10-18 19:57:03 DEBUG (SyncWorker_19) [custom_components.netgear_enhanced.switch] Netgear Switch update function
2019-10-18 19:57:03 DEBUG (SyncWorker_19) [custom_components.netgear_enhanced.switch] Netgear Switch Guest Wifi: 0: False
2019-10-18 19:57:03 DEBUG (MainThread) [custom_components.netgear_enhanced.switch] Netgear Switch: check if Guest Wifi is on.
2019-10-18 19:57:03 DEBUG (SyncWorker_7) [custom_components.netgear_enhanced.switch] Netgear Switch update function
2019-10-18 19:57:03 DEBUG (SyncWorker_7) [custom_components.netgear_enhanced.switch] Netgear Switch 5G Guest Wifi: 0: False
2019-10-18 19:57:03 DEBUG (MainThread) [custom_components.netgear_enhanced.switch] Netgear Switch: check if 5G Guest Wifi is on.
2019-10-18 19:57:03 DEBUG (SyncWorker_11) [custom_components.netgear_enhanced.switch] Netgear Switch update function
2019-10-18 19:57:03 DEBUG (SyncWorker_11) [custom_components.netgear_enhanced.switch] Netgear Switch Run a Speed Test: : False
2019-10-18 19:57:03 DEBUG (MainThread) [custom_components.netgear_enhanced.switch] Netgear Switch: check if Run a Speed Test is on.
2019-10-18 19:57:03 DEBUG (SyncWorker_0) [custom_components.netgear_enhanced.switch] Netgear Switch update function
2019-10-18 19:57:03 ERROR (SyncWorker_0) [pynetgear_enhanced] Invalid response
2019-10-18 19:57:03 DEBUG (SyncWorker_0) [custom_components.netgear_enhanced.switch] Netgear Switch QOS: : False
2019-10-18 19:57:03 DEBUG (MainThread) [custom_components.netgear_enhanced.switch] Netgear Switch: check if QOS is on.
2019-10-18 19:57:03 DEBUG (SyncWorker_5) [custom_components.netgear_enhanced.switch] Netgear Switch update function
2019-10-18 19:57:03 DEBUG (SyncWorker_5) [custom_components.netgear_enhanced.switch] Netgear Switch Reboot Router: : False
2019-10-18 19:57:03 DEBUG (MainThread) [custom_components.netgear_enhanced.switch] Netgear Switch: check if Reboot Router is on.
2019-10-18 19:57:03 DEBUG (SyncWorker_8) [custom_components.netgear_enhanced.switch] Netgear Switch update function
2019-10-18 19:57:03 ERROR (SyncWorker_8) [pynetgear_enhanced] Invalid response
2019-10-18 19:57:03 DEBUG (SyncWorker_8) [custom_components.netgear_enhanced.switch] Netgear Switch Parental Control: : False
2019-10-18 19:57:03 DEBUG (MainThread) [custom_components.netgear_enhanced.switch] Netgear Switch: check if Parental Control is on.
2019-10-18 19:57:03 DEBUG (SyncWorker_6) [custom_components.netgear_enhanced.switch] Netgear Switch update function
2019-10-18 19:57:04 DEBUG (SyncWorker_6) [custom_components.netgear_enhanced.switch] Netgear Switch Traffic Meter: 1: True
2019-10-18 19:57:04 DEBUG (MainThread) [custom_components.netgear_enhanced.switch] Netgear Switch: check if Traffic Meter is on.

The Invalid response is always next to Netgear Switch Parental Control: : False and Netgear Switch QOS: : False in the log.
Would it be possible to only have certain switches available (as for the sensors)?

Deleted the lines of the switches I dont intend to use in the switch.py file, now no more errors.

1 Like

Hi ricc,
can you please confirm you are still able to toggle the guest wifi?

I’ve just installed the Orbi22 and would like some functionality added to home assistant.

Yes, I removed all the other switches except reboot and guest wifi, havent tried the reboot yet but the guest wifi switching is working fine.

1 Like