Solved - Help Needed

I had this working prior to an upgrade a couple weeks back. I’m on 86.1

Here is the error I get when i run Check Config,

Invalid config for [automation]: [data] is an invalid option for [automation]. Check: automation->action->0->data. (See /home/homeassistant/.homeassistant/configuration.yaml, line 114). Please check the docs at https://home-assistant.io/components/automation/
Invalid config for [automation]: expected dict for dictionary value @ data[‘action’][0][‘data’]. Got None
extra keys not allowed @ data[‘action’][0][‘volume’]. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 114). Please check the docs at https://home-assistant.io/components/automation/

Here is my automation, I’ve messed around with this so much it may not represent the original working automation. I may have added errors.

- id: '1548877511011'
  alias: Morning Greeting
  initial_state: true         #added this from a message I found here, made no difference.
  trigger:
  - entity_id: light.motion_detector
    from: 'off'
    platform: state
    to: 'on'
  condition:
  - condition: state
    entity_id: device_tracker.clay
    state: home
  - after: '8:00'
    before: '12:00'
    condition: time
  action:
  - service: media_player.volume_set
    data:
    entity_id: media_player.all_speakers
    volume: '5'
  - service: tts.google_say
    data:
    message: good morning clay,  have a great day
  - service: automation.turn_off
    data:
    entity_id: automation.morning_greeting
  - delay: '3:30'
  - service: automation.turn_on
    data:
    entity_id: automation.morning_greeting 

Thanks for help and support.
Clay

You need to indent the items under data:

  action:
  - service: media_player.volume_set
    data:
      entity_id: media_player.all_speakers
      volume: '5'
  - service: tts.google_say
    data:
      message: good morning clay,  have a great day
  - service: automation.turn_off
    data:
      entity_id: automation.morning_greeting
  - delay: '3:30'
  - service: automation.turn_on
    data:
      entity_id: automation.morning_greeting 

Actually, for service calls, entity_id does not need to be placed under data; it can be at the same level as service. So this will also work:

  action:
  - service: media_player.volume_set
    entity_id: media_player.all_speakers
    data:
      volume: '5'
  - service: tts.google_say
    data:
      message: good morning clay,  have a great day
  - service: automation.turn_off
    entity_id: automation.morning_greeting
  - delay: '3:30'
  - service: automation.turn_on
    entity_id: automation.morning_greeting 

Thanks for the reply! Well neither version passed check config, but it’s better! Here’s the remaining error:

I found this one, it was in another automation, weird thing is I didn’t change it!

Thanks for the help!!

1 Like

Can any one tell me how can I change it to say the current time !!

Do you mean like this?

  - service: tts.google_say
    data_template:
      message: "{{ now().strftime('%H:%M:%S') }}"
1 Like

Sorry my bad I should have asked more clearly.

What I mean to ask was, How can I make a script in hassio “Script Editor” to say current time.
in script editor it’s not taking “data_template”

I don’t use any of the GUI editors. But you’d do it the same way as a step in a script. (Actually, the action part of an automation is really just a script.)

1 Like