mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-27 19:26:50 +00:00
Update example configuration to standards (#6828)
Remove optional items from the "add this to `configuration.yaml`" configuration. Add example configuration with longitude and latitude. (Taken from old configuration example.) Add example configuration with city, state, and country. (Taken from old configuration example.)
This commit is contained in:
parent
3e090fad45
commit
7c19d1a679
@ -21,26 +21,14 @@ This platform requires an AirVisual API key, which can be obtained [here](https:
|
|||||||
The "Community" API key is limited to 10,000 calls per month. In order to leave a buffer, the `airvisual` platform queries the API every 10 minutes by default. Modification of this (via the `scan_interval` key) to a too-low value may result in your API key being deactivated.
|
The "Community" API key is limited to 10,000 calls per month. In order to leave a buffer, the `airvisual` platform queries the API every 10 minutes by default. Modification of this (via the `scan_interval` key) to a too-low value may result in your API key being deactivated.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
## {% linkable_title Configuration via Latitude/Longitude %}
|
## {% linkable_title Configuration %}
|
||||||
|
|
||||||
To enable the platform and gather data via latitude/longitude, add the following lines to your `configuration.yaml` file:
|
To enable the platform and gather data via latitude/longitude, add the following lines to your `configuration.yaml` file:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
sensor:
|
sensor:
|
||||||
- platform: airvisual
|
- platform: airvisual
|
||||||
api_key: abc123
|
api_key: YOUR_AIRVISUAL_API_KEY
|
||||||
monitored_conditions:
|
|
||||||
- us
|
|
||||||
- cn
|
|
||||||
show_on_map: false
|
|
||||||
scan_interval: 30
|
|
||||||
# Configure by latitude/longitude:
|
|
||||||
latitude: 42.81212
|
|
||||||
longitude: 108.12422
|
|
||||||
# Or configure by location:
|
|
||||||
city: Los Angeles
|
|
||||||
state: California
|
|
||||||
country: USA
|
|
||||||
```
|
```
|
||||||
|
|
||||||
{% configuration %}
|
{% configuration %}
|
||||||
@ -87,6 +75,37 @@ country:
|
|||||||
type: string
|
type: string
|
||||||
{% endconfiguration %}
|
{% endconfiguration %}
|
||||||
|
|
||||||
|
## {% linkable_title Example Configurations %}
|
||||||
|
|
||||||
|
Configuration using custom Latitude and Longitude:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
sensor:
|
||||||
|
- platform: airvisual
|
||||||
|
api_key: YOUR_AIRVISUAL_API_KEY
|
||||||
|
monitored_conditions:
|
||||||
|
- cn
|
||||||
|
show_on_map: false
|
||||||
|
scan_interval: 30
|
||||||
|
latitude: 42.81212
|
||||||
|
longitude: 108.12422
|
||||||
|
```
|
||||||
|
|
||||||
|
Configuration using city, state, and country:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
sensor:
|
||||||
|
- platform: airvisual
|
||||||
|
api_key: YOUR_AIRVISUAL_API_KEY
|
||||||
|
monitored_conditions:
|
||||||
|
- us
|
||||||
|
show_on_map: false
|
||||||
|
scan_interval: 30
|
||||||
|
city: Los Angeles
|
||||||
|
state: California
|
||||||
|
country: USA
|
||||||
|
```
|
||||||
|
|
||||||
## {% linkable_title Determining the City/State/Country %}
|
## {% linkable_title Determining the City/State/Country %}
|
||||||
|
|
||||||
To easily determine the proper values for a particular location, use the [AirVisual region directory](https://airvisual.com/world). Once you browse to the particular city you want, take note of the breadcrumb title, which is of the form `country > state/region > city`. Use this information to fill out `configuration.yaml`.
|
To easily determine the proper values for a particular location, use the [AirVisual region directory](https://airvisual.com/world). Once you browse to the particular city you want, take note of the breadcrumb title, which is of the form `country > state/region > city`. Use this information to fill out `configuration.yaml`.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user