Google Wifi configuration

I think you are over complicating this in your mind. Also, no the dash does not indicate the indent level, it indicates weather this item is a list item or not. Yaml can take any shape with dashes and indents.

So in XML, this is a typical object, we have 2 sensors in a sensors collection.

  <sensors>
    <sensor>
      <platform>google_wifi<\platform>
      <host>10.88.7.1<\host>
      <name>My first google wifi<\name>
    <\sensor>
    <sensor>
      <platform>google_wifi<\platform>
      <host>10.88.7.2<\host>
      <name>My second google wifi<\name>
    <\sensor>
  <\sensors>

in yaml, the sensors object is assumed based on weather you have the - or not. Itā€™s what makes it a collection. Also, the sensor is assumed, because it just is. So the only thing that is left is each node:

sensor: #this is the main section
  - platform: google_wifi
    host: 10.88.7.1
    name: My first google wifi
  - platform: google_wifi
    host: 10.88.7.2
    name: My second google wifi
2 Likes

[Heavy sigh] Beginning to understand but still very confusedā€¦

When I first added this:

sensor:
  - platform: google_wifi

to my config, I got an error message when checking the config. Something about more than one sensor. So I changed this:

sensor:
  - platform: yr

sensor:
  - platform: google_wifi

to this:

sensor:
  - platform: yr
  - platform: google_wifi

and although the error message went away, I got all those ā€œunavailableā€ icons for Google Wifi at the top of my Overview page.

Now that petro tells me to put it like this:

sensor:
  - platform: yr

sensor:
  - platform: google_wifi

Iā€™ve stopped getting the error message about more than one sensor - and all the ā€œunavailableā€ Google Wifi icons have disappeared ā€“ but they havenā€™t been replaced by working icons. Thereā€™s just no Google Wifi icons.

yes, you should only have 1 sensor section.

is correct.

But that doesnā€™t work!
My configuration.yaml:

homeassistant:
  # Name of the location where Home Assistant is running
  name: TikiShack
  # Location required to calculate the time the sun rises and sets
  latitude: 31.######
  longitude: -110.######
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: ####
  # metric for Metric, imperial for Imperial
  unit_system: imperial
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: America/Phoenix
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:
  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url: example.duckdns.org:8123

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

# Allows you to issue voice commands from the frontend in enabled browsers
conversation:

# Enables support for tracking state changes over time
history:

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

sensor:
# Weather prediction
  - platform: yr
  - platform: google_wifi      
#SPEEDTEST	
  - platform: speedtest
  minute: 30
  hour:
    - 0
    - 2
    - 4
    - 6
    - 8
    - 10
    - 12
    - 14
    - 16
    - 18
    - 20
    - 22
  monitored_conditions:
#    - ping
    - download
    - upload   

# Text to speech
tts:
  - platform: google

# Cloud
cloud:

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

ifttt:
  key: zxzxzxzxzxzxzxzxzxzxzxzxz

Gives me this:

Your error is actually the lines below that. Your entire block for speedtest is wrong with the indention one level too far out.

remove the entire speedtest section for a test (just comment it out)

Personally I recommend you use a better text editor like Atom or Visual Studio Code.

1 Like

I finally got it working-

Hereā€™s what it took to make it work:

sensor:
# Weather prediction
#  - platform: yr
  platform: google_wifi
  host: 10.88.7.1  
#SPEEDTEST	
#  - platform: speedtest
#  minute: 30
#  hour:
#    - 0
#    - 2
#    - 4
#    - 6
#    - 8
#    - 10
#    - 12
#    - 14
#    - 16
#    - 18
#    - 20
#    - 22
#  monitored_conditions:
#    - ping
#    - download
#    - upload   

If I include the dash in front of ā€˜platform: google_wifiā€™ OR include any other sensors ā€“ check config fails.
If I do not include the host: IP line, all the icons say ā€œunavailableā€.

That conflicts with much of the info Iā€™ve received in this topic.

put the dash in front of it, with the host line even with the p in platform, then uncomment your - platform: yr and try.

