mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-24 01:37:23 +00:00
Merge branch 'master' into next
This commit is contained in:
commit
6029679a51
@ -7,7 +7,7 @@ sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo: zknx.png
|
||||
logo: knx.png
|
||||
ha_category: Binary Sensor
|
||||
ha_release: 0.24
|
||||
---
|
||||
|
@ -7,11 +7,21 @@ sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
logo: wink.png
|
||||
logo: raspberry-pi.png
|
||||
ha_category: Garage Door
|
||||
ha_release: 0.23
|
||||
---
|
||||
|
||||
The `rpi_gpio` garage door platform allows you to use a Raspberry Pi to control your Garage door.
|
||||
|
||||
It uses two pins on the Raspberry Pi.
|
||||
- The `state_pin` will detect if the door is closed, and
|
||||
- the `relay_pin` will trigger the door to open or close.
|
||||
|
||||
Although you do not need Andrews Hilliday's software controller when you run Home Assistant, he has written clear instructions on how to hook your garage door & sensors up to your Raspberry Pi, which can be found [here](https://github.com/andrewshilliday/garage-door-controller#hardware-setup).
|
||||
|
||||
To enable Raspberry Pi Garage doors in your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
garage_door:
|
||||
@ -23,4 +33,12 @@ garage_door:
|
||||
- relay_pin: 12
|
||||
state_pin: 13
|
||||
name: 'Right door'
|
||||
```
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **doors** array (*Required*): List of your doors.
|
||||
- **name** (*Optional*): Name to use in the Frontend.
|
||||
- **relay_pin** (*Required*): The pin of your Raspberry Pi where the relay is connected.
|
||||
- **state_pin** (*Required*): The pin of your Raspberry Pi to retrieve the state.
|
||||
|
||||
|
@ -64,11 +64,13 @@ Notice in the example below that in order to refer to the group "Living Room", y
|
||||
entities:
|
||||
- light.light_family_1
|
||||
- binary_sensor.motion_living
|
||||
|
||||
Bedroom: light.light_bedroom, switch.sleeping
|
||||
Rooms:
|
||||
view: yes
|
||||
|
||||
Rooms:
|
||||
view: yes
|
||||
name: Rooms
|
||||
entities:
|
||||
- group.living_room
|
||||
entities:
|
||||
- group.living_room
|
||||
- group.bedroom
|
||||
```
|
||||
```
|
||||
|
@ -58,5 +58,5 @@ Configuration variables:
|
||||
|
||||
- **devices** (*Required*): A list of devices with their name to use in the frontend.
|
||||
- **automatic_add** (*Optional*): To enable the automatic addition of new lights.
|
||||
- **signal_repetitions** *Optional*: Because the rxftrx device sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the switch to try to send each signal repeatedly.
|
||||
- **fire_event** *Optional*: Fires an event even if the state is the same as before. Can be used for automations.
|
||||
- **signal_repetitions** (*Optional*): Because the rxftrx device sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the switch to try to send each signal repeatedly.
|
||||
- **fire_event** (*Optional*): Fires an event even if the state is the same as before. Can be used for automations.
|
||||
|
@ -33,3 +33,8 @@ Configuration variables:
|
||||
- **host** (*Required*): The IP of the Sony Bravia TV, eg. 192.168.0.10
|
||||
- **name** (*Optional*): The name to use on the frontend.
|
||||
|
||||
You are also able to configure the TV manually by placing a `bravia.conf` file in your `.homeassistant` config directory with the following information - please update the details to match your setup:
|
||||
|
||||
```json
|
||||
{"192.168.0.10": {"pin": "7745", "mac": "ac:1e:0a:e1:0c:01"}}
|
||||
```
|
||||
|
@ -16,7 +16,17 @@ ha_release: 0.7.4
|
||||
|
||||
The `plex` platform allows you to connect a [Plex Media Server](https://plex.tv) to Home Assistant. It will allow you to control media playback and see the current playing item. The preferred way to setup the Plex platform is by enabling the the [the discovery component](/components/discovery/) and requires GDM to be enabled.
|
||||
|
||||
If local authentication is enabled or multiple users are defined, HASS requires an authentication token to be entered in the webinterface. See [Finding your account token / X-Plex-Token](https://support.plex.tv/hc/en-us/articles/204059436).
|
||||
If local authentication is enabled or multiple users are defined, Home Assistant requires an authentication token to be entered in the frontend. Press "CONFIGURE" to do it.
|
||||
|
||||
<p class='img'>
|
||||
<img src='{{site_root}}/images/screenshots/plex-configure.png' />
|
||||
</p>
|
||||
|
||||
If you don't know your token, see [Finding your account token / X-Plex-Token](https://support.plex.tv/hc/en-us/articles/204059436).
|
||||
|
||||
<p class='img'>
|
||||
<img src='{{site_root}}/images/screenshots/plex-token.png' />
|
||||
</p>
|
||||
|
||||
If you want to enable the plex platform directly, add the following lines to your `configuration.yaml`:
|
||||
|
||||
@ -26,7 +36,7 @@ media_player:
|
||||
platform: plex
|
||||
```
|
||||
|
||||
In case discovery does not work (GDM disabled or non-local plex server), you can create `~/.homeassistant/plex.conf` manually.
|
||||
In case [discovery](/components/discovery/) does not work (GDM disabled or non-local plex server), you can create `~/.homeassistant/plex.conf` manually.
|
||||
|
||||
```json
|
||||
{"IP_ADDRESS:PORT": {"token": "TOKEN"}}
|
||||
|
@ -40,6 +40,7 @@ Currently known supported models:
|
||||
- D8000
|
||||
- ES5500
|
||||
- ES6800
|
||||
- F6300
|
||||
- F6500
|
||||
- EH5600
|
||||
- F6400AF
|
||||
|
@ -60,18 +60,15 @@ notify:
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **name** (*Optional*): Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service
|
||||
`notify.NOTIFIER_NAME`.
|
||||
- **name** (*Optional*): Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`.
|
||||
- **api_key** (*Required*): The API token of your bot.
|
||||
- **chat_id** (*Required*: The chat ID of your user.
|
||||
|
||||
To use notifications, please see the [getting started with automation page](/getting-started/automation/).
|
||||
|
||||
### Photo support
|
||||
### {% linkable_title Photo support %}
|
||||
|
||||
```yaml
|
||||
...
|
||||
|
||||
action:
|
||||
service: notify.NOTIFIER_NAME
|
||||
data:
|
||||
@ -88,6 +85,8 @@ action:
|
||||
caption: I.e. for a Title
|
||||
```
|
||||
|
||||
- **url** or **file** (*Required*): For local or remote path to a picture
|
||||
- **caption** (*Optional*: Picture title
|
||||
- **username** and **password** (*Optional*: For URL they require a basic auth
|
||||
- **url** or **file** (*Required*): For local or remote path to an image.
|
||||
- **caption** (*Optional*): The title of the image.
|
||||
- **username** (*Optional*): Username for an URL which require HTTP basic authentication.
|
||||
- **password** (*Optional*): Username for an URL which require HTTP basic authentication.
|
||||
|
||||
|
@ -41,3 +41,16 @@ Configuration variables:
|
||||
| PostgreSQL | `postgresql://SERVER_IP/DB_NAME` |
|
||||
| PostgreSQL | `postgresql://scott:tiger@SERVER_IP/DB_NAME` |
|
||||
|
||||
## {% linkable_title Installation notes %}
|
||||
|
||||
Not all Python bindings for the choosen database engine can be installed directly. This section contains additional details which should help you to get it working.
|
||||
|
||||
### {% linkable_title MYSQL %}
|
||||
|
||||
For MySQL you may have to install a few dependencies:
|
||||
|
||||
```bash
|
||||
$ sudo apt-get install libmysqlclient-dev
|
||||
$ pip3 install mysqlclient
|
||||
```
|
||||
|
||||
|
@ -63,5 +63,5 @@ Configuration variables:
|
||||
|
||||
- **devices** (*Required*): A list of devices with their name to use in the frontend.
|
||||
- **automatic_add** (*Optional*): To enable the automatic addition of new roller shutters (Siemens/LightwaveRF only).
|
||||
- **signal_repetitions** *Optional*: Because the rxftrx device sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the roller shutter to try to send each signal repeatedly.
|
||||
- **fire_event** *Optional*: Fires an event even if the state is the same as before. Can be used for automations.
|
||||
- **signal_repetitions** (*Optional*): Because the rxftrx device sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the roller shutter to try to send each signal repeatedly.
|
||||
- **fire_event** (*Optional*): Fires an event even if the state is the same as before. Can be used for automations.
|
||||
|
@ -34,16 +34,15 @@ sensor:
|
||||
Configuration variables:
|
||||
|
||||
- **api_key** (*Required*): Your application's API key (get one by following the instructions above). This key identifies your application for purposes of quota management.
|
||||
- **origin** (*Required*): The starting point for calculating travel distance and time. You can supply one or more locations separated by the pipe character, in the form of an address, latitude/longitude coordinates, or a Google place ID.
|
||||
- **origin** (*Required*): The starting point for calculating travel distance and time. You can supply one or more locations separated by the pipe character, in the form of an address, latitude/longitude coordinates, or a [Google place ID](https://developers.google.com/places/place-id). When specifying the location using a Google place ID, the ID must be prefixed with `place_id:`.
|
||||
- **destination** (*Required*): One or more locations to use as the finishing point for calculating travel distance and time. The options for the destinations parameter are the same as for the origins parameter, described above.
|
||||
- **name** (*Optional*): A name to display on the sensor. The default is "Google Travel Time - <Transit Mode>" where transit mode is the mode set in options for the sensor (if no mode is set, the default is driving).
|
||||
- **options** (*Optional*): A dictionary containing parameters to add to all requests to the Distance Matrix API. A full listing of available options can be found [here](https://developers.google.com/maps/documentation/distance-matrix/intro#RequestParameters).
|
||||
- **departure_time** (*Optional*): Can be `now`, a Unix timestamp, or a 24 hour time string like `08:00:00`. If you provide a time string, it will be combined with the current date to get travel time for that moment.
|
||||
- **arrival_time** (*Optional*): See notes above for `departure_time`. `arrival_time` can not be `now`, only a Unix timestamp or time string. You can not provide both `departure_time` and `arrival_time`. If you do provide both, `arrival_time` will be removed from the request.
|
||||
|
||||
##### {% linkable_title Dynamic Configuration %}
|
||||
|
||||
|
||||
###Dynamic Configuration
|
||||
Tracking can be setup to track entities of type device_tracker, zone, and sensor. If an entity is placed in the origin or destination then every 5 minutes when the component updates it will use the latest location of that entity.
|
||||
|
||||
```yaml
|
||||
@ -64,7 +63,8 @@ sensor:
|
||||
destination: Eddies House # Friendly name of a zone
|
||||
```
|
||||
|
||||
####Entity Tracking
|
||||
#### {% linkable_title Entity Tracking %}
|
||||
|
||||
- **device_tracker**
|
||||
- If state is a zone then the zone location will be used
|
||||
- If state is not a zone it will look for the longitude and latitude attributes
|
||||
|
@ -74,4 +74,4 @@ Configuration variables:
|
||||
- **devices** (*Optional*): A list of devices with their name to use in the frontend.
|
||||
- **automatic_add** (*Optional*): To enable the automatic addition of new lights.
|
||||
- **data_type** (*Optional*): Which data type the sensor should show
|
||||
- **fire_event** *Optional*: Fires an event even if the state is the same as before. Can be used for automations.
|
||||
- **fire_event** (*Optional*): Fires an event even if the state is the same as before. Can be used for automations.
|
||||
|
@ -58,7 +58,18 @@ sensor:
|
||||
|
||||
### {% linkable_title Renaming sensor output %}
|
||||
|
||||
If you don't like the wording of a sensor output then the template sensor can help too. Processes monitored by the [System Monitor sensor](/components/sensor.systemmonitor/) show `on` or `off` if they are running or not. This example shows how the output of a monitored `glances` process can be renamed.
|
||||
If you don't like the wording of a sensor output then the template sensor can help too. Let's rename the output of the [Sun component](/components/sun/) as a simple example:
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
platform: template
|
||||
sensors:
|
||||
sun_state:
|
||||
value_template: {% raw %}'{% if is_state("sun.sun", "above_horizon") %}up{% else %}down{% endif %}'{% endraw %}
|
||||
friendly_name: 'Sun state'
|
||||
```
|
||||
|
||||
Processes monitored by the [System Monitor sensor](/components/sensor.systemmonitor/) show `on` or `off` if they are running or not. This example shows how the output of a monitored `glances` process can be renamed.
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
|
@ -13,13 +13,13 @@ ha_release: 0.24
|
||||
---
|
||||
|
||||
|
||||
The `yweather` platform uses [Yahoo Weather](http://https://www.yahoo.com/news/weather/) as an source for current meteorological data. The `forecast` will show you the condition for 5 days, 0 is the current day. You can use only `weather`, `temp_min`, and `temp_max` with forecast.
|
||||
The `yweather` platform uses [Yahoo Weather](https://www.yahoo.com/news/weather/) as an source for current meteorological data. The `forecast` will show you the condition for 5 days, 0 is the current day. You can use only `weather`, `temp_min`, and `temp_max` with forecast.
|
||||
|
||||
<p class='note warning'>
|
||||
Use of the Yahoo Weather API should not exceed reasonable request volume. Access is limited to 2,000 signed calls per day.
|
||||
</p>
|
||||
|
||||
The `woeid` (Where On Earth ID) for your location, as shown in the example below. You can find your woeid by copying the numeric digits at the end of the URL for your location at [Yahoo Weather](http://https://www.yahoo.com/news/weather/). If you don't add a woeid it generate it from Home Assistant's latitude and longitude.
|
||||
The `woeid` (Where On Earth ID) for your location, as shown in the example below. You can find your woeid by copying the numeric digits at the end of the URL for your location at [Yahoo Weather](https://www.yahoo.com/news/weather/). If you don't add a woeid it generate it from Home Assistant's latitude and longitude.
|
||||
|
||||
To add Yahoo Weather to your installation, add the following to your `configuration.yaml` file:
|
||||
|
||||
@ -66,4 +66,6 @@ Configuration variables:
|
||||
- **pressure**: The sea-level air pressure in millibars.
|
||||
- **visibility**: The average visibility.
|
||||
|
||||
Details about the API are available in the [Yahoo! EDeveloper Network](http://https://developer.yahoo.com/weather/).
|
||||
|
||||
Details about the API are available in the [Yahoo! Developer Network](https://developer.yahoo.com/weather/).
|
||||
|
||||
|
@ -26,6 +26,7 @@ To use your Hikvision cam in your installation, add the following to your `confi
|
||||
switch:
|
||||
platform: hikvisioncam
|
||||
host: 192.168.1.32
|
||||
port: 80
|
||||
name: Hikvision Cam 1 Motion Detection
|
||||
username: USERNAME
|
||||
password: PASSWORD
|
||||
@ -34,6 +35,7 @@ switch:
|
||||
Configuration variables:
|
||||
|
||||
- **host** *Required*: The IP address of your Hikvision camera, eg. 192.168.1.32
|
||||
- **port** *Optional*: The port to connec to your Hikvision camera (default is 80).
|
||||
- **name** *Optional*: This parameter allows you to override the name of your camera.
|
||||
- **username** *Required*: The username for accessing your Hikvision camera.
|
||||
- **password** *Required*: The password to access your Hikvision camera.
|
||||
|
@ -7,7 +7,11 @@ sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
<<<<<<< HEAD
|
||||
logo: zknx.png
|
||||
=======
|
||||
logo: knx.png
|
||||
>>>>>>> master
|
||||
ha_category: Switch
|
||||
ha_release: 0.24
|
||||
---
|
||||
|
@ -63,5 +63,5 @@ Configuration variables:
|
||||
|
||||
- **devices** (*Required*): A list of devices with their name to use in the frontend.
|
||||
- **automatic_add** (*Optional*): To enable the automatic addition of new switches.
|
||||
- **signal_repetitions** *Optional*: Because the rxftrx device sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the switch to try to send each signal repeatedly.
|
||||
- **fire_event** *Optional*: Fires an event even if the state is the same as before. Can be used for automations.
|
||||
- **signal_repetitions** (*Optional*): Because the rxftrx device sends its actions via radio and from most receivers it's impossible to know if the signal was received or not. Therefore you can configure the switch to try to send each signal repeatedly.
|
||||
- **fire_event** (*Optional*): Fires an event even if the state is the same as before. Can be used for automations.
|
||||
|
@ -34,7 +34,7 @@ thermostat:
|
||||
Configuration variables:
|
||||
|
||||
- **host** (*Required*): List of your Radiotherm thermostats
|
||||
- **hold_temp** (*Required*): Boolean to control if hass temp adjustments hold(True) or are temporary(False)
|
||||
- **hold_temp** (*Required*): Boolean to control if Home Assistant temperature adjustments hold (`True`) or are temporary (`False`).
|
||||
|
||||
Temperature settings from Home Assistant will be sent to thermostat and then hold at that temperature. Set to `False` if you set a thermostat schedule on the thermostat itself and just want Home Assistant to send temporary temperature changes.
|
||||
|
||||
|
@ -46,7 +46,7 @@ automation:
|
||||
|
||||
#### {% linkable_title Send sun rise/sun set notifications %}
|
||||
|
||||
Notifications send through [PushBullet](components/notify.pushbullet/) when the sun state is changed.
|
||||
Notifications send through [PushBullet](/components/notify.pushbullet/) when the sun state is changed.
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
|
32
source/_cookbook/notify_if__new_ha_release.markdown
Normal file
32
source/_cookbook/notify_if__new_ha_release.markdown
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
layout: page
|
||||
title: "Send notification if new Home Assistant release"
|
||||
description: "Basic example of how to send a notification if a new Home Assistant release is available"
|
||||
date: 2016-07-17 10:00
|
||||
sidebar: true
|
||||
comments: false
|
||||
sharing: true
|
||||
footer: true
|
||||
ha_category: Automation Examples
|
||||
---
|
||||
|
||||
The following example sends a notification via XMPP if a new Home Assistant release is available:
|
||||
|
||||
```yaml
|
||||
notify:
|
||||
- platform: xmpp
|
||||
name: jabber
|
||||
sender: sender@jabber.org
|
||||
password: !secret xmpp_password
|
||||
recipient: recipient@jabber.org
|
||||
|
||||
automation:
|
||||
- alias: Update notifications
|
||||
trigger:
|
||||
- platform: state
|
||||
entity_id: updater.updater
|
||||
action:
|
||||
service: notify.jabber
|
||||
data:
|
||||
message: 'There is a new Home Assistant release available.'
|
||||
```
|
@ -30,6 +30,7 @@ The `else` part is used to have the sensor keep it's last state if the newest [i
|
||||
While running the [Owntracks](/components/device_tracker.owntracks/) device tracker you can retrieve the battery level with a MQTT sensor.
|
||||
|
||||
```yaml
|
||||
sensor:
|
||||
- platform: mqtt
|
||||
state_topic: "owntracks/tablet/tablet"
|
||||
name: "Battery Tablet"
|
||||
|
@ -47,16 +47,26 @@ You can omit the `--config` option if you use the default configuration director
|
||||
- Frontend: Fix stream not reconnecting after standby ([@balloob])
|
||||
- Frontend: Wait up to two seconds for new state before resetting toggle after toggling state ([@balloob])
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
### {% linkable_title Hotfix 0.24.1 - July 21 %}
|
||||
|
||||
Quick hot fix after we found a bug in the migrator where it wouldn't work with a database in a non-standard location. Thanks to [@n8henrie] and [@AlucardZero].
|
||||
|
||||
>>>>>>> master
|
||||
### {% linkable_title Breaking changes %}
|
||||
|
||||
- Migrating existing databases (see above).
|
||||
- The [APCUPSd Sensor][apcupsd-sensor] was updated. This will need that you modify your `configuration.yaml` file.
|
||||
- Entity IDs of Verisure locks will change. This is a one time change but should improve readability.
|
||||
|
||||
<<<<<<< HEAD
|
||||
### {% linkable_title FAQ %}
|
||||
|
||||
- Frequently asked questions about this release will show up here...
|
||||
|
||||
=======
|
||||
>>>>>>> master
|
||||
[@bah2830]: https://github.com/bah2830/
|
||||
[@balloob]: https://github.com/balloob/
|
||||
[@dale3h]: https://github.com/dale3h/
|
||||
@ -70,6 +80,11 @@ You can omit the `--config` option if you use the default configuration director
|
||||
[@turbokongen]: https://github.com/turbokongen/
|
||||
[@usul27]: https://github.com/usul27
|
||||
[@w1ll1am23]: https://github.com/w1ll1am23/
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
[@n8henrie]: https://github.com/n8henrie/
|
||||
[@AlucardZero]: https://github.com/AlucardZero/
|
||||
>>>>>>> master
|
||||
|
||||
[apcupsd-sensor]: /components/sensor.apcupsd/
|
||||
[Brightness]: /components/light/
|
||||
|
114
source/_posts/2016-07-19-visualizing-your-iot-data.markdown
Normal file
114
source/_posts/2016-07-19-visualizing-your-iot-data.markdown
Normal file
@ -0,0 +1,114 @@
|
||||
---
|
||||
layout: post
|
||||
title: "Visualize your IoT data"
|
||||
description: "Export, process, and visualize your Home Assistant data."
|
||||
date: 2016-07-19 16:00:00 +0000
|
||||
date_formatted: "July 19, 2016"
|
||||
author: Fabian Affolter
|
||||
author_twitter: fabaff
|
||||
comments: true
|
||||
categories: How-To IoT-Data
|
||||
og_image: /images/blog/2016-07-reporting/libreoffice-graph.png
|
||||
---
|
||||
|
||||
<img src='/images/blog/2016-07-reporting/mpl-sensor.png' style='clear: right; border:none; box-shadow: none; float: right; margin-bottom: 12px;' width='200' />
|
||||
|
||||
The [history component](/components/history/) is tracking everything that is going on within Home Assistant. This means that you have access to all stored information about your home. Our history is not a full-fledged graphical processing and visualization component as you may know from systems and network monitoring tools. The current limitation is that you only can select a day for a visual output of your information and not a period. Also, there is no possibility to drill down on a specific entity.
|
||||
|
||||
This blog post will show you ways to export data for reporting, visualization, or further analysis of automation rules.
|
||||
|
||||
<!--more-->
|
||||
|
||||
In this blog post I use the temperature of the [Aare](https://en.wikipedia.org/wiki/Aare) river close to where I live as a show case. The temperatures were recorded with the [Swiss Hydrological Data sensor](/components/sensor.swiss_hydrological_data/) and the name of the sensor is `sensor.aare`.
|
||||
|
||||
The database is stored at `<path to config dir>/.homeassistant/home-assistant_v2.db` as [SQLite database](https://www.sqlite.org/). In all examples we are going to use the path: `/home/ha/.homeassistant/home-assistant_v2.db`
|
||||
|
||||
If you are just curious what's stored in your database then you can use the `sqlite3` command-line tool or a graphical one like [DB Browser for SQLite](http://sqlitebrowser.org/).
|
||||
|
||||
The table that is holding the states is called `states`. The `events` tables is responsible for storing the events which occurred. So, we will first check how many entries there are in the `states` table. `sqlite3` needs to know where the databases is located. To work with your database make sure that Home Assistant is not running or create a copy of the existing database. It's recommended to work with a copy.
|
||||
|
||||
```bash
|
||||
$ sqlite3 /home/ha/.homeassistant/home-assistant_v2.db
|
||||
SQLite version 3.11.0 2016-02-15 17:29:24
|
||||
sqlite> SELECT count(*) FROM states;
|
||||
24659
|
||||
```
|
||||
|
||||
Let's have a look at a sample [SQL](https://en.wikipedia.org/wiki/SQL) query. This query will show all states in a period for the sensor `sensor.aare`.
|
||||
|
||||
```sql
|
||||
SELECT state, last_changed FROM states
|
||||
WHERE
|
||||
entity_id = 'sensor.aare'
|
||||
AND
|
||||
last_changed BETWEEN
|
||||
'2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';
|
||||
```
|
||||
|
||||
The SQL statement can be formed that it fits exactly what you need. This means that you can process the data in any way you want for further use. Often it makes sense to eliminate certain entries like `Unknown` or peaks.
|
||||
|
||||
If the above query is executed in DB Browser for SQLite you would be able to save the sensor's graph as png.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/blog/2016-07-reporting/db-browser.png' />
|
||||
Visualization with DB Browser for SQLite
|
||||
</p>
|
||||
|
||||
You may ask: Why not do this with LibreOffice Calc or another spreadsheet application? As most spreadsheet applications are not able to work directly with SQLite database we are going to export the data from the database to [CSV](https://en.wikipedia.org/wiki/Comma-separated_values).
|
||||
|
||||
```bash
|
||||
$ sqlite3 -header -csv /home/ha/.homeassistant/home-assistant_v2.db "SELECT last_changed, state FROM states WHERE entity_id = 'sensor.aare' AND last_changed BETWEEN '2016-07-05 00:00:00.000000' AND '2016-07-07 00:00:00.000000';" > sensor.csv
|
||||
```
|
||||
|
||||
The ordering for the `SELECT` was changed to get the time stamps first and then the state. Now we can import the CSV file into the application of your choice, here it's LibreOffice Calc.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/blog/2016-07-reporting/libreoffice-import.png' />
|
||||
Import of the CSV file
|
||||
</p>
|
||||
|
||||
After the import a graph can be created over the existing data.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/blog/2016-07-reporting/libreoffice-graph.png' />
|
||||
Graph in LibreOffice
|
||||
</p>
|
||||
|
||||
You can also use [matplotlib](http://matplotlib.org/) to generate graphs as an alternative to a spreadsheet application. This is a powerful Python 2D plotting library. With the built-in support for SQLite in Python it will only take a couple lines of code to visualize your data.
|
||||
|
||||
```python
|
||||
import sqlite3
|
||||
from matplotlib import dates
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
import homeassistant.util.dt as dt
|
||||
|
||||
values = []
|
||||
timestamps = []
|
||||
|
||||
conn = sqlite3.connect('/home/ha/.homeassistant/home-assistant_v2.db')
|
||||
data = conn.execute("SELECT state, last_changed FROM states WHERE "
|
||||
"entity_id = 'sensor.aare' AND last_changed BETWEEN "
|
||||
"'2016-07-05 00:00:00.000000' AND "
|
||||
"'2016-07-07 00:00:00.000000'")
|
||||
|
||||
for x in data:
|
||||
timestamps.append(dates.date2num(dt.parse_datetime(x[1])))
|
||||
values.append(float(x[0]))
|
||||
|
||||
plt.plot_date(x=timestamps, y=values, fmt="r-")
|
||||
plt.ylabel('Temperature')
|
||||
plt.xlabel('Time line')
|
||||
|
||||
plt.savefig('sensor.png')
|
||||
```
|
||||
|
||||
Creating a connection to the database and executing a query is similar to the ways already seen. The return values from the query are splitted into two lists. The time stamps must be converted in an value which is accepted by matplotlib and then the graph is generated and saved as image.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/blog/2016-07-reporting/mpl-sensor.png' />
|
||||
Sensor graph generated by matplotlib
|
||||
</p>
|
||||
|
||||
Most of the graphs are pretty ugly. So, further beautification will be needed. If you have created a nice report including some amazing graphs then the Home Assistant community would be grateful for sharing them in our [forum](https://community.home-assistant.io/).
|
||||
|
@ -22,7 +22,7 @@ In this lighter version we will still need what could be called the core snippet
|
||||
```yaml
|
||||
homeassistant:
|
||||
# Name of the location where Home Assistant is running
|
||||
name: My Hass Instance
|
||||
name: My Home Assistant Instance
|
||||
# Location required to calculate the time the sun rises and sets
|
||||
latitude: 37
|
||||
longitude: -121
|
||||
@ -69,7 +69,7 @@ As with the core snippet, indentation makes a difference. The component headers
|
||||
|
||||
While some of these components can technically be moved to a separate file they are so small or "one off's" where splitting them off is superfluous. Also, you'll notice the # symbol (hash/pound). This represents a "comment" as far as the commands are interpreted. Put another way, any line prefixed with a `#` will be ignored. This makes breaking up files for human readability really convenient, not to mention turning off features while leaving the entry intact. (Look at the `zigbee:` entry above and the b entry further down)
|
||||
|
||||
Now, lets assume that a blank file has been created in the hass configuration directory for each of the following:
|
||||
Now, lets assume that a blank file has been created in the Home Assistant configuration directory for each of the following:
|
||||
|
||||
```text
|
||||
automation.yaml
|
||||
|
@ -59,21 +59,21 @@ script:
|
||||
|
||||
Home Assistant adds extensions to allow templates to access all of the current states:
|
||||
|
||||
- Iterating `states` will yield each state sorted alphabetically by entity ID.
|
||||
- Iterating `states.domain` will yield each state of that domain sorted alphabetically by entity ID.
|
||||
- `states.sensor.temperature` returns the state object for `sensor.temperature`.
|
||||
- `states('device_tracker.paulus')` will return the state string (not the object) of the given entity or `unknown` if it doesn't exist.
|
||||
- `is_state('device_tracker.paulus', 'home')` will test if the given entity is specified state.
|
||||
- `is_state_attr('device_tracker.paulus', 'battery', 40)` will test if the given entity is specified state.
|
||||
- Filter `multiply(x)` will convert the input to a number and multiply it with `x`.
|
||||
- Filter `round(x)` will convert the input to a number and round it to `x` decimals.
|
||||
- `now` will be rendered as current time in your time zone.
|
||||
- `utcnow` will be rendered as UTC time.
|
||||
- `as_timestamp` will convert datetime object or string to UNIX timestamp
|
||||
- `distance()` will measure the distance in meters between home, entity, coordinates.
|
||||
- `closest()` will find the closest entity.
|
||||
- `relative_time(timestamp)` will format the date time as relative time vs now (ie 7 seconds)
|
||||
|
||||
- Iterating `states` will yield each state sorted alphabetically by entity ID.
|
||||
- Iterating `states.domain` will yield each state of that domain sorted alphabetically by entity ID.
|
||||
- `states.sensor.temperature` returns the state object for `sensor.temperature`.
|
||||
- `states('device_tracker.paulus')` will return the state string (not the object) of the given entity or `unknown` if it doesn't exist.
|
||||
- `is_state('device_tracker.paulus', 'home')` will test if the given entity is specified state.
|
||||
- `is_state_attr('device_tracker.paulus', 'battery', 40)` will test if the given entity is specified state.
|
||||
- Filter `multiply(x)` will convert the input to a number and multiply it with `x`.
|
||||
- Filter `round(x)` will convert the input to a number and round it to `x` decimals.
|
||||
- `now` will be rendered as current time in your time zone.
|
||||
- `utcnow` will be rendered as UTC time.
|
||||
- `as_timestamp` will convert datetime object or string to UNIX timestamp
|
||||
- `distance()` will measure the distance in meters between home, entity, coordinates.
|
||||
- `closest()` will find the closest entity.
|
||||
- `relative_time(timestamp)` will format the date time as relative time vs now (ie 7 seconds)
|
||||
- `float` will format the output as float.
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
||||
@ -93,9 +93,9 @@ Print an attribute if state is defined
|
||||
```jinja2
|
||||
{% raw %}
|
||||
{% if states.device_tracker.paulus %}
|
||||
{{ states.device_tracker.paulus.attributes.battery }}
|
||||
{{ states.device_tracker.paulus.attributes.battery }}
|
||||
{% else %}
|
||||
??
|
||||
??
|
||||
{% endif %}{% endraw %}
|
||||
```
|
||||
|
||||
@ -119,7 +119,12 @@ Print out a list of all the sensor states.
|
||||
|
||||
{% if states('sensor.temperature') | float > 20 %}
|
||||
It is warm!
|
||||
{%endif %}{% endraw %}
|
||||
{%endif %}
|
||||
|
||||
{{ as_timestamp(states.binary_sensor.garage_door.last_changed) }}
|
||||
|
||||
{{ as_timestamp(now) - as_timestamp(states.binary_sensor.garage_door.last_changed) }}
|
||||
{% endraw %}
|
||||
```
|
||||
|
||||
### {% linkable_title Distance examples %}
|
||||
@ -183,4 +188,11 @@ It depends per component or platform but it is common to be able to define a tem
|
||||
|
||||
# Extract third prime number
|
||||
{% raw %}{{ value_json.primes[2] }}{% endraw %}
|
||||
|
||||
# Format output
|
||||
{% raw %}{{ "%+.1f" | value_json }}{% endraw %}
|
||||
|
||||
# Calculations
|
||||
{% raw %}{{ value_json | multiply(1024) }}{% endraw %}
|
||||
{% raw %}{{ value_json.used | multiply(0.0001) | round(0) }}{% endraw %}
|
||||
```
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -51,7 +51,7 @@ This page contains a list of people who have contributed in one way or another t
|
||||
- [Dale Higgs](https://github.com/dale3h)
|
||||
- [Dan Cinnamon](https://github.com/Cinntax)
|
||||
- [Daniel Perna](https://github.com/danielperna84)
|
||||
- [Daniel Iversen](https://github.com/danielhiversen)
|
||||
- [Daniel Høyer Iversen](https://github.com/danielhiversen)
|
||||
- [Daniel J. Kemp](https://github.com/danieljkemp/)
|
||||
- [Daniel Matuschek](https://github.com/usul27)
|
||||
- [Dan Smith](https://github.com/kk7ds)
|
||||
|
@ -11,6 +11,20 @@ footer: true
|
||||
|
||||
This example is for adding support for the imaginary Awesome Lights. It shows the different best practices for developing a platform.
|
||||
|
||||
Similar to Example Sensor Platform, Copy the code below and create it as a file in `<config_dir>/custom_components/light/awesomelights.py`.
|
||||
|
||||
Add the following to your configuration.yaml:
|
||||
|
||||
```yaml
|
||||
light:
|
||||
- platform: awesomelights
|
||||
host: HOST_HERE
|
||||
username: USERNAME_HERE
|
||||
password: PASSWORD_HERE_OR_secrets.yaml
|
||||
```
|
||||
|
||||
Note the `platform` name matches the filename for the source code.
|
||||
|
||||
```python
|
||||
import logging
|
||||
|
||||
|
@ -37,7 +37,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
class ExampleSensor(Entity):
|
||||
@property
|
||||
def name(self):
|
||||
return 'Temperature'
|
||||
return 'Example Temperature'
|
||||
|
||||
@property
|
||||
def state(self):
|
||||
|
@ -15,8 +15,10 @@ This page describes the steps for publishing a new Home Assistant release.
|
||||
|
||||
1. Create a pull request from `dev` to `master` with the upcoming release number as title.
|
||||
2. Merge `master` into `dev` to make the PR mergable. PR message contains intro, highlighting major changes, and an overview of all changes tagging each author.
|
||||
3. Merge pull request.
|
||||
4. Go to [releases](https://github.com/home-assistant/home-assistant/releases) and tag a new release on the `master` branch. Tag name and title name are version number. Release description is text from PR.
|
||||
3. Update `homeassistant/const.py` with the correct version number (remove the the `dev` tag) and push that commit.
|
||||
4. Merge pull request.
|
||||
5. Then, after merged, push another update to `dev` of `homeassistant/const.py` that includes the next version with the `dev` tag. Add a meaningful commit message like "Version bump to X". This commit acts as marker for the next release.
|
||||
6. Go to [releases](https://github.com/home-assistant/home-assistant/releases) and tag a new release on the `master` branch. "Tag version" and "Release title" are the version number (`O.x` for major version, `0.x.y` for minor and bug fix releases). Release description is the text from PR. Press "Publish release" to finish the process.
|
||||
|
||||
### {% linkable_title Website %}
|
||||
|
||||
@ -29,7 +31,7 @@ This page describes the steps for publishing a new Home Assistant release.
|
||||
|
||||
### {% linkable_title Python Package Index %}
|
||||
|
||||
Checkout `master` branch and run `script/release` to publish the new release on [Python Package Index](https://pypi.python.org)
|
||||
Checkout the `master` branch and run `script/release` to publish the new release on [Python Package Index](https://pypi.python.org).
|
||||
|
||||
### {% linkable_title Social media %}
|
||||
|
||||
|
@ -44,6 +44,12 @@ Visit [http://localhost:8123/local/sse.html](http://localhost:8123/local/sse.htm
|
||||
|
||||
## {% linkable_title Examples %}
|
||||
|
||||
The simplest way to consume server-sent events is `curl`.
|
||||
|
||||
```bash
|
||||
$ curl http://localhost:8123/api/stream?api_password=MYPASS
|
||||
```
|
||||
|
||||
### {% linkable_title Website %}
|
||||
|
||||
The [home-assistant-sse](https://github.com/fabaff/home-assistant-sse) repository contains an more advanced example.
|
||||
|
@ -50,11 +50,15 @@ Home Assistant runs as a self-hosted web application and contains support to be
|
||||
|
||||
### {% linkable_title Remote access %}
|
||||
|
||||
To make Home Assistant accessible while away from home, you will have to setup port forwarding from your router to port 8123 on the computer that is hosting Home Assistant. Instructions on how to do this can be found by searching `<Router model> port forwarding instructions`.
|
||||
To make Home Assistant accessible while away from home, you will have to make it accessible.
|
||||
|
||||
Some Internet service providers will only offer dynamic IPs. This can cause you to be unable to access Home Assistant while away. You can solve this by using a free Dynamic DNS service like [DuckDNS](https://www.duckdns.org/).
|
||||
The common approach is to setup port forwarding from your router to port 8123 on the computer that is hosting Home Assistant. Instructions on how to do this can be found by searching `<Router model> port forwarding instructions`.
|
||||
|
||||
You should definitely consider to encrypt your traffic if you are accessing your Home Assistant installation from abroad. For details please check the [Set up encryption using Let's Encrypt](/blog/2015/12/13/setup-encryption-using-lets-encrypt/) blog post.
|
||||
The problem with making a port accessible is that some Internet service providers will only offer dynamic IPs. This can cause you to be unable to access Home Assistant while away. You can solve this by using a free Dynamic DNS service like [DuckDNS](https://www.duckdns.org/).
|
||||
|
||||
Just putting a port up is not secure. You should definitely consider to encrypt your traffic if you are accessing your Home Assistant installation from abroad. For details please check the [Set up encryption using Let's Encrypt](/blog/2015/12/13/setup-encryption-using-lets-encrypt/) blog post.
|
||||
|
||||
If you want the very best security, check out [the instructions how to use Tor to access your home](/cookbook/tor_configuration/).
|
||||
|
||||
### [Next step: Setting up devices »](/getting-started/devices/)
|
||||
|
||||
|
@ -38,7 +38,7 @@ The following instructions will assume you changed your working directory to be
|
||||
vagrant up
|
||||
```
|
||||
|
||||
This will download + start a virtual machine using Virtualbox, which will internally setup the development environment necessary to start Home Assistant process and run test suite as well. After the VM has started succesfully, Home Assistant frontend will be accessible locally from your browser at [http://localhost:8123](http://localhost:8123)
|
||||
This will download and start a virtual machine using Virtualbox, which will internally setup the development environment necessary to start Home Assistant process and run test suite as well. After the VM has started succesfully, the Home Assistant frontend will be accessible locally from your browser at [http://localhost:8123](http://localhost:8123)
|
||||
|
||||
## {% linkable_title Stopping Vagrant %}
|
||||
|
||||
@ -52,9 +52,9 @@ To start it again, just run `vagrant up`
|
||||
|
||||
## {% linkable_title Restarting Home Assistant process to test changes %}
|
||||
|
||||
The root `home-assistant` directory on your workstation will be mirrored with `/home-assistant` inside the VM. In `virtualization/vagrant` there's also a `config` folder that you can use to drop configuration files ([here](https://home-assistant.io/getting-started/configuration/) you can find more information on how to configure HASS).
|
||||
The root `home-assistant` directory on your workstation will be mirrored with `/home-assistant` inside the VM. In `virtualization/vagrant` there's also a `config` folder that you can use to drop configuration files (Check the [Getting started section](https://home-assistant.io/getting-started/configuration/) for more information about how to configure Home Assistant).
|
||||
|
||||
Any changes made to the local directory on your workstation will be available from the Vagrant host, so to apply your changes to the HASS process, just restart it:
|
||||
Any changes made to the local directory on your workstation will be available from the Vagrant host, so to apply your changes to the Home Assistant process, just restart it:
|
||||
|
||||
```bash
|
||||
touch restart ; vagrant provision
|
||||
|
@ -16,7 +16,7 @@ The default way to update Home Assistant to the latest release, when available,
|
||||
$ pip3 install --upgrade homeassistant
|
||||
```
|
||||
|
||||
Different installation methods as [Raspberry Pi All-In-One Installer](/getting-started/installation-raspberry-pi-all-in-one/#upgrading), [Vagrant](/getting-started/installation-vagrant/), or [Virtualenv](/getting-started/installation-virtualenv/#upgrading-home-assistant) may have a alternative way for updating Home Assistant.
|
||||
Different installation methods as [Raspberry Pi All-In-One Installer](/getting-started/installation-raspberry-pi-all-in-one/#upgrading), [Vagrant](/getting-started/installation-vagrant/), or [Virtualenv](/getting-started/installation-virtualenv/#upgrading-home-assistant) may have an alternative way for updating Home Assistant.
|
||||
|
||||
After updating, restart Home Assistant for the changes to take effect. This means that you have to restart `hass` itself or the [autostarting](/getting-started/autostart/) daemon if you use any.
|
||||
|
||||
|
BIN
source/images/blog/2016-07-reporting/db-browser.png
Normal file
BIN
source/images/blog/2016-07-reporting/db-browser.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 104 KiB |
BIN
source/images/blog/2016-07-reporting/libreoffice-graph.png
Normal file
BIN
source/images/blog/2016-07-reporting/libreoffice-graph.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 356 KiB |
BIN
source/images/blog/2016-07-reporting/libreoffice-import.png
Normal file
BIN
source/images/blog/2016-07-reporting/libreoffice-import.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
BIN
source/images/blog/2016-07-reporting/mpl-sensor.png
Normal file
BIN
source/images/blog/2016-07-reporting/mpl-sensor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 12 KiB |
BIN
source/images/screenshots/plex-configure.png
Normal file
BIN
source/images/screenshots/plex-configure.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.9 KiB |
BIN
source/images/screenshots/plex-token.png
Normal file
BIN
source/images/screenshots/plex-token.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 23 KiB |
@ -15,8 +15,13 @@ hide_github_edit: true
|
||||
<div class="grid">
|
||||
<div class="grid__item one-third lap-one-third palm-one-whole">
|
||||
<div class='current-version material-card text'>
|
||||
<<<<<<< HEAD
|
||||
<h1>Current Version: 0.24</h1>
|
||||
Released: <span class='release-date'>July 16, 2016</span>
|
||||
=======
|
||||
<h1>Current Version: 0.24.1</h1>
|
||||
Released: <span class='release-date'>July 21, 2016</span>
|
||||
>>>>>>> master
|
||||
|
||||
<div class='links'>
|
||||
<a href='/blog/2016/07/16/sqlalchemy-knx-join-simplisafe/'>Release notes</a>
|
||||
|
Loading…
x
Reference in New Issue
Block a user