Clicking desktop notification custom action?

Is there a way when I get a push notification to my desktop (windows 11) and click on it, that it does something specific on the computer (like opens a browser to a certain page)?
14 Replies
Amadeo
Amadeo•6mo ago
Not currently if memory serves me right, it works for the buttons you add (just like on messages on android for example) to the notification I've implemented it as part of the hass.agent v3 development, if there is interest in it I might backport it to v2
Tony Soprano
Tony SopranoOP•6mo ago
err how do i do that like in the has automation?
Amadeo
Amadeo•6mo ago
Normally I'd give you some personalized examples but I'm away from home so I'll let my PR to original HASS.Agent repo do the job 😄
Amadeo
Amadeo•6mo ago
GitHub
Feature: notification library change to Windows APP SDK / misc. imp...
This PR: Mainly: replaces UWP.Toolkit library which was used to handle Windows Notifications with Windows APP SDK. adds proper handling of notifications activated when HASS.Agent is not running e...
Amadeo
Amadeo•6mo ago
service: notify.amadeo_pc
data:
title: Test
message: This is an actionable test message.
data:
actions:
- action: "yes"
title: "Yes"
- action: "no"
title: "No"
- action: "openuri"
title: "Open URI"
uri: "https://www.cat-lovers-only.com"
inputs:
- id: testId
text: testText
title: testTitle
service: notify.amadeo_pc
data:
title: Test
message: This is an actionable test message.
data:
actions:
- action: "yes"
title: "Yes"
- action: "no"
title: "No"
- action: "openuri"
title: "Open URI"
uri: "https://www.cat-lovers-only.com"
inputs:
- id: testId
text: testText
title: testTitle
Tony Soprano
Tony SopranoOP•6mo ago
Sadly, this shows the button but it doesn't do anything when you click on it.
Amadeo
Amadeo•6mo ago
Which version of hass agent are you using? Does the test notification show properly?
Tony Soprano
Tony SopranoOP•6mo ago
is this wrong?
No description
Tony Soprano
Tony SopranoOP•6mo ago
only one appears in my system tray, says version 2.1.0-beta2 yes. the notification i made does show up, complete with the clickable button element, but clicking the button looks like it clicks the entire notification element and not the button element and then it just goes away after a moment. same with the test notification.
Amadeo
Amadeo•6mo ago
beta2 should be ok, can I see the yaml for notification?
DrR0x
DrR0x•6mo ago
Just for reference this docs page does have a "dumber" guide, as in, non programmer speak guide with screenshots for both UI and yaml. https://www.hass-agent.io/latest/getting-started/notifications/#create-a-new-scriptautomation
Sending Notifications - Hass Agent Documentation
Access your homeassistant from any windows machine - send notifications, collect data and automate repetitive tasks
Tony Soprano
Tony SopranoOP•5mo ago
alias: Frigate Desktop Notification On Person Detection
description: ""
trigger:
- platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: "{{ trigger.payload_json['after']['label'] == 'person' }}"
action:
- service: notify.justidesktop
metadata: {}
data:
message: Person Detected
data:
image: /api/camera_proxy/camera.lorexrelay
duration: 3
actions:
- action: openuri
title: Live Feed
uri: https://hasdns.duckdns.org:8123/lovelace/cctv
enabled: true
mode: single
alias: Frigate Desktop Notification On Person Detection
description: ""
trigger:
- platform: mqtt
topic: frigate/events
condition:
- condition: template
value_template: "{{ trigger.payload_json['after']['label'] == 'person' }}"
action:
- service: notify.justidesktop
metadata: {}
data:
message: Person Detected
data:
image: /api/camera_proxy/camera.lorexrelay
duration: 3
actions:
- action: openuri
title: Live Feed
uri: https://hasdns.duckdns.org:8123/lovelace/cctv
enabled: true
mode: single
Tony Soprano
Tony SopranoOP•5mo ago
am i supposed to have this third option enabled?
No description
Tony Soprano
Tony SopranoOP•5mo ago
resolved after i checked those boxes. 🙂
Want results from more Discord servers?
Add your server