djtimca / hagooglewifi

Home Assistant integration for Google Wifi systems.
Apache License 2.0
79 stars 26 forks source link

Service: googlewifi.reset does not restart LAN interface #81

Open nathang21 opened 1 year ago

nathang21 commented 1 year ago

tl;dr this call appears to only reset the WiFi interface, but not the LAN interface.

All my wired devices remain connected to the router throughout the reset, which I have verified by ping. Even external internet requests while hard wired - continue to work. I realize there may not be anything this integration can do, as it's just calling the API's provided by Google, but I wanted to start an issue to document this for others who may misunderstand what this reset actually does.


I discovered this while debugging issues between my modem <=> Router, and to mitigate i'm trying to restart both nightly in sequence, which I have been doing manually for a while.

I'm using a Zigbee smart outlet for my modem, and was hoping to use this software restart, for the router. However it appears this does not actually restart the host OS on the routers, but perhaps just the WiFi interface/driver/mesh network.

To accomplish a full hardware restart, I may also need a smart outlet for the primary google router, will follow-up here once I know more.

Automation yaml

alias: Reset Internet Nightly
description: Modem + Google WiFi
trigger:
  - platform: time
    at: "04:30:00"
condition: []
action:
  - service: googlewifi.reset
    data:
      entity_id: binary_sensor.google_wifi_system_<UUID>
  - delay:
      hours: 0
      minutes: 15
      seconds: 0
      milliseconds: 0
  - service: switch.turn_off
    data: {}
    target:
      device_id: <UUID>
  - delay:
      hours: 0
      minutes: 0
      seconds: 30
      milliseconds: 0
  - service: switch.turn_on
    data: {}
    target:
      device_id: <UUID>
mode: single

configuration.yaml for monitoring the impact of nightly reboots

binary_sensor:
  - platform: ping
    host: !secret router_ip_address
    name: 'Ping - Router Connectivity'
    count: 5
    scan_interval: 30
  - platform: ping
    host: !secret opengarage_ip_address
    name: 'Ping - Local Connectivity'
    count: 5
    scan_interval: 30
  - platform: ping
    host: !secret modem_ip_address
    name: 'Ping - Modem Connectivity'
    count: 5
    scan_interval: 30
  - platform: ping
    host: 8.8.8.8
    name: 'Ping - Internet Connectivity'
    count: 5
    scan_interval: 30
nathang21 commented 1 year ago

Perhaps I was wrong, I am seeing a short almost 30 second window where the wired connection to the router is down, where as local connectivity to wireless devices within the mesh takes about 90 seconds to come back. image

When I originally discussed the issue (lack of gap in ping) I wasn't restarting the modem, but perhaps that was a fluke, as the modem should not impact the LAN downstream of the router at all.