Calendar: add state (#34681)

This commit is contained in:
c0ffeeca7 2024-09-11 13:32:03 +02:00 committed by GitHub
parent d4ac5bda90
commit 3ce8b1a72b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -21,7 +21,6 @@ integrations page to find integrations offering calendar entities. For example,
{% include integrations/building_block_integration.md %}
## Viewing and managing calendars
Each calendar is represented as its own {% term entity %} in Home Assistant and can be
@ -34,6 +33,13 @@ the **Add event** button in the lower right corner of the calendar dashboard.
Also see [Actions](#actions) below.
## The state of a calendar entity
The state shows whether or not there is an active event:
- On: The calendar has an active event.
- Off: The calendar does not have an active event.
## Automation
Calendar [Triggers](/docs/automation/trigger) enable {% term automation %} based on an
@ -148,16 +154,16 @@ directly using {% term actions %}. The actions provided by some calendar {% term
Add a new calendar event. A calendar `target` is selected with a [Target Selector](/docs/blueprint/selectors/#target-selector) and the `data` payload supports the following fields:
| Data attribute | Optional | Description | Example |
| ---------------------- | -------- | ----------- | --------|
| `summary` | no | Acts as the title of the event. | Bowling
| `description` | yes | The description of the event. | Birthday bowling
| `start_date_time` | yes | The date and time the event should start. | 2019-03-10 20:00:00
| `end_date_time` | yes | The date and time the event should end (exclusive). | 2019-03-10 23:00:00
| `start_date` | yes | The date the whole day event should start. | 2019-03-10
| `end_date` | yes | The date the whole day event should end (exclusive). | 2019-03-11
| `in` | yes | Days or weeks that you want to create the event in. | "days": 2
| `location` | yes | The location of the event. | Bowling center
| Data attribute | Optional | Description | Example |
| ----------------- | -------- | ---------------------------------------------------- | ------------------- |
| `summary` | no | Acts as the title of the event. | Bowling |
| `description` | yes | The description of the event. | Birthday bowling |
| `start_date_time` | yes | The date and time the event should start. | 2019-03-10 20:00:00 |
| `end_date_time` | yes | The date and time the event should end (exclusive). | 2019-03-10 23:00:00 |
| `start_date` | yes | The date the whole day event should start. | 2019-03-10 |
| `end_date` | yes | The date the whole day event should end (exclusive). | 2019-03-11 |
| `in` | yes | Days or weeks that you want to create the event in. | "days": 2 |
| `location` | yes | The location of the event. | Bowling center |
{% note %}
@ -196,11 +202,11 @@ data:
This action populates [Response Data](/docs/scripts/perform-actions#use-templates-to-handle-response-data)
with calendar events within a date range. It can return events from multiple calendars.
| Data attribute | Optional | Description | Example |
| ---------------------- | -------- | ----------- | --------|
| `start_date_time` | yes | Return active events after this time (exclusive). When not set, defaults to now. | 2019-03-10 20:00:00
| `end_date_time` | yes | Return active events before this time (exclusive). Cannot be used with `duration`. You must specify either `end_date_time` or `duration`.| 2019-03-10 23:00:00
| `duration` | yes | Return active events from `start_date_time` until the specified duration. Cannot be used with `end_date_time`. You must specify either `duration` or `end_date_time`. | `days: 2`
| Data attribute | Optional | Description | Example |
| ----------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------- |
| `start_date_time` | yes | Return active events after this time (exclusive). When not set, defaults to now. | 2019-03-10 20:00:00 |
| `end_date_time` | yes | Return active events before this time (exclusive). Cannot be used with `duration`. You must specify either `end_date_time` or `duration`. | 2019-03-10 23:00:00 |
| `duration` | yes | Return active events from `start_date_time` until the specified duration. Cannot be used with `end_date_time`. You must specify either `duration` or `end_date_time`. | `days: 2` |
{% note %}
Use only one of `end_date_time` or `duration`.
@ -221,13 +227,13 @@ response_variable: agenda
The response data contains a field for every calendar entity (e.g. `calendar.school` and `calendar.work` in this case).
Every calendar entity has a field `events` containing a list of events with these fields:
| Response data | Description | Example |
| ---------------------- | ----------- | -------- |
| `summary` | The title of the event. | Bowling
| `description` | The description of the event. | Birthday bowling
| `start` | The date or date time the event starts. | 2019-03-10 20:00:00
| `end` | The date or date time the event ends (exclusive). | 2019-03-10 23:00:00
| `location` | The location of the event. | Bowling center
| Response data | Description | Example |
| ------------- | ------------------------------------------------- | ------------------- |
| `summary` | The title of the event. | Bowling |
| `description` | The description of the event. | Birthday bowling |
| `start` | The date or date time the event starts. | 2019-03-10 20:00:00 |
| `end` | The date or date time the event ends (exclusive). | 2019-03-10 23:00:00 |
| `location` | The location of the event. | Bowling center |
This example uses a template with response data in another action: