Extra key not allowed on notify action

Hi,

I get this error in the log :

Logger: homeassistant.components.automation.sensor_garagedeur_stuurt_notificatie
Source: components/automation/__init__.py:738
integration: Automation (documentation, issues)
First occurred: 18:39:32 (1 occurrences)
Last logged: 18:39:32

Error while executing automation automation.sensor_garagedeur_stuurt_notificatie: extra keys not allowed @ data['ttl']

This is my code :

          - data:
              message: >-
                Bezoek aan de garagedeur om {{ now().strftime("%d/%-m/%-Y om
                %H:%M:%S") }}
              data:
                ttl: 0
                priority: high
                channel: alarm_stream
                clickAction: /lovelace-mushroom/security-garagedoor
                image: /local/tmp/snapshot-garagedeur.jpg
                entity_id: camera.camera_garagedeur_substream
                actions:
                  - action: URI
                    title: Camera's
                    uri: /lovelace-mushroom/security
                  - action: NOTI_UIT15
                    title: 15 min uit
                  - action: NOTI_UIT
                    title: Uitschakelen
            action: notify.notification_devices

If I delete the “ttl = 0” I get an error in the log for the “priority: high”.

I just want to get the notification immediately on my android phone…what should I mention ?

Have you edited the action to “notify.notification_devices” for the forum? I would expect it to look like “notify.mobile_app_<your_device_id_here>”. If that’s what you’ve actually got, I’m guessing it’s a notify group rather than an Android companion app action. This is probably the problem - try putting just your phone’s notify action in there.

I think your YAML structure needs tweaking. For example, I believe the ttl and priority options need their own data: key. It can get complex with all these nested data: keys. You could try this, which mirrors a pattern that works for me::

- data:
    message: >-
      Bezoek aan de garagedeur om {{ now().strftime("%d/%-m/%-Y om
                %H:%M:%S") }}
    data:
      data:
        ttl: 0
        priority: high
      channel: alarm_stream
      clickAction: /lovelace-mushroom/security-garagedoor
      image: /local/tmp/snapshot-garagedeur.jpg
      entity_id: camera.camera_garagedeur_substream
      actions: ...

I’ve never used the channel option, so don’t know if that needs to move as well. I’ve also no experience of the clickAction and entity_id options, so you might need to experiment a bit.

This is a notification group? Does it have an iphone in the list? click_action, ttl, and priority are android specific keys and cannot be used in a text to an iphone.

Yes, changed it

Changed it that way

I don’t know if both were needed, but it works and no errors in de log.

Thank you !

1 Like