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
[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.
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
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.
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.
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.
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!
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.
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.
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.
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.
+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?
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!