Your speedtest sensor is failing because it is formatted incorrectly. minute:, hour:, and monitored_conditions need to be even with the p in platform.

1 Like

I, too, had trouble getting used to YAML when I started. Seems to be a very common experience. But once it ā€œclicksā€, youā€™ll wonder what all the fuss was about. :slight_smile:

Do you understand JSON or Python? If so, then you may find this useful: http://yaml-online-parser.appspot.com/. I did. It helped YAML ā€œclickā€ for me.

1 Like

THANK YOU!!! Not only did that work but it made everything make a LOT more sense to me! I have now added other sensors and theyā€™re working well - all of them!

1 Like

Hi. Can you please explain the Internet: (group?) and how you made that panel? Thank you.

Since Lovelace is the default UI, I wouldnā€™t worry about putting it in groups.

entities:
  - entity: sensor.google_wifi_status
  - entity: sensor.google_wifi_uptime
  - entity: sensor.google_wifi_last_restart
  - entity: sensor.cpu_speed
  - entity: sensor.speedtest_download
  - entity: sensor.speedtest_upload
  - entity: sensor.speedtest_ping
  - entity: sensor.memory_free
  - entity: sensor.memory_use
  - entity: sensor.last_boot
  - entity: sensor.pi_hole_ads_blocked_today
  - entity: sensor.pi_hole_dns_unique_clients
  - entity: sensor.pi_hole_dns_queries_today
show_header_toggle: false
title: Computer Stuff
type: entities

Okay, I think I got it backwards. This is what I did:

title: Internet Monitor
type: entities  
show_header_toggle: false
entities:
  - entity: sensor.speedtest_download
  - entity: sensor.speedtest_upload
  - entity: sensor.speedtest_ping 
  - entity: script.update_speedtest
    name: Update Speed Test
    icon: 'mdi:clock-fast`

This gets me the right data from the sensors (upload/download/ping), and a line with an EXECUTE button. However, when I press EXECUTE nothing happens (No state history found.) If I look at the logbook I see: update_speedtest started but it hasnā€™t been executed.

This is the script in my configuration.yaml:

speedtestdotnet:
  scan_interval:
    days: 2  
  monitored_conditions:
    - ping
    - download
    - upload

This is the script in my scripts.yaml:

update_speedtest:
  sequence:
    - service: speedtestdotnet.speedtest

Any idea what Iā€™m doing wrong? Also, if anyone has an idea how to add another entity that displays the last time the script was executed Iā€™d be pretty excited. Eg: ā€œLast Speed Test 3.03 hours ago.ā€

Sorry if I posted this wrong. Itā€™s my first one. Thank you.

This below script seems to be working for me. Scripts have a last_triggered attribute that you could pull using a data template {% set x = state_attr("script.update_speed" , "last_triggered") %} you will have to strip it using somethin like {% set test = x.strftime("%I:%M:%S") %} its in UTC so you will have to either covert it or just deal with the UTC time stamp.

'update_speed':
  alias: update_speed
  sequence:
  - data: {}
    service: speedtestdotn

My config.yaml
speedtestdotnet:

Ok. Iā€™ll give this a shot later when I get home. Thank you for helping! :slight_smile:

No problem :blush:

Anyone know if additional functionality is planning on being added to the google_wifi integration?

I know that IFTTT has triggers based on specific device(s) CONNECT or DISCONNECT from the network.

image
Currently Iā€™m having to use IFTTT integration to call scripts to leverage these events/triggers - but would much prefer to remove IFTTT and have these occurs only / natively in HA.

Guessing the Google Wifi API allows addā€™l data - but unsure how IFTTT is getting this information.

Thanks in advance!

4 Likes

This would be awesome

+1 for @Markus99ā€™s question here. Any traction on this? I imagine if IFTTT can get this data, so could anyone else. Is this on the roadmap? Or, do I need to start digging? :smiley:

I have not tried it, but maybe one can get more information using this API or this one. I am trying to make something which works on python, but it is not easy, since I need to use grpc for the request and I have no idea how it works!

Can some one who was able to figure out the Google Wifi configuration please paste their piece from config.yaml please?