Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 112 additions & 0 deletions source/_components/sensor.airvisual.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
---
layout: page
title: "AirVisual"
description: "Instructions on how to use AirVisual data within Home Assistant"
date: 2017-09-06 12:15
sidebar: true
comments: false
sharing: true
footer: true
logo: airvisual.jpg
ha_category: Health
ha_release: 0.53
ha_iot_class: "Cloud Polling"
---

The `airvisual` sensor platform queries the [AirVisual](https://airvisual.com/) API for air quality
data on the nearest city to a latitude and longitude. The resulting information
creates sensors for the Air Quality Index (AQI), the human-friendly air quality
level, and the main pollutant of that area. Sensors that confirm to either/both
the [U.S. and Chinese air quality standards](http://www.clm.com/publication.cfm?ID=366) can be created.

This platform requires an AirVisual API key, which can be obtained [here](https://airvisual.com/api). Note
that the platform was designed using the "Community" package; the "Startup"
and "Enterprise" package keys should continue to function, but actual results
may vary (or not work at all).

<p class='note warning'>
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.
</p>

## {% linkable_title Configuring the Platform %}

To enable this platform, add the following lines to your `configuration.yaml`
file:

```yaml
sensor:
- platform: airvisual
api_key: abc123
monitored_conditions:
- us
- cn
latitude: 42.81212
longitude: 108.12422
radius: 500
```

Configuration variables:

- **api_key** (*Required*): your AirVisual API key
- **monitored_conditions** (*Required*): the air quality standard(s) to use
(`us` for U.S., `cn` for Chinese)
- **latitude** (*Optional*): the latitude to monitor; if excluded, the latitude
defined in `configuration.yaml` will be used
- **longitude** (*Optional*): the longitude to monitor; if excluded, the longitude
defined in `configuration.yaml` will be used
- **radius** (*Optional*): the radius (in meters) around the latitude/longitude to
search for the nearest city; defaults to `1000`

## {% linkable_title Sensor Types %}

When configured, the platform will create three sensors for each configured
air quality standard:

### Air Quality Index

**Description:** This sensor displays a numeric air quality index (AQI), a metric
for the overall "health" of the air.

**Example Sensor Name:** `sensor.chinese_air_quality_index`

**Example Sensor Value:** `32`

**Explanation:**

AQI | Status | Description
------- | :----------------: | ----------
0 - 50 | **Good** | Air quality is considered satisfactory, and air pollution poses little or no risk
51 - 100 | **Moderate** | Air quality is acceptable; however, for some pollutants there may be a moderate health concern for a very small number of people who are unusually sensitive to air pollution
101 - 150 | **Unhealthy for Sensitive Groups** | Members of sensitive groups may experience health effects. The general public is not likely to be affected
151 - 200 | **Unhealthy** | Everyone may begin to experience health effects; members of sensitive groups may experience more serious health effects
201 - 300 | **Very unhealthy** | Health warnings of emergency conditions. The entire population is more likely to be affected
301+ | **Hazardous** | Health alert: everyone may experience more serious health effects

### Air Polution Level

**Description:** This sensor displays the associated `Status` (from the above
table) for the current AQI.

**Sample Sensor Name:** `sensor.us_air_pollution_level`

**Example Sensor Value:** `Moderate`

### Main Pollutant

**Description:** This sensor displays the pollutant whose value is currently
highest.

**Sample Sensor Name:** `sensor.us_main_pollutant`

**Example Sensor Value:** `PM2.5`

**Explanation:**

Pollutant | Symbol | More Info
------- | :----------------: | ----------
Particulate (<= 2.5 μm) | PM2.5 | [EPA: Particulate Matter (PM) Pollution ](https://www.epa.gov/pm-pollution)
Particulate (<= 10 μm) | PM10 | [EPA: Particulate Matter (PM) Pollution ](https://www.epa.gov/pm-pollution)
Ozone | O | [EPA: Ozone Pollution](https://www.epa.gov/ozone-pollution)
Sulpher Dioxide | SO2 | [EPA: Sulfur Dioxide (SO2) Pollution](https://www.epa.gov/so2-pollution)
Carbon Monoxide | CO | [EPA: Carbon Monoxide (CO) Pollution in Outdoor Air](https://www.epa.gov/co-pollution)
84 changes: 84 additions & 0 deletions source/_components/switch.rainmachine.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
layout: page
title: "RainMachine Switch"
description: "Instructions on how to use RainMachine units with Home Assistant."
date: 2017-08-04 12:00
sidebar: true
comments: false
sharing: true
footer: true
logo: rainmachine.png
ha_category: Switch
ha_iot_class: "Cloud Polling"
ha_release: 0.51
---

The `rainmachine` switch platform allows you to control programs and zones within
a [RainMachine smart Wi-Fi sprinkler controller](http://www.rainmachine.com/).

## {% linkable_title Configuring the Platform %}

The platform allows for either local (i.e., directly across the LAN) or remote
(i.e., through RainMachine's cloud API) access; the route you choose will
dictate what your configuration should look like.

For local access, specify the IP address/hostname of your RainMachine unit
and your RainMachine password:

```yaml
switch:
platform: rainmachine
ip_address: 192.168.1.100
password: my_password_123
```

For remote access, specify your RainMachine username/email and password:

```yaml
switch:
platform: rainmachine
email: user@host.com
password: my_password_123
```

Configuration Variables:

- **ip_address** (*Optional*): The IP address of your RainMachine unit
- **email** (*Optional*): Your RainMachine username/email
- **password** (*Required*): Your RainMachine password
- **zone_run_time** (*Optional*): The number of seconds that a zone should run when
turned on; defaults to 600 (10 minutes)

## {% linkable_title Controlling Your Device %}

After Home Assistant loads, you will see new switches for every enabled program
and zone. These work as expected:

- Program On/Off: starts/stops a program
- Zone On/Off: starts/stops a zone (using the `zone_run_time` parameter to
determine how long to run for)

Programs and zones are linked. If a program is running its final zone, you will
see both the program and zone switches turned on; turning either one off will
turn the other one off (just like in the web app).

## {% linkable_title Weblink %}

If you would like to see and control more detailed information, create an [iFrame](/components/panel_iframe/) that renders the RainMachine web app:

```yaml
panel_iframe:
rainmachine:
title: RainMachine
url: "https://my.rainmachine.com/s/<YOUR_DEVICE_ID>/ui/"
icon: mdi:water-pump
```

You can find `<YOUR_DEVICE_ID>` by logging into [https://my.rainmachine.com](https://my.rainmachine.com ) and taking note of the URL.

## {% linkable_title For Awareness %}

The remote RainMachine API currently has two broken operations (i.e., they return
error codes): starting a program and stopping a program. Please note that
starting/stopping programs with the remote API is disabled until RainMachine
can fix the issue.
Binary file added source/images/supported_brands/airvisual.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/images/supported_brands/rainmachine.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.