Skip to content
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The easiest way to get started with development is to use Visual Studio Code wit
- [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- Docker
- For Linux, macOS, or Windows 10 Pro/Enterprise/Education use the [current release version of Docker](https://docs.docker.com/install/)
- Windows 10 Home requires [WSL 2](https://docs.microsoft.com/windows/wsl/wsl2-install) and the current Edge version of Docker Desktop (see instructions [here](https://docs.docker.com/docker-for-windows/wsl-tech-preview/)). This can also be used for Windows Pro/Enterprise/Education.
- Windows 10 Home requires [WSL 2](https://docs.microsoft.com/windows/wsl/wsl2-install) and [Docker Desktop WSL 2 backend on Windows](https://docs.docker.com/desktop/features/wsl/). This can also be used for Windows Pro/Enterprise/Education.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The old link redirected to the link I'm suggesting. It seems that this feature is no longer limited to Edge.
  • Links should be accessible to the blind and thus not use here as their titles.

- [Visual Studio code](https://code.visualstudio.com/)
- [Remote - Containers (VSC Extension)][extension-link]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ _TL;DR: Today we launch a new data portal to get users up and running with their

“Data is the new oil” is a popular expression on the internet, and whether or not you agree with that statement, it does summarise several points about data. Firstly, data, and in particular personal data, holds tremendous value. Large corporations realise this, and will go to extreme lengths to gain access to personal data since it contains insights into your behaviour. Insights generated from that data allows them to better target their marketing, giving them an edge over the competition. Secondly, data, like oil, requires processing before it is useful. Whilst oil is processed in refineries, data is processed by data scientists, who use various statistical techniques to separate signal from noise. The signals they generate are fed into models which aim to predict future behaviour based on historical data.

So what has this got to do with Home Assistant, or home automation in general? Well on the first point, a core principle of Home Assistant is that a user has complete ownership of their personal data. A users data lives locally, typically on the SD card in their Raspberry Pi. In particular, Home Assistant stores data in a SQL database, meaning that standard data science tools can be used to read that data. On the second point, the parallel with data scientists generating signals to act on, is a Home Assistant user configuring an automation to do some action in their home. If you break it down, the process of creating an automation consists of a couple of steps:
So what has this got to do with Home Assistant, or home automation in general? Well, on the first point, a core principle of Home Assistant is that a user has complete ownership of their personal data. A users data lives locally, typically on the SD card in their Raspberry Pi. In particular, Home Assistant stores data in a SQL database, meaning that standard data science tools can be used to read that data. On the second point, the parallel with data scientists generating signals to act on, is a Home Assistant user configuring an automation to do some action in their home. If you break it down, the process of creating an automation consists of a couple of steps:

1. We first *identify a need* for an automation.
2. We go through a *process of optimisation* to decide the conditions when the automation should be triggered, and how the automation should behave.
Expand Down
4 changes: 2 additions & 2 deletions docs/data_context.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A context object contains the following fields:
| Field | Description |
| ---------------- | ------------------------------------------------------------------------------------- |
| id | Unique identifier for the context. |
| user_id | Unique identifier of the user that started the change, in case it is known to home assistant. This field is most notably populated, if the change is initiatited via the frontend. The user_id is used for restricting the ability to access and change the state of your home. |
| user_id | Unique identifier of the user that started the change, if it is known to home assistant. This field is most notably populated, if the change is initiated via the frontend. The user_id is used for restricting the ability to access and change the state of your home. |
| parent_id | Unique identifier of the parent context's id that started the change. Most notably, automations will generate a new context, even if the trigger already has one. This is done to decouple the automation actions from the user privileges possibly associated to the trigger. Note that, currently, not all triggers generate a context. |

In the following example, all events and states will refer to the same context (either directly in their `context.id` or via `context.parent_id`):
Expand All @@ -21,7 +21,7 @@ In the following example, all events and states will refer to the same context (
- The automation calls service `light.turn_on`, which fires the `service_call` event.
- The `light.turn_on` service turns on the light which causes an update to the state of `light.living_room`.

Context is not stored in their own table in the database. Instead, each event row maintains it's own columns to store context.
Context is not stored in their own table in the database. Instead, each event row maintains its own columns to store context.
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Habbie asked me to make a PR for this


Currently, there is no native way to retrieve the original cause of a context in automations or templates.

Expand Down
2 changes: 1 addition & 1 deletion docs/data_events.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ SELECT event_type, time_fired_ts, event_data.shared_data as data, NULL as attrib

### Finding the event_data for events

For events that were recorded after the `event_data` table was created, the data is in the `event_data` table. While there are still older rows in the database, check the `shared_data` field first and fallback to the `event_data` field.
For events that were recorded after the `event_data` table was created, the data is in the `event_data` table. While there are still older rows in the database, check the `shared_data` field first and fall back to the `event_data` field.

```sql
SELECT * FROM events LEFT JOIN event_data ON (events.data_id=event_data.data_id);
Expand Down
2 changes: 1 addition & 1 deletion docs/data_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ sidebar_label: "Introduction"

Home Assistant offers a lot of functionality, but it is actually built around a very simple and powerful core. This simplicity is not only in our core code, it can also be seen in our data model: events, states, services and context. This simplicity makes it easy to reason about what is going on and to reason about what happened.

The Home Assistant core is event-driven. This means that everything that happens is represented as an event: a light being turned on, a motion sensor being tripped or an automation triggered. Each event has an attached context. The context can be used to identify which events have been triggered as a response to other events, which user triggered the original event and with which authentication (auth piece is still under development).
The Home Assistant core is event-driven. This means that everything that happens is represented as an event: a light being turned on, a motion sensor being tripped, or an automation triggered. Each event has an attached context. The context can be used to identify which events have been triggered as a response to other events, which user triggered the original event and with which authentication (auth piece is still under development).
2 changes: 1 addition & 1 deletion static/img/brand/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
The license of this respository does not extend to any logo or design mark owned
The license of this repository does not extend to any logo or design mark owned
by Nabu Casa/Home Assistant.
All rights reserved.