Very simple notification

Trying to make this simple notification send, triggered by time. No luck :confused:

# Notifications test
- id: '1577144865421'
  alias: Notifications
  description: ''
  trigger:
  - platform: time
    at: '21:25:00'
  condition: []
  action:
  - service: notify.notify
    message: This is a notification

What happens when you trigger the automation manually?

If it works your time/time zone may not be set correctly.

If it does not work you may not have set up your notifier correctly.

Which notifier are you using?

1 Like

This works like a charm:

image

Running it that way, I get a notification on mobile.

But this is what I get when I run the automation manually:

Tue Dec 24 2019 07:20:21 GMT-0300 (hora estƔndar de Argentina)

Error while executing automation automation.notifications. Invalid data for call_service at pos 1: required key not provided @ data[ā€˜messageā€™]

Not sure what you mean with this.

Thanks

  - service: notify.notify
    data:
      message: This is a notification
1 Like

Still no luck

# Notifications test
- id: '1577144865421'
  alias: Notifications
  description: ''
  trigger:
  - platform: time
    at: '07:50:00'
  condition: []
  action:
  - service: notify.notify
    data: 
        message: This is a notification

This is what I get in the log:

Error while executing automation automation.notifications. Invalid data for call_service at pos 1: required key not provided @ data['message']

Look how far your message: is indented compared to the example given by VDRainer.

I tried it with a exact copy of your code (with the indentation on message) and it works for me.

it probably depends on what @tom_l says above: what notifiers are configured.

notify.notify was the service that automatically sent notifications to the iOS app very 1.5. Now that we have 2.0, we use notify.mobile_app_device for that.

Most people will have deleted the iOS.conf in the config folder, so notify.notify probably wonā€™t work without specifying a notifier of that nameā€¦

do you still have the ios.conf? or have a notifier configured?

notify.notify probably wonā€™t work

Thatā€™s what I thought. Except he reckons this works:

image

ya, which would point to a previous and leftover ios.conf? just maybe, must admit I am not 100% positive, since this is a bit in the haze really.

It works in my setup also, but Ive have tinkered a lot with the .storage files and the iOS.conf itself :wink:

but, going forward, I would think it to be best to focus on mobile_app service, and configure specific notification notifiers (like groups) for grouped messages.

So, I left only this automation in /config/automations.yaml and made sure every indent was a space, not a tab (not sure if that matters, but just in case).

- id: '1577144865421'
  alias: Notifications
  description: ''
  trigger:
  - platform: time
    at: '07:50:00'
  condition: []
  action:
    service: notify.notify
    data:
      message: A message!

Restarted HA. It is working now. Will start adding the rest of the automations one by one.

If you enable ā€˜Advanced Modeā€™ in your profile you will see an automation reload option in configuration / server control , so you donā€™t have to restart when creating new or editing existing automations.

1 Like

YAML is VERY sensitive to spacing.

1 Like