Merge pull request #466 from kellerza/patch-3
Generic platform discovery intro
@ -8,21 +8,16 @@ comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
ha_category: Camera
|
||||
logo: camcorder.png
|
||||
ha_release: pre 0.7
|
||||
---
|
||||
|
||||
|
||||
This component allows you to integrate any IP camera into Home Assistant. It supports fetching images from a url with optional HTTP authentication.
|
||||
The `generic` camera platform allows you to integrate any IP camera into Home Assistant. It supports fetching images from a url with optional HTTP authentication.
|
||||
|
||||
Home Assistant will serve the images via its server, making it possible to view your IP camera's while outside of your network.
|
||||
Home Assistant will serve the images via its server, making it possible to view your IP camera's while outside of your network. The endpoint is `/api/camera_proxy/camera.[name]?time=[timestamp]`.
|
||||
|
||||
As part of the basic support the following features will be provided:
|
||||
|
||||
- MJPEG video streaming
|
||||
- Saving a snapshot
|
||||
- Recording(JPEG frame capture)
|
||||
|
||||
To enable this sensor in your installation, add the following to your `configuration.yaml` file:
|
||||
To enable this camery in your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
|
@ -7,13 +7,17 @@ sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo: camcorder.png
|
||||
ha_category: Camera
|
||||
ha_release: pre 0.7
|
||||
---
|
||||
|
||||
|
||||
The `mjpeg` component allows you to integrate IP cameras which are capable to stream their video with MJPEG into Home Assistant.
|
||||
The `mjpeg` camera platform allows you to integrate IP cameras which are capable to stream their video with MJPEG into Home Assistant.
|
||||
|
||||
To enable this sensor in your installation, add the following to your `configuration.yaml` file:
|
||||
Home Assistant will serve the images via its server, making it possible to view your IP camera's while outside of your network. The endpoint is `/api/camera_proxy/camera.[name]?time=[timestamp]`.
|
||||
|
||||
To enable this camera in your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
|
@ -16,7 +16,7 @@ ha_release: 0.18
|
||||
This tracker discovers new devices on boot and tracks bluetooth devices periodically based on interval_seconds value. Devices discovered are stored with 'bt_' as the prefix for device mac in `known_devices.yaml`.
|
||||
|
||||
<p class='note'>
|
||||
Requires PyBluez
|
||||
Requires PyBluez. If you are on raspbian, make sure you first install `bluetooth` and `libbluetooth-dev` by running `sudo apt install bluetooth libbluetooth-dev`
|
||||
</p>
|
||||
|
||||
To use the Bluetooth tracker in your installation, add the following to your `configuration.yaml` file:
|
||||
|
@ -40,3 +40,7 @@ This may cause battery drainage as it wakes up your device to get the current lo
|
||||
You may receive an email from Apple stating that someone has logged into your account.
|
||||
</p>
|
||||
|
||||
<p class='note warning'>
|
||||
If you have two-factor authentication enabled on your iCloud account you will not be able to use this presence detection in HA, even with an app-specific password.
|
||||
</p>
|
||||
|
||||
|
@ -21,6 +21,9 @@ http:
|
||||
development: 1
|
||||
ssl_certificate: /etc/letsencrypt/live/hass.example.com/fullchain.pem
|
||||
ssl_key: /etc/letsencrypt/live/hass.example.com/privkey.pem
|
||||
cors_allowed_origins:
|
||||
- google.com
|
||||
- home-assistant.io
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
@ -30,6 +33,8 @@ Configuration variables:
|
||||
- **development** (*Optional*): Disable caching and load unvulcanized assets. Useful for Frontend development.
|
||||
- **ssl_certificate** (*Optional*): Path to your TLS/SSL certificate to serve Home Assistant over a secure connection.
|
||||
- **ssl_key** (*Optional*): Path to your TLS/SSL key to serve Home Assistant over a secure connection.
|
||||
- **cors_allowed_origins** (*Optional*): A list of origin domain names to allow [CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) requests from. Enabling this will set the `Access-Control-Allow-Origin` header to the Origin header if it is found in the list, and the `Access-Control-Allow-Headers` to `Origin, Accept, X-Requested-With, Content-type, X-HA-access`.
|
||||
|
||||
|
||||
The [Set up encryption using Let's Encrypt](/blog/2015/12/13/setup-encryption-using-lets-encrypt/) blog post gives you details about the encryption of your traffic using free certificates from [Let's Encrypt](https://letsencrypt.org/).
|
||||
|
||||
|
@ -12,10 +12,11 @@ ha_release: 0.19
|
||||
|
||||
The `hvac` component is built for the controlling and monitoring of HVAC (heating, ventilating, and air conditioning) devices.
|
||||
|
||||
To enable this component, add the following lines to your `configuration.yaml`:
|
||||
To enable this component, pick one of the platforms and add it to your `configuration.yaml`:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
hvac:
|
||||
platform: demo
|
||||
```
|
||||
|
||||
|
@ -7,7 +7,9 @@ sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo: keyboard.png
|
||||
ha_category: Automation
|
||||
ha_release: pre 0.7
|
||||
---
|
||||
|
||||
|
||||
|
@ -7,7 +7,9 @@ sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo: file.png
|
||||
ha_category: Notifications
|
||||
ha_release: pre 0.7
|
||||
---
|
||||
|
||||
|
||||
|
@ -8,6 +8,7 @@ comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
ha_category: Sensor
|
||||
logo: db.png
|
||||
ha_iot_class: "Local Polling"
|
||||
---
|
||||
|
||||
|
@ -9,6 +9,7 @@ sharing: true
|
||||
footer: true
|
||||
ha_category: DIY
|
||||
ha_release: 0.7
|
||||
logo: dht.png
|
||||
---
|
||||
|
||||
|
||||
|
@ -2,18 +2,68 @@
|
||||
layout: page
|
||||
title: "Fitbit"
|
||||
description: "Instructions how to integrate Fitbit devices within Home Assistant."
|
||||
date: 2015-07-11 0:15
|
||||
date: 2016-05-09 15:01
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo:
|
||||
logo: fitbit.png
|
||||
ha_category: Sensor
|
||||
ha_iot_class: "Cloud Polling"
|
||||
ha_release: 0.19
|
||||
---
|
||||
|
||||
The Fitbit sensor allows you to expose data from [Fitbit](http://fitbit.com) to Home Assistant.
|
||||
|
||||
Enable the sensor by adding the following to your configuration:
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
platform: fitbit
|
||||
monitored_resources:
|
||||
- "body/weight"
|
||||
```
|
||||
|
||||
Restart Home Assistant once this is complete. Go to the frontend. You will see a new entry for configuring Fitbit. Follow the instructions there to complete the setup process.
|
||||
|
||||
Please be aware that Fitbit has very low rate limits, 150 per user per hour. The clock resets at the _top_ of the hour (meaning it is not a rolling 60 minutes). There is no way around the limits. Due to the rate limits, the sensor only updates every 30 minutes. You can manually trigger an update by restarting Home Assistant. Keep in mind that 1 request is used for every entry in `monitored_resources`.
|
||||
|
||||
The unit system that the sensor will use is based on the country you set in your Fitbit profile.
|
||||
|
||||
Below is the list of resources that you can add to `monitored_resources`. One sensor is exposed for every resource.
|
||||
|
||||
```text
|
||||
activities/activityCalories
|
||||
activities/calories
|
||||
activities/caloriesBMR
|
||||
activities/distance
|
||||
activities/elevation
|
||||
activities/floors
|
||||
activities/heart
|
||||
activities/minutesFairlyActive
|
||||
activities/minutesLightlyActive
|
||||
activities/minutesSedentary
|
||||
activities/minutesVeryActive
|
||||
activities/steps
|
||||
activities/tracker/activityCalories
|
||||
activities/tracker/calories
|
||||
activities/tracker/distance
|
||||
activities/tracker/elevation
|
||||
activities/tracker/floors
|
||||
activities/tracker/minutesFairlyActive
|
||||
activities/tracker/minutesLightlyActive
|
||||
activities/tracker/minutesSedentary
|
||||
activities/tracker/minutesVeryActive
|
||||
activities/tracker/steps
|
||||
body/bmi
|
||||
body/fat
|
||||
body/weight
|
||||
sleep/awakeningsCount
|
||||
sleep/efficiency
|
||||
sleep/minutesAfterWakeup
|
||||
sleep/minutesAsleep
|
||||
sleep/minutesAwake
|
||||
sleep/minutesToFallAsleep
|
||||
sleep/startTime
|
||||
sleep/timeInBed
|
||||
```
|
||||
|
@ -7,7 +7,7 @@ sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo: 'gtfs.png'
|
||||
logo: train.png
|
||||
ha_category: Sensor
|
||||
ha_iot_class: "Local Polling"
|
||||
ha_release: 0.17
|
||||
|
@ -12,14 +12,14 @@ ha_iot_class: "Local Polling"
|
||||
ha_release: 0.17
|
||||
---
|
||||
|
||||
The `NZBGet` platform will allow you to monitor your downloads with [NZBGet](http://NZBGet.net) from within Home Assistant and setup automation based on the information.
|
||||
The `nzbget` platform will allow you to monitor your downloads with [NZBGet](http://NZBGet.net) from within Home Assistant and setup automation based on the information.
|
||||
|
||||
To use NZBGet with your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
sensor:
|
||||
- platform: nzbget
|
||||
platform: nzbget
|
||||
base_url: http://192.168.1.18:6789
|
||||
username: apiuser
|
||||
password: apipass
|
||||
@ -31,3 +31,10 @@ sensor:
|
||||
- PostPaused
|
||||
- RemainingSizeMB
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **base_url** (*Required*): The URL to your NZBGet installation.
|
||||
- **username** (*Optional*): The username to access your NZBGet installation.
|
||||
- **password** (*Optional*): The password to access your NZBGet installation.
|
||||
- **monitored_variables** (*Required*): Array of monitored details.
|
||||
|
@ -7,6 +7,7 @@ sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo: train.png
|
||||
ha_category: Sensor
|
||||
ha_iot_class: "Local Polling"
|
||||
ha_release: pre 0.7
|
||||
|
@ -19,6 +19,7 @@ The `dlink` switch platform allows you to control the state of your [D-Link Wi-F
|
||||
Supported devices (tested):
|
||||
|
||||
- DSP-W215
|
||||
- DSP-W110
|
||||
|
||||
To use your D-Link smart plugs in your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
@ -37,5 +38,5 @@ Configuration variables:
|
||||
- **host** (*Required*): The IP address of your D-Link plug, eg. http://192.168.1.32
|
||||
- **name** (*Optional*): The name to use when displaying this switch.
|
||||
- **username** (*Required*): The username for your plug. Defaults to `admin`.
|
||||
- **password** (*Required*): The password for your plug.
|
||||
- **password** (*Required*): The password for your plug. Default password is the `PIN` inlcuded on the configuration card.
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Raspberry PI GPIO Switch"
|
||||
description: "Instructions how to integrate the GPIO of a Raspberry PI into Home Assistant as a switch."
|
||||
date: 2016-05-07 09:00
|
||||
title: "Raspberry Pi RF Switch"
|
||||
description: "Instructions how to integrate devices controlled via codes sent with low-cost GPIO RF modules on a Raspberry Pi into Home Assistant as a switch."
|
||||
date: 2016-05-10 09:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
@ -15,7 +15,10 @@ ha_release: 0.19
|
||||
|
||||
The `rpi_rf` switch platform allows you to control devices over 433/315MHz LPD/SRD signals with generic low-cost GPIO RF modules on a [Raspberry Pi](https://www.raspberrypi.org/).
|
||||
|
||||
To use your Raspberry Pi with a 433MHz adaptor in your installation, add the following to your `configuration.yaml` file:
|
||||
Interoperable with codes sniffed via [the rpi-rf module](https://pypi.python.org/pypi/rpi-rf) or [rc-switch](https://github.com/sui77/rc-switch).
|
||||
For more info see the PyPi module description: [rpi-rf](https://pypi.python.org/pypi/rpi-rf).
|
||||
|
||||
To enable, add the following to your `configuration.yaml`:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
@ -30,14 +33,19 @@ switch:
|
||||
pulselength: 200
|
||||
code_on: 987654
|
||||
code_off: 133742
|
||||
living_room_light:
|
||||
protocol: 5
|
||||
code_on: 654321
|
||||
code_off: 654320
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **gpio** array (*Required*): Array of used ports.
|
||||
- **switches:** (*Required*): Array of switches.
|
||||
- **[name]** (*Requireld*): If true, inverts the output logic to ACTIVE LOW. Default is false (ACTIVE HIGH).
|
||||
- **code_on** (*Requireld*): Code to switch the device on, eg. `987654`.
|
||||
- **code_off** (*Requireld*): Code to switch the device off, eg. `133742`.
|
||||
- **pulselength** (*Optional*): Length of the pulse
|
||||
- **gpio** (*Required*): GPIO to which the data line of the TX module is connected.
|
||||
- **switches:** (*Required*): The array that contains all switches.
|
||||
- **[entry]** (*Required*): Name of the switch. Multiple entries are possible.
|
||||
- **code_on** (*Required*): Decimal code to switch the device on.
|
||||
- **code_off** (*Required*): Decimal code to switch the device off.
|
||||
- **protocol** (*Optional*): RF Protocol (Default is `1`).
|
||||
- **pulselength** (*Optional*): Pulselength (Default is the protocol default).
|
||||
|
||||
|
@ -7,7 +7,7 @@ date_formatted: "May 6, 2016"
|
||||
author: Paulus Schoutsen
|
||||
author_twitter: balloob
|
||||
comments: true
|
||||
categories: Talks
|
||||
categories: Talks Video
|
||||
og_image: /images/blog/2016-05-openiot/preview-video.png
|
||||
---
|
||||
|
||||
|
@ -7,8 +7,7 @@ date_formatted: "May 7, 2016"
|
||||
author: Paulus Schoutsen
|
||||
author_twitter: balloob
|
||||
comments: true
|
||||
categories: Talks
|
||||
og_image: /images/blog/2016-05-openiot/preview-video.png
|
||||
categories: Release-Notes
|
||||
---
|
||||
|
||||
This release is big. Until now, our automations and scripts have been very static. Starting today it should all be a bit more dynamic.
|
||||
@ -43,8 +42,6 @@ light:
|
||||
entity_namespace: holiday_home
|
||||
```
|
||||
|
||||
<img src='/images/supported_brands/bluetooth.png' style='clear: right; margin-left: 5px; border:none; box-shadow: none; float: right; margin-bottom: 16px;' width='150' />
|
||||
|
||||
- Automation: allow [script syntax] for action ([@balloob])
|
||||
- Automation: expose [`trigger` variable][trigger-variable] to script templates ([@balloob])
|
||||
- Script: allow passing variables for script templates in the [script service calls] ([@balloob])
|
||||
@ -65,7 +62,7 @@ light:
|
||||
- Switch: [Acer Projectors] now supported ([@deisi])
|
||||
- New [HVAC component] added with Z-Wave support ([@turbokongen])
|
||||
- Support added for [OctoPrint] ([@w1ll1am23])
|
||||
- Configuration.yaml can now refer to environment variables using `!envvar` ([@bah2830])
|
||||
- Configuration.yaml can now refer to environment variables using `!env_var` ([@bah2830])
|
||||
- Lock: [Z-Wave][lock.zwave] now supported ([@devdelay])
|
||||
- New [Dweet component] to export data ([@fabaff])
|
||||
- Media Player now supports stop command + initial kodi support ([@hmronline])
|
||||
|
@ -0,0 +1,20 @@
|
||||
---
|
||||
layout: post
|
||||
title: "Video: How To Configure Home Assistant"
|
||||
description: "BRUH Automation has made an excellent video to get started with configuring Home Assistant."
|
||||
date: 2016-05-12 00:09:00 +0000
|
||||
date_formatted: "May 12, 2016"
|
||||
author: Paulus Schoutsen
|
||||
author_twitter: balloob
|
||||
comments: true
|
||||
categories: Video
|
||||
og_image: /images/blog/2016-05-video-configuring-home-assistant/preview-video.png
|
||||
---
|
||||
|
||||
Ben from [BRUH Automation](http://www.bruhautomation.com) authors a lot of great video's about how he is using Home Assistant and how you can get started with it too. The video below will walk you through how to configure Home Assistant. Enjoy!
|
||||
|
||||
Make sure to subscribe to [his YouTube channel](https://www.youtube.com/channel/UCLecVrux63S6aYiErxdiy4w) for more Home Assistant video's.
|
||||
|
||||
<div class='videoWrapper'>
|
||||
<iframe width="560" height="315" src="https://www.youtube.com/embed/hFDVB2H6TNo" frameborder="0" allowfullscreen></iframe>
|
||||
</div>
|
@ -96,6 +96,7 @@ This page contains a list of people who have contributed in one way or another t
|
||||
- [Lukas Hetzenecker](https://github.com/lukas-hetzenecker)
|
||||
- [Magnus Knutas](https://github.com/MagnusKnutas)
|
||||
- [MakeMeASandwich](https://github.com/MakeMeASandwich)
|
||||
- [Malte Deiseroth](https://github.com/deisi)
|
||||
- [Manoj](https://github.com/vmulpuru)
|
||||
- [Markus Peter](https://github.com/bimbar)
|
||||
- [Markus Stenberg](https://github.com/fingon)
|
||||
|
83
source/developers/generic_discovery.markdown
Normal file
@ -0,0 +1,83 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Generic Platform Discovery"
|
||||
description: "Using generic platform discovery."
|
||||
date: 2016-05-12 22:00 -02:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
---
|
||||
|
||||
New controller or hub components often need to add platforms in sub-components (i.e. Lights & Switches) without additional configuration.
|
||||
This can be achieved using the `homeassistant.components.discovery.load_platform` method:
|
||||
|
||||
```python
|
||||
def load_platform(hass, component, platform, info=None, hass_config=None)
|
||||
```
|
||||
|
||||
From more info on how this works, refer to the [load_platform](https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/discovery.py#L78) method.
|
||||
|
||||
### {% linkable_title Example %}
|
||||
|
||||
Say you need to implement your new MyFlashyHub that controls both Switches & Lights, you can follow these steps:
|
||||
|
||||
Configuration required for your new hub component:
|
||||
|
||||
```yaml
|
||||
myflashyhub:
|
||||
example: setting
|
||||
```
|
||||
|
||||
The source for your component can be located in your configuration directory for now:
|
||||
|
||||
```bash
|
||||
~/.homeassistant/custom_components/myflashyhub.py
|
||||
~/.homeassistant/custom_components/light/myflashyhub.py
|
||||
~/.homeassistant/custom_components/switch/myflashyhub.py
|
||||
```
|
||||
|
||||
In the hub component `myflashyhub.py` you can call your light and switch components. To pass any non-serializable information to the platforms in the sub-component, you can use a global variable.
|
||||
|
||||
```python
|
||||
from homeassistant.components.discovery import load_platform
|
||||
DOMAIN = 'myflashyhub'
|
||||
|
||||
MFH_GLOBAL = None
|
||||
|
||||
def setup(hass, config):
|
||||
"""Your controller/hub specific code."""
|
||||
|
||||
global MFH_GLOBAL
|
||||
if MFH_GLOBAL is None:
|
||||
MFH_GLOBAL = SomeObjectToInitialiseGlobal
|
||||
#--- snip ---
|
||||
load_platform(hass, 'light', DOMAIN)
|
||||
load_platform(hass, 'switch', DOMAIN, {'optional': 'arguments'})
|
||||
```
|
||||
|
||||
Add your custom device specific code to the `setup_platform` method in `light/myflashyhub.py` and `switch/myflashyhub`.
|
||||
|
||||
```python
|
||||
import homeassistant.components.myflashyhub as myflashyhub
|
||||
|
||||
# 'switch' will receive discovery_info={'optional': 'arguments'}
|
||||
# as passed in above. 'light' will receive discovery_info=None
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Your switch/light specific code."""
|
||||
# You can now use myflashyhub.MFH_GLOBAL
|
||||
```
|
||||
|
||||
|
||||
The `load_platform` method allows the platforms to be loaded with the need for any additional platform entries in your `configuration.yaml` file, which normally would have been:
|
||||
|
||||
```yaml
|
||||
#light:
|
||||
# platform: myflashyhub
|
||||
#switch:
|
||||
# platform: myflashyhub
|
||||
```
|
||||
|
||||
<p class='note '>
|
||||
In the past, this was achieved by adding your component to the `DISCOVERY_PLATFORMS` in the target sub-component. Generic discovery through `load_platform()` allows you to load any sub-component, including custom components, without changing the sub-component.
|
||||
</p>
|
@ -15,7 +15,7 @@ This example is for adding support for the imaginary Awesome Lights. It shows th
|
||||
import logging
|
||||
|
||||
# Import the device class from the component that you want to support
|
||||
from homeassistant.components.light import Light
|
||||
from homeassistant.components.light import ATTR_BRIGHTNESS, Light
|
||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
||||
|
||||
# Home Assistant depends on 3rd party packages for API specific code.
|
||||
@ -24,7 +24,7 @@ REQUIREMENTS = ['awesome_lights==1.2.3']
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Initialize Awesome Light platform."""
|
||||
import awesomelights
|
||||
|
||||
@ -56,22 +56,42 @@ class AwesomeLight(Light):
|
||||
"""Initialize an AwesomeLight."""
|
||||
self._light = light
|
||||
|
||||
def update(self):
|
||||
"""Fetch new state data for this light.
|
||||
|
||||
This is the only method that should fetch new data for Home Assitant.
|
||||
"""
|
||||
self._light.update()
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the display name of this light"""
|
||||
return self._light.name
|
||||
|
||||
@property
|
||||
def brightness(self):
|
||||
"""Brightness of the light.
|
||||
"""Brightness of the light (an integer in the range 1-255).
|
||||
|
||||
This method is optional. Removing it indicates to Home Assistant
|
||||
that brightness is not supported for this light.
|
||||
"""
|
||||
return self._light.brightness
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
"""If light is on."""
|
||||
return self._light.is_on()
|
||||
|
||||
def turn_on(self, **kwargs):
|
||||
"""Instruct the light to turn on.
|
||||
|
||||
You can skip the brightness part if your light does not support
|
||||
brightness control.
|
||||
"""
|
||||
self._light.brightness = kwargs.get(ATTR_BRIGHTNESS, 255)
|
||||
self._light.turn_on()
|
||||
|
||||
def turn_off(self, **kwargs):
|
||||
"""Instruct the light to turn off."""
|
||||
self._light.turn_off()
|
||||
|
||||
def update(self):
|
||||
"""Fetch new state data for this light.
|
||||
|
||||
This is the only method that should fetch new data for Home Assitant.
|
||||
"""
|
||||
self._light.update()
|
||||
```
|
||||
|
@ -13,7 +13,7 @@ This is a minimum implementation of a platform for the sensor component.
|
||||
|
||||
### {% linkable_title Installation %}
|
||||
|
||||
Copy the code below and create it as a file in `<config_dir>/sensor/example.py`.
|
||||
Copy the code below and create it as a file in `<config_dir>/custom_components/sensor/example.py`.
|
||||
|
||||
Add the following to your configuration.yaml:
|
||||
|
||||
|
@ -99,6 +99,24 @@ Sample `curl` command:
|
||||
$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/config
|
||||
```
|
||||
|
||||
#### {% linkable_title GET /api/discovery_info %}
|
||||
Returns basic information about the Home Assistant instance as JSON.
|
||||
|
||||
```json
|
||||
{
|
||||
"base_url": "http://127.0.0.1:8123",
|
||||
"location_name": "Home",
|
||||
"requires_api_password": true,
|
||||
"version": "0.20.0.dev0"
|
||||
}
|
||||
```
|
||||
|
||||
Sample `curl` command:
|
||||
|
||||
```bash
|
||||
$ curl -X GET -H "x-ha-access: YOUR_PASSWORD" http://localhost:8123/api/discovery_info
|
||||
```
|
||||
|
||||
#### {% linkable_title GET /api/bootstrap %}
|
||||
Returns all data needed to bootstrap Home Assistant.
|
||||
|
||||
@ -273,23 +291,14 @@ $ curl -X GET -H "x-ha-access: YOUR_PASSWORD" \
|
||||
http://localhost:8123/api/error_log
|
||||
```
|
||||
|
||||
#### {% linkable_title GET /api/discovery_info %}
|
||||
Retrieve about the discovery feature.
|
||||
|
||||
```json
|
||||
{
|
||||
"base_url": "http://192.168.1.2:8123",
|
||||
"location_name": "My home",
|
||||
"requires_api_password": true,
|
||||
"version": "0.19.0"
|
||||
}
|
||||
```
|
||||
#### {% linkable_title GET /api/camera_proxy/camera.<entity_id> %}
|
||||
Returns the data (image) from the specified camera entity_id.
|
||||
|
||||
Sample `curl` command:
|
||||
|
||||
```bash
|
||||
$ curl -X GET -H "x-ha-access: mypass" \
|
||||
http://localhost:8123/api/discovery_info
|
||||
$ curl -X GET -H "x-ha-access: YOUR_PASSWORD"\
|
||||
http://localhost:8123/api/camera_proxy/camera.my_sample_camera?time=1462653861261 -o image.jpg
|
||||
```
|
||||
|
||||
#### {% linkable_title POST /api/states/<entity_id> %}
|
||||
|
@ -35,7 +35,7 @@ automation:
|
||||
event: sunset
|
||||
offset: "-01:00:00"
|
||||
condition:
|
||||
platform: state
|
||||
condition: state
|
||||
entity_id: group.all_devices
|
||||
state: home
|
||||
action:
|
||||
@ -64,7 +64,7 @@ automation:
|
||||
event: sunset
|
||||
offset: "-01:00:00"
|
||||
condition:
|
||||
platform: state
|
||||
condition: state
|
||||
entity_id: group.all_devices
|
||||
state: home
|
||||
action:
|
||||
@ -91,7 +91,7 @@ automation:
|
||||
event: sunset
|
||||
offset: "-01:00:00"
|
||||
condition:
|
||||
platform: state
|
||||
condition: state
|
||||
entity_id: group.all_devices
|
||||
state: home
|
||||
action:
|
||||
|
@ -17,6 +17,7 @@ There are various ways to get in touch with the Home Assistant community. It doe
|
||||
- [Gitter Chatroom](https://gitter.im/home-assistant/home-assistant) for general Home Assistant discussions and questions.
|
||||
- Follow us on [Twitter](https://twitter.com/home_assistant), use @home_assistant
|
||||
- Join the [Google+ community](https://plus.google.com/u/0/b/110560654828510104551/communities/106562234893511202708)
|
||||
- Join the [Reddit subreddit](https://reddit.com/r/homeassistant) in [/r/homeassistant](https://reddit.com/r/homeassistant)
|
||||
|
||||
### {% linkable_title Bugs, Feature requests, and alike %}
|
||||
|
||||
|
After Width: | Height: | Size: 154 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.7 KiB |
BIN
source/images/supported_brands/camcorder.png
Normal file
After Width: | Height: | Size: 287 B |
Before Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 2.8 KiB |
BIN
source/images/supported_brands/file.png
Normal file
After Width: | Height: | Size: 310 B |
BIN
source/images/supported_brands/fitbit.png
Normal file
After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 1.3 KiB |
BIN
source/images/supported_brands/keyboard.png
Normal file
After Width: | Height: | Size: 314 B |
Before Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 982 B After Width: | Height: | Size: 982 B |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 4.0 KiB |
Before Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 2.2 KiB |