LAB02-Research/HASS.Agent-Integration

Actionable notification with URL doesnt work

Opened this issue · 1 comments

I have an actionable notification setup, that when clicked should go to a URL, but it simply does not work.

service: notify.mycomputer
data:
message: "This is a test message."
data:
image: "http://192.168.0.239:5000/api/driveway_cam/latest.jpg"
actions:
- action: "URI"
title: "Open URL"
uri: "http://192.168.0.239:5000/live/webrtc/stream.html?src=camera.driveway_cam&mode=webrtc"

Github has removed the YAML Formatting but hopefully it makes sense.

HASS.agent doesn't do actionable notifications the exact same as ios and android. Instead you pass action names and action titles and then it fires an event in hass. You can then use an automation to redirect the client to the url. Something like this:

Script to run notification:
image

HASS.agent command to open url:
image

Automation to open the url:
image

A notification is sent with an action and the title of that action. When the action is clicked an event is fired in hass and the automation detects it. The automation then preses the button that activates the launchurl command in hass.agent.