Reolink rich notifications tutorial (#36229)
* Reolink rich notifications tutorial * Spelling * Update reolink.markdown * Update reolink.markdown * Add cooldown timer condition * Update reolink.markdown * Update reolink.markdown * Update reolink.markdown * Update reolink.markdown * Convert first few images * Update reolink.markdown * Update reolink.markdown * Add images as files * Update reolink.markdown * Tiny tweaks * indents * indent more * uniform indent --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
@ -493,6 +493,130 @@ For example, you can place arrow buttons on the card to [control the camera](/da
|
||||
|
||||
You can receive rich notifications on your phone when someone rings a Reolink doorbell or a Reolink camera detects an event like motion or a person.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__small_notification.jpg' alt='Screenshot: Small phone notification'>
|
||||
<img src='/images/integrations/reolink/rich_notification__big_notification.jpg' alt='Screenshot: Expanded phone notification'>
|
||||
</p>
|
||||
|
||||
{% details "Rich notification tutorial" icon="mdi:cursor-hand" %}
|
||||
|
||||
Prerequisites:
|
||||
|
||||
- This [Reolink integration](#configuration)
|
||||
- [Android or iOS companion app](https://companion.home-assistant.io/docs/getting_started#setting-up)
|
||||
- [Remote access to Home Assistant](https://www.home-assistant.io/docs/configuration/remote/). Although you can receive text notifications without remote access, to see the camera image in the notification (rich notification), the phone needs to be able to reach Home Assistant. The rich notification will always work, even without remote access, when the phone is on the same network as Home Assistant.
|
||||
|
||||
1. In order to receive such a rich notification, we are going to make an automation in Home Assistant. In Home Assistant go to {% my automations title="**Settings** > **Automations & scenes**" %} and select **Create automation** > **Create new automation**.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__new_automation.png' alt='Screenshot: new automation'>
|
||||
</p>
|
||||
|
||||
2. Under **When**, select: **Add trigger** > **Entity** > **State**.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__new_trigger.png' alt='Screenshot: new trigger'>
|
||||
</p>
|
||||
|
||||
Then under **Entity**, select the binary sensor from the drop-down list corresponding to the camera event for which you want to receive a rich notification. For the Reolink integration the options are:
|
||||
|
||||
- binary_sensor.*camera name*_motion
|
||||
- binary_sensor.*camera name*_person
|
||||
- binary_sensor.*camera name*_vehicle
|
||||
- binary_sensor.*camera name*_pet
|
||||
- binary_sensor.*camera name*_animal
|
||||
- binary_sensor.*camera name*_visitor (doorbell press)
|
||||
- binary_sensor.*camera name*_package
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__entity_select.png' alt='Screenshot: Entity select'>
|
||||
</p>
|
||||
|
||||
Note that these entity names will be translated into the language you configured Home Assistant in. You can type to search through all your entities. You can add multiple triggers if you want to send the same message for multiple camera events like person and vehicle detection. You can also create multiple automations with different messages for each event. In this case, we chose the visitor detection for doorbell presses:
|
||||
|
||||
3. Under **To** select the state in which the event is detected: for visitor **On** for the other sensors **Detected**:
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__state_select.png' alt='Screenshot: State select'>
|
||||
</p>
|
||||
|
||||
4. Under **And if** you can **optionally** limit when the notifications need to be sent.
|
||||
|
||||
- For instance only when you are not home. The companion app will provide a device_tracker entity based on the GPS of your phone if you allow location tracking during the setup of the app. We will use this as an example but you can add as many conditions as you like:
|
||||
|
||||
Select **+ Add Condition** > **Entity** > **State**. Then under **Entity** select the device_tracker entity of your phone and under **State** select **Home**.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__device_tracker_condition.png' alt='Screenshot: Device tracker condition'>
|
||||
</p>
|
||||
|
||||
- If you want to limit the amount of notifications being sent using a cooldown time you can use the following template condition:
|
||||
|
||||
Select **Add Condition** again > **Other conditions** > **Template**. Then, under **Value template**, type the following:
|
||||
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
{{as_timestamp(now()) - as_timestamp(state_attr('automation.reolink_push', 'last_triggered'), 0) > 30}}
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
|
||||
The `automation.reolink_push` is the name of this automation, which will be set under step 7, and the `30` is the cooldown time in seconds.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__cooldown_time_condition.png' alt='Screenshot: cooldown time condition'>
|
||||
</p>
|
||||
|
||||
5. Under **Then do**, select **Add Action** > **Camera** > **Take snapshot**.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
Under **Targets**, select **Choose entity** and select the camera for which you want to add the image to the notification.
|
||||
|
||||

|
||||

|
||||
|
||||
Under **Filename**, fill in `/config/www/reolink_snapshot/last_snapshot_doorbell.jpg`. The first part `/config/www/` is absolutely necessary to allow your phone to access the saved image when it receives the notification. The reset of the folder and filename can be changed at will as long as you fill in the same filename under step 6.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__screenshot_take_snapshot.png' alt='Screenshot: take snapshot'>
|
||||
</p>
|
||||
|
||||
6. Add another action underneath by selecting **Add Action** > **Notifications** > **Send a notification via mobile_app_<phone name>**.
|
||||
|
||||

|
||||

|
||||

|
||||
|
||||
Under **message**, type the text you want to receive in the notification. For instance, “Someone rang the doorbell”.
|
||||
If you want to give the notification a title, select the **title** option. For instance, if you have multiple cameras that send you notifications, select the camera name: `Doorbell`.
|
||||
Select the **data** option and fill in `image: /local/reolink_snapshot/last_snapshot_doorbell.jpg`. Note that `/config/www/` of the filename of step 5 now needs to be changed to `/local/`. The rest of the filename needs to be the same as in step 5.
|
||||
|
||||
<p class='img'>
|
||||
<img src='/images/integrations/reolink/rich_notification__send_to_mobile.png' alt='Screenshot: send notification'>
|
||||
</p>
|
||||
|
||||
You can personalize the notification further and even control what happens if you tap the notification on your phone, [read more about this here](https://companion.home-assistant.io/docs/notifications/notifications-basic/).
|
||||
|
||||
7. Select **Save**, give your automation a name like `doorbell notification`, and select **save** again.
|
||||
|
||||

|
||||
|
||||
You are all set, ring your doorbell and see the notification on your phone. Remember the conditions under **And if** need to be met, otherwise you will not receive the notification.
|
||||
|
||||
{% enddetails %}
|
||||
|
||||
### Automation ideas
|
||||
|
||||
- Turn on (outdoor) lights near the camera to improve image clarity at night once the camera detects a person, vehicle, or animal.
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 8.7 KiB |
After Width: | Height: | Size: 34 KiB |
BIN
source/images/integrations/reolink/rich_notification__camera.png
Normal file
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 918 B |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 14 KiB |
BIN
source/images/integrations/reolink/rich_notification__entity.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 10 KiB |
After Width: | Height: | Size: 52 KiB |
After Width: | Height: | Size: 12 KiB |
After Width: | Height: | Size: 2.0 KiB |
BIN
source/images/integrations/reolink/rich_notification__save.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 3.9 KiB |
After Width: | Height: | Size: 928 B |
After Width: | Height: | Size: 9.6 KiB |
BIN
source/images/integrations/reolink/rich_notification__state.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 5.1 KiB |