Nick4
(Nick)
December 21, 2021, 7:10pm
1
I managed to get notifications + actions + camera on iOS.
On Android, I don’t get the camera and can’t find the reason.
This is my automation:
service: notify.mobile_app_aphone
data:
title: Doorbell
message: Someone at the door!
data:
entity_id: camera.door
actions:
- action: OPEN_GATE
title: Open Gate
- action: LIGHTS_ON
title: Turn on Lights
Any help is highly appreciated.
keassol
December 21, 2021, 7:22pm
2
I do something similar when my garage door opens. You need to take a snapshot of the camera then link to it in the notification. Adjust for your situation:
- service: camera.snapshot
data:
entity_id: camera.picam_garage
filename: "/config/www/snapshots/garage_last_snapshot.jpg"
- service: notify.mobile_app_person
data:
message: "Garage Door Just Opened"
title: "HA Notification"
data:
image: "https://XXXXX.ui.nabu.casa/local/snapshots/garage_last_snapshot.jpg"
ttl: 0
priority: high
actions:
- action: "URI"
title: "View Cam"
uri: "/lovelace/garage"
1 Like
Nick4
(Nick)
December 21, 2021, 8:17pm
3
Hi @keassol , thank you for your answer, I’m giving it a try right now.
So you call a lovelace view that has this specific camera only?
keassol
December 21, 2021, 8:36pm
4
Yes, my click action on the notification “View Cam” just takes me to the Lovelace tab that has that camera entity.
keassol
December 21, 2021, 8:42pm
5
Actually, here is a better example thats closer to what you are trying to do that shows click actions that don’t just bring up a lovelace view:
- id: garage_door_open_long
alias: Garage Door Open For Long Time
trigger:
- entity_id: sensor.garage_door_currently_open
platform: state
to: Open
for:
minutes: 10
action:
- alias: "Set up variables for the actions"
variables:
action_open: "{{ 'OPEN_' ~ context.id }}"
action_close: "{{ 'CLOSE_' ~ context.id }}"
- service: tts.cloud_say
data:
entity_id: media_player.mpd
message: "Garage has been opened for a long time"
options:
gender: female
language: en-GB
- service: camera.snapshot
data:
entity_id: camera.picam_garage
filename: "/config/www/snapshots/garage_last_snapshot.jpg"
- service: notify.mobile_app_person
data:
message: "Garage Door Open for Longer Than 10 Minutes"
title: "HA Notification"
data:
image: "https://XXXXXXX.ui.nabu.casa/local/snapshots/garage_last_snapshot.jpg"
ttl: 0
priority: high
actions:
- action: "{{ action_close }}"
title: "Close Garage"
- action: "URI"
title: "View Cam"
uri: "/lovelace/garage"
- alias: "Wait for a response"
wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_close }}"
- alias: "Perform the action"
choose:
- conditions: "{{ wait.trigger.event.data.action == action_close }}"
sequence:
- service: switch.turn_off
target:
entity_id: switch.garage_opener_double
3 Likes