Skip to content

Instantly share code, notes, and snippets.

@virnik0
Last active April 5, 2024 13:11
Show Gist options
  • Save virnik0/8c6c96175c77649482e3b22ffce05278 to your computer and use it in GitHub Desktop.
Save virnik0/8c6c96175c77649482e3b22ffce05278 to your computer and use it in GitHub Desktop.
alias: Send cam0.home.lan event snapshot to Charming & Queen
description: ""
trigger:
- platform: mqtt
topic: zoneminder/10
condition:
- condition: and
conditions:
- condition: template
value_template: "{{ \"person\" in trigger.payload_json.detection.labels }}"
- condition: or
conditions:
- condition: state
entity_id: alarm_control_panel.garden_2
state: armed_away
- condition: state
entity_id: alarm_control_panel.garden_2
state: triggered
- condition: state
entity_id: alarm_control_panel.garden_2
state: armed_night
action:
- service: notify.mobile_app_charming
data_template:
message: A {{ trigger.payload_json.detection.labels[0] }} detected at front gate!
data:
ttl: 0
priority: high
importance: high
channel: alarm_stream
push: null
sound:
name: default
critical: 1
volume: 1
image: >-
https://cctv.********************.cz/index.php?view=image&eid={{
trigger.payload_json.eventid
}}&fid=objdetect&username=monitor&password=*************************
tag: "{{trigger.payload_json.eventid}}"
- service: notify.mobile_app_queen
data_template:
message: A {{ trigger.payload_json.detection.labels[0] }} detected at front gate!
data:
ttl: 0
priority: high
importance: high
channel: alarm_stream
push: null
sound:
name: default
critical: 1
volume: 1
image: >-
https://cctv.********************.cz/index.php?view=image&eid={{
trigger.payload_json.eventid
}}&fid=objdetect&username=monitor&password=********************
tag: "{{trigger.payload_json.eventid}}"
- service: persistent_notification.create
data:
title: A {{ trigger.payload_json.detection.labels[0] }} detected at front gate!
message: >-
A {{ trigger.payload_json.detection.labels[0] }} detected at front gate!
[link to event](https://cctv.********************.cz/index.php?view=event&eid={{
trigger.payload_json.eventid
}}&fid=objdetect&username=monitor&password=***********************)![image](https://cctv.************.cz/index.php?view=image&eid={{
trigger.payload_json.eventid
}}&fid=objdetect&username=monitor&password=***************)
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment