I have a Node-Red action running that creates a Notification based of a template
like so:
{
"data": {
"title": "Tuin beregening",
"message": "{{^payload.sprinkle}}Wordt vandaag niet gedaan omdat {{payload.whyNo}}{{/payload.sprinkle}}{{#payload.sprinkle}}Gaat over 15 minuten beginnen{{/payload.sprinkle}}",
"data": {
"tag": "notification-about-sprinklers",
"actions": [
{{#payload.sprinkle}}
{
"action": "sprinklers_action_cancel",
"title": "Annuleren"
}
{{/payload.sprinkle}}
]
}
}
}
When triggering this manually, I receive the notification on my phone just fine.
Following some of the guidance of the internet I have an automation in home-assistant like so:
- id: '1589916447959'
alias: Testing notification cancelled
description: ''
trigger:
- event_data:
action: sprinklers_action_cancel
event_type: html5_notification.clicked
platform: event
condition: []
action:
- data:
message: ok, dan niet.
service: notify.mobile_app_samsung_s10
When triggering this manually, I receive the notification on my phone just fine aswell.
En yet, when I press the button on the notification, I get nothing.
I am running home assistant in a docker container: homeassistant/home-assistant:stable
And on another server I have a letsencrypt docker image as reverse proxy:
letsencrypt:
container_name: letsencrypt
image: linuxserver/letsencrypt
restart: unless-stopped
ports:
- 443:443
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Amsterdam
- URL=[URL]
- SUBDOMAINS=wildcard,
- VALIDATION=duckdns
- DUCKDNSTOKEN=[TOKEN]
volumes:
- nginx-data:/config
cap_add:
- NET_ADMIN
Just to be sure I added the following Nginx config:
location /api/notify.html5/callback {
if ($http_authorization = "") { return 403; }
allow all;
proxy_pass http://10.0.0.214:8123;
proxy_set_header Host $host;
proxy_set_header Authorization $http_authorization;
proxy_redirect http:// https://;
proxy_pass_header Authorization;
}
Manually firing an event from
Developer Tools > Events > Event Type: html5_notification.clicked
Without any event data triggers the automation just fine, which I find strange as I expected that the automation would filter on the sprinklers_action_cancel
. But at least it’s something and the automation appears to be working.
Does anyone have any ideas? Thanks!