Skip to content

Commit

Permalink
Merge branch 'current' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Jan 27, 2020
2 parents c437a76 + 8a7e31a commit adf2738
Show file tree
Hide file tree
Showing 15 changed files with 131 additions and 91 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ end

group :jekyll_plugins do
gem 'jekyll-paginate', '1.1.0'
gem 'jekyll-redirect-from', '0.15.0'
gem 'jekyll-redirect-from', '0.16.0'
gem 'jekyll-sitemap', '1.4.0'
gem 'jekyll-time-to-read', '0.1.2'
gem 'jekyll-commonmark', '1.3.1'
Expand Down
20 changes: 10 additions & 10 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ GEM
http_parser.rb (~> 0.6.0)
eventmachine (1.2.7)
eventmachine (1.2.7-x64-mingw32)
ffi (1.11.2)
ffi (1.11.2-x64-mingw32)
ffi (1.12.1)
ffi (1.12.1-x64-mingw32)
forwardable-extended (2.6.0)
http_parser.rb (0.6.0)
i18n (1.7.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
jekyll (4.0.0)
addressable (~> 2.4)
Expand All @@ -50,7 +50,7 @@ GEM
commonmarker (~> 0.14)
jekyll (>= 3.7, < 5.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.15.0)
jekyll-redirect-from (0.16.0)
jekyll (>= 3.3, < 5.0)
jekyll-sass-converter (2.0.1)
sassc (> 2.0.1, < 3.0)
Expand All @@ -64,7 +64,7 @@ GEM
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.3)
listen (3.2.0)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.3.6)
Expand All @@ -78,15 +78,15 @@ GEM
mini_portile2 (~> 2.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (4.0.1)
public_suffix (4.0.3)
rack (2.0.8)
rack-protection (2.0.8.1)
rack
rake (13.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
rouge (3.13.0)
rouge (3.15.0)
ruby-enum (0.7.2)
i18n
ruby2_keywords (0.0.1)
Expand All @@ -111,7 +111,7 @@ GEM
concurrent-ruby (~> 1.0)
tzinfo-data (1.2019.3)
tzinfo (>= 1.0.0)
unicode-display_width (1.6.0)
unicode-display_width (1.6.1)

PLATFORMS
ruby
Expand All @@ -122,7 +122,7 @@ DEPENDENCIES
jekyll (= 4.0.0)
jekyll-commonmark (= 1.3.1)
jekyll-paginate (= 1.1.0)
jekyll-redirect-from (= 0.15.0)
jekyll-redirect-from (= 0.16.0)
jekyll-sitemap (= 1.4.0)
jekyll-time-to-read (= 0.1.2)
nokogiri (= 1.10.7)
Expand Down
6 changes: 0 additions & 6 deletions source/_docs/automation/trigger.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ automation:
mood: happy
```
<div class='note warning'>
Starting 0.42, it is no longer possible to listen for event `homeassistant_start`. Use the 'homeassistant' platform below instead.

</div>

### Home Assistant trigger
Triggers when Home Assistant starts up or shuts down.
Expand Down
2 changes: 1 addition & 1 deletion source/_docs/backend/database.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: "Details about the database used by Home Assistant."
redirect_from: /details/database/
---

The default database used by Home Assistant is [SQLite](https://www.sqlite.org/), and the database file is stored in your [configuration directory](/getting-started/configuration/) (e.g., `<path to config dir>/.homeassistant/home-assistant_v2.db`). If you prefer to run a database server (e.g. PostgreSQL), use the [`recorder` component](/integrations/recorder/).
Database is used in by Home Assistant as history and tracker only, to store the events and its parameters. The default database used by Home Assistant is [SQLite](https://www.sqlite.org/), and the database file is stored in your [configuration directory](/getting-started/configuration/) (e.g., `<path to config dir>/.homeassistant/home-assistant_v2.db`). If you prefer to run a database server (e.g. PostgreSQL), use the [`recorder` component](/integrations/recorder/).

To work with the SQLite database manually from the command-line, you will need an [installation](http://www.sqlitetutorial.net/download-install-sqlite/) of `sqlite3`. Alternatively [DB Browser for SQLite](http://sqlitebrowser.org/) provides a viewer for exploring the database data and an editor for executing SQL commands.
First load your database with `sqlite3`:
Expand Down
2 changes: 1 addition & 1 deletion source/_docs/configuration/customizing-devices.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Device class is currently supported by the following components:
* [Binary Sensor](/integrations/binary_sensor/)
* [Sensor](/integrations/sensor/)
* [Cover](/integrations/cover/)
* [Media Player](integrations/media_player/)
* [Media Player](/integrations/media_player/)

### Manual customization

Expand Down
69 changes: 28 additions & 41 deletions source/_docs/configuration/events.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -8,62 +8,49 @@ The core of Home Assistant is the event bus. The event bus allows any integratio

Home Assistant contains a few built-in events that are used to coordinate between various components.

### Event `homeassistant_start`
Event `homeassistant_start` is fired when all integrations from the configuration have been initialized. This is the event that will start the timer firing off `time_changed` events.

<div class='note warning'>

Starting 0.42, it is no longer possible to listen for event `homeassistant_start`. Use the 'homeassistant' [platform](/docs/automation/trigger) instead.

</div>

### Event `homeassistant_stop`
Event `homeassistant_stop` is fired when Home Assistant is shutting down. It should be used to close any open connection or release any resources.


### Event `state_changed`
Event `state_changed` is fired when a state changes. Both `old_state` and `new_state` are state objects. [Documentation about state objects.](/topics/state_object/)

Field | Description
----- | -----------
`entity_id` | Entity ID of the changed entity. Example: `light.kitchen`
`old_state` | The previous state of the entity before it changed. This field is omitted if the entity is new.
`new_state` | The new state of the entity. This field is omitted if the entity is removed from the state machine.
| Field | Description |
| ----------- | --------------------------------------------------------------------------------------------------- |
| `entity_id` | Entity ID of the changed entity. Example: `light.kitchen` |
| `old_state` | The previous state of the entity before it changed. This field is omitted if the entity is new. |
| `new_state` | The new state of the entity. This field is omitted if the entity is removed from the state machine. |


### Event `time_changed`
Event `time_changed` is fired every second by the timer and contains the current time.

Field | Description
----- | -----------
`now` | A [datetime object](https://docs.python.org/3.4/library/datetime.html#datetime.datetime) containing the current time in UTC.
| Field | Description |
| ----- | ---------------------------------------------------------------------------------------------------------------------------- |
| `now` | A [datetime object](https://docs.python.org/3.4/library/datetime.html#datetime.datetime) containing the current time in UTC. |


### Event `service_registered`
Event `service_registered` is fired when a new service has been registered within Home Assistant.

Field | Description
----- | -----------
`domain` | Domain of the service. Example: `light`.
`service` | The service to call. Example: `turn_on`
| Field | Description |
| --------- | ---------------------------------------- |
| `domain` | Domain of the service. Example: `light`. |
| `service` | The service to call. Example: `turn_on` |


### Event `call_service`
Event `call_service` is fired to call a service.

Field | Description
----- | -----------
`domain` | Domain of the service. Example: `light`.
`service` | The service to call. Example: `turn_on`
`service_data` | Dictionary with the service call parameters. Example: `{ 'brightness': 120 }`.
`service_call_id` | String with a unique call id. Example: `23123-4`.
| Field | Description |
| ----------------- | ------------------------------------------------------------------------------ |
| `domain` | Domain of the service. Example: `light`. |
| `service` | The service to call. Example: `turn_on` |
| `service_data` | Dictionary with the service call parameters. Example: `{ 'brightness': 120 }`. |
| `service_call_id` | String with a unique call id. Example: `23123-4`. |

### Event `service_executed`
Event `service_executed` is fired by the service handler to indicate the service is done.

Field | Description
----- | -----------
`service_call_id` | String with the unique call id of the service call that was executed. Example: `23123-4`.
| Field | Description |
| ----------------- | ----------------------------------------------------------------------------------------- |
| `service_call_id` | String with the unique call id of the service call that was executed. Example: `23123-4`. |

<div class='note warning'>

Expand All @@ -75,15 +62,15 @@ Field | Description

Event `platform_discovered` is fired when a new platform has been discovered by the [`discovery`](/integrations/discovery/) component.

Field | Description
----- | -----------
`service` | The platform that is discovered. Example: `zwave`.
`discovered` | Dictionary containing discovery information. Example: `{ "host": "192.168.1.10", "port": 8889}`.
| Field | Description |
| ------------ | ------------------------------------------------------------------------------------------------ |
| `service` | The platform that is discovered. Example: `zwave`. |
| `discovered` | Dictionary containing discovery information. Example: `{ "host": "192.168.1.10", "port": 8889}`. |


### Event `component_loaded`
Event `component_loaded` is fired when a new integration has been loaded and initialized.

Field | Description
----- | -----------
`component` | Domain of the integration that has just been initialized. Example: `light`.
| Field | Description |
| ----------- | --------------------------------------------------------------------------- |
| `component` | Domain of the integration that has just been initialized. Example: `light`. |
1 change: 1 addition & 0 deletions source/_integrations/netgear.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,6 @@ The use of `devices` or `exclude` is recommended when using `accesspoints` to av
List of models that are known to use port 80:
- Nighthawk X4S - AC2600 (R7800)
- Orbi
- XR500

See the [device tracker integration page](/integrations/device_tracker/) for instructions how to configure the people to be tracked.
2 changes: 1 addition & 1 deletion source/_integrations/python_script.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if entity_id is not None:
service_data = {"entity_id": entity_id, "rgb_color": rgb_color, "brightness": 255}
hass.services.call("light", "turn_on", service_data, False)
```
The above `python_script` can be called using the following JSON as an input.
The above `python_script` can be called using the following YAML as an input.

```yaml
entity_id: light.bedroom
Expand Down
6 changes: 6 additions & 0 deletions source/_integrations/recorder.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ recorder:
description: The list of entity ids to be excluded from recordings.
required: false
type: list
event_types:
description: The list of event types to be excluded from recordings.
required: false
type: list
include:
description: Configure which integrations should be included in recordings. If set, all other entities will not be recorded.
required: false
Expand Down Expand Up @@ -85,6 +89,8 @@ recorder:
- sun.sun # Don't record sun data
- sensor.last_boot # Comes from 'systemmonitor' sensor platform
- sensor.date
event_types:
- call_service # Don't record service calls
```

define domains and entities to record by using the `include` configuration (aka. whitelist) is convenient if you have a lot of entities in your system and your `exclude` lists possibly get very large, so it might be better just to define the entities or domains to record.
Expand Down
19 changes: 19 additions & 0 deletions source/_integrations/remote.xiaomi_miio.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,25 @@ remote:
- pronto:pronto_hex:[optional_repeat]
```
## Add command as entity button in Lovelace UI
```yaml
type: entity-button
tap_action:
action: call-service
service: remote.send_command
service_data:
command: activate_towel_heater
entity_id: remote.xiaomi_miio_ir
hold_action:
action: more-info
show_icon: true
show_name: true
entity: remote.xiaomi_miio_ir
icon: 'mdi:radiator'
name: Activate Towel Heater
```
## Use named commands to create UI buttons
```yaml
Expand Down
2 changes: 2 additions & 0 deletions source/_integrations/tplink.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ The following devices are known to work with this component.

### Plugs

Plugs are type `switch` when autodiscovery has been disabled.

- HS100
- HS103
- HS105
Expand Down
14 changes: 14 additions & 0 deletions source/_integrations/vacuum.xiaomi_miio.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,20 @@ The following table shows the units of measurement for each attribute:

## Retrieving the Access Token

### Xiaomi Home app (Xiaomi Aqara Gateway, android?)

1. Install the Xiaomi Home app.
2. Sign In/make an account.
3. Make sure you set your region to: Mainland China (Seems to be the longest line with Chines characters) under settings -> Region (language can later be set on English).
4. Select your Gateway in Xiaomi Home app.
5. Then the 3 dots at the top right of the screen.
6. Then click on about.
7. Tap the version number (Plug-in version 2.77.1 as of January 2020) at the bottom of the screen repeatedly.
8. You should now see 2 extra options listed in English, this means you enabled developer mode. [if not, try all steps again!].
9. Under "Hub info" there is quite some text in JSON format, this includes the "token" that you need.

### Alternative methods

<div class='note'>

If using an Android device to retrieve the Access Token only `v5.4.49` of Mi Home is confirmed working (December 2019). Use `v5.4.49` of Mi Home locate a text file under the `Smarthome/logs` folder where the 32 character token is stored. There will likely be several text files in this directory, search all of them for the word 'token' and you should find it there. Be advised that the latest version of Mi Home does not store the token in clear text.
Expand Down
Loading

0 comments on commit adf2738

Please sign in to comment.