the error: extra keys not allowed @ data['icon_url'] extra keys not allowed @ data['attachment']
My code:
alias: Notify Doorbell rings
description: >-
This automation triggers when the doorbell button is pushed and sends out a
notification to our Apple iPhones
trigger:
- platform: state
entity_id:
- binary_sensor.doorbell_doorbell_button
to: "on"
condition: []
action:
- service: notify.notify_all_iphones
data:
title: Deurbel
message: Er staat iemand voor de deur.
icon_url: https://xxxxx.duckdns.org:8123/local/images/Bell-Icon.png
mode: single
leaving that image part out, it works as expected (without image of course )
thx @dshokouhi
I know the YAML is very strict and found that the GUI does some changes to the actual YAML and I did not read very well (meaning read it many times wrong / did not notice) … 2x data element…
Sorry, I’m embarrassed.
alias: Notify Doorbell rings
description: >-
This automation triggers when the doorbell button is pushed and sends out a
notification to our Apple iPhones
trigger:
- platform: state
entity_id:
- binary_sensor.doorbell_doorbell_button
to: 'on'
condition: []
action:
- service: notify.notify_all_iphones
data:
title: Deurbel
message: Er staat iemand voor de deur.
data:
icon_url: /local/images/Bell-Icon.jpg
mode: single
The code now does not error anymore and I get the message on the phone, though without icon.
I checked the local path (tested it on the front end) and is oke / showing as well, same for the full URL. Both showing the correct icon.
thx @dshokouhi
I’m sure I had this working (somehow) in the past…
Solved it like this (past an emoij directly in the text)
alias: Notify Doorbell rings
description: >-
This automation triggers when the doorbell button is pushed and sends out a
notification to our Apple iPhones
trigger:
- platform: state
entity_id:
- binary_sensor.doorbell_doorbell_button
to: "on"
condition: []
action:
- service: notify.notify_all_iphones
data:
title: Deurbel 🔔
message: Er staat iemand voor de deur.
mode: single