I managed to cobble some code together that allows me to receive an actionable notification on my Android phone if my pool robot is in trouble - and open a specific camera in TinyCam Pro.
Here’s the notification:
- action: notify.mobile_app_pixel
data:
message: "PoolBot Power was {{ trigger.id }} "
title: PoolBot Potential Issue
data:
ttl: 0
priority: high
tag: pootbot_issue_notification
actions:
- action: reset_pootbot_issue_notification
title: No Issue!
- action: URI
title: TinyCam
uri: app://com.alexvas.dvr.pro
- action: poolbot_open_3_poolcam
title: PoolCam
And this is the automation triggered by the last action:
alias: Alert Action - Open 3_PoolCam
description: ""
triggers:
- event_type: mobile_app_notification_action
event_data:
action: poolbot_open_3_poolcam
trigger: event
conditions: []
actions:
- action: notify.mobile_app_pixel
data:
message: command_activity
data:
intent_action: android.intent.action.MAIN
intent_extras: com.alexvas.dvr.intent.extra.shortcut.NAME:3_PoolCam
intent_package_name: com.alexvas.dvr.pro
mode: single
Now, I’m wondering, if it is possible to somehow move the action section from the Alert Action into the action section of the automation itself and replace the action: poolbot_open_3_poolcam in there.
I can open the TinyCam app to the last used view by using the URI action, but I’m failing to open the camera I need in order to see the pool robot.
Anybody got any idea how to achieve that for my Andoid phone?