I am receiving an error when trying to use the html5 push notifications with actions, I know the notifications work themselves, this was the first iteration of my experimentation and it worked fine. Now I am trying to add an action. The error is odd because the doco says you can add extra keys which will be returned in the call back and actions is a valid key. Any ideas to what I am doing wrong here?
config:
- alias: 'html notification test'
trigger:
- platform: state
entity_id: input_boolean.html5_notification_test
action:
- service: notify.html5_push
data:
title: test
message: >
html5 notification test string
target:
- phone_browser
- laptop_browser
actions:
- action: open
icon: "/local/asdf.jpg"
title: Open Home Assistant
- action: open_door
title: Open door
log:
2019-01-18 12:15:17 ERROR (MainThread) [homeassistant.components.automation] Error while executing automation automation.html_notification_test. Invalid data for call_service at pos 1: extra keys not allowed @ data['actions']
doco: https://www.home-assistant.io/components/notify.html5#actions
I was advised on Discord that “title, message, and target need to be outside of data”
that is not it either
- alias: 'html notification test'
trigger:
- platform: state
entity_id: input_boolean.html5_notification_test
action:
- data:
actions:
- action: open
icon: "/local/asdf.jpg"
title: Open Home Assistant
- action: open_door
title: Open door
message: >
html5 notification test string
service: notify.html5_push
target:
- phone_browser
- laptop_browser
title: test
- alias: HTML5 push notification action button clicked
trigger:
- platform: event
event_type: html5_notification.clicked
event_data:
action: open_door
action:
- service: systemlog.write
data_template:
message: "clicked html5 push notification button test"
fails linting
- Invalid config for [automation]: [message] is an invalid option for [automation].
I have also tried
- alias: 'html notification test'
trigger:
- platform: state
entity_id: input_boolean.html5_notification_test
action:
- data:
message: >
html5 notification test string
target:
- jurgen_phone_browser
- jurgen_laptop_browser
title: test
data:
actions:
- action: open
icon: "/local/jurgen.jpg"
title: Open Home Assistant
- action: open_door
title: Open door
service: notify.html5_push
but there are no actions, the messages/target/title works.
edit: I am wrong, maybe it caches or something? Not sure… But now this final configuration works. I have my actions and a clickable event.