Last active
January 20, 2026 20:27
-
-
Save geekingreen/08fc17ea6235b23ee7642452f09a9313 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| blueprint: | |
| name: Reolink Rich Notifications | |
| description: > | |
| Send Reolink rich notifications to an Android device. | |
| domain: automation | |
| input: | |
| notify_device: | |
| name: Devices to Notify | |
| description: These mobile devices will receive a notification when alerts are triggered. | |
| default: [] | |
| selector: | |
| device: | |
| integration: mobile_app | |
| multiple: true | |
| trigger_entities: | |
| name: Trigger Sensors | |
| description: These Reolink sensors will be monitored to determine when to send an alert. | |
| selector: | |
| entity: | |
| multiple: true | |
| filter: | |
| - integration: reolink | |
| domain: binary_sensor | |
| main_action: | |
| name: Main Action URI (Optional) | |
| description: What should happend when you click notification, leave empty to open Home Assistant | |
| default: '' | |
| retrigger_delay: | |
| name: Retrigger Delay | |
| description: Time to wait before triggering the same camera again. | |
| default: | |
| hours: 0 | |
| minutes: 0 | |
| seconds: 20 | |
| selector: | |
| duration: | |
| mode: parallel | |
| max: 100 | |
| variables: | |
| notify_device: !input notify_device | |
| trigger_entities: !input trigger_entities | |
| main_action: !input main_action | |
| retrigger_delay: !input retrigger_delay | |
| trigger: | |
| platform: state | |
| entity_id: !input trigger_entities | |
| from: "off" | |
| to: "on" | |
| action: | |
| - variables: | |
| camera_entities: "{{ device_entities(device_id(trigger.entity_id)) | select('match', '^camera\\.') | list }}" | |
| camera_to_snapshot: > | |
| {{ | |
| (camera_entities | select('match', '.*_snapshots_fluent$') | first) or | |
| (camera_entities | select('match', '.*_snapshots_clear$') | first) or | |
| (camera_entities | select('match', '.*_fluent$') | first) or | |
| (camera_entities | first) | |
| }} | |
| image_file: "reolink_rich_notifications/{{ camera_to_snapshot }}.jpg" | |
| should_skip_notification: > | |
| {% | |
| set other_sensor_times = | |
| trigger_entities | | |
| select('ne', trigger.entity_id) | | |
| select('is_device_attr', 'id', device_id(trigger.entity_id)) | | |
| expand | | |
| map(attribute = 'last_updated') | | |
| list | |
| + [trigger.from_state.last_updated] | |
| %} | |
| {{ trigger.to_state.last_updated - other_sensor_times|max < timedelta(**retrigger_delay) }} | |
| - if: | |
| - condition: template | |
| value_template: "{{ should_skip_notification }}" | |
| then: | |
| - stop: "Skipping notification for being too soon." | |
| # Send notification without image first. | |
| - repeat: | |
| for_each: "{{ notify_device }}" | |
| sequence: | |
| - service: "notify.mobile_app_{{ device_attr(repeat.item, 'name') | slugify }}" | |
| data: | |
| title: "{{ trigger.from_state.attributes.friendly_name }}" | |
| message: "" | |
| data: | |
| tag: "{{ trigger.to_state.context.id }}" | |
| ttl: 0 | |
| priority: high | |
| url: '{{ main_action | default (none) }}' | |
| clickAction: '{{ main_action | default (none) }}' | |
| # Create camera snapshot | |
| - service: camera.snapshot | |
| data_template: | |
| entity_id: "{{ camera_to_snapshot }}" | |
| filename: "/media/local/{{ image_file }}" | |
| # Re-send notification with image data. | |
| - repeat: | |
| for_each: "{{ notify_device }}" | |
| sequence: | |
| - service: "notify.mobile_app_{{ device_attr(repeat.item, 'name') | slugify }}" | |
| data: | |
| title: "{{ trigger.from_state.attributes.friendly_name }}" | |
| message: "" | |
| data: | |
| tag: "{{ trigger.to_state.context.id }}" | |
| image: "/media/local/{{ image_file }}" | |
| ttl: 0 | |
| priority: high | |
| url: '{{ main_action | default (none) }}' | |
| clickAction: '{{ main_action | default (none) }}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment