Update SIMPLISAFE_EVENT results and automation usage. (#16342)

This commit is contained in:
tanderson1992 2021-01-29 14:37:39 -05:00 committed by GitHub
parent 2a8d16aedc
commit 57fa899557
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,30 +105,51 @@ following keys:
* `system_id`: the system ID to which the event belongs * `system_id`: the system ID to which the event belongs
* `timestamp`: the UTC datetime at which the event was received * `timestamp`: the UTC datetime at which the event was received
For example, when the system is armed by "remote" means (via the web app, etc.), a For example, when someone rings the doorbell, a
`SIMPLISAFE_EVENT` event will fire with the following event data: `SIMPLISAFE_EVENT` event will fire with the following event data:
```python ```python
{ {
"changed_by": "", "event_type": "SIMPLISAFE_EVENT",
"event_type": "armed_home", "data": {
"info": "System Armed (Home) by Remote Management", "last_event_changed_by": "",
"sensor_name": "", "last_event_type": "doorbell_detected",
"sensor_serial": "", "last_event_info": "Someone is at your \"Front Door\"",
"sensor_type": "remote", "last_event_sensor_name": "Front Door",
"system_id": 123456, "last_event_sensor_serial": "",
"timestamp": datetime.datetime(2020, 2, 13, 23, 1, 13, tzinfo=<UTC>), "last_event_sensor_type": "doorbell",
"system_id": [systemid],
"last_event_timestamp": "2021-01-28T22:01:32+00:00"
},
"origin": "LOCAL",
"time_fired": "2021-01-28T22:01:37.478539+00:00",
"context": {
"id": "[id]",
"parent_id": null,
"user_id": null
}
} }
``` ```
`event_type`, being one of the key fields automations might be built from, can have the `last_event_type` can have the following values:
following values:
* `camera_motion_detected` * `camera_motion_detected`
* `doorbell_detected` * `doorbell_detected`
* `entry_detected` * `entry_detected`
* `motion_detected` * `motion_detected`
To build an automation using one of these, use `SIMPLISAFE_EVENT`
as an event trigger, with `last_event_type` as the `event_data`.
For example, the following will trigger when the doorbell rings:
```yaml
trigger:
- platform: event
event_type: SIMPLISAFE_EVENT
event_data:
last_event_type: doorbell_detected
```
### `SIMPLISAFE_NOTIFICATION` ### `SIMPLISAFE_NOTIFICATION`
`SIMPLISAFE_NOTIFICATION` events represent system notifications that would appear in the `SIMPLISAFE_NOTIFICATION` events represent system notifications that would appear in the