Tts.google_translate_say configuration error

Hi all,

I’m just playing around with what I could do with google automation… I tried to set up a weekday event for Google to speak aloud at me in the morning… But it’s not working out.

The Automation:

- id: '1599993657128'
  alias: Wake up for work
  description: ''
  trigger:
  - at: 06:50:00
    platform: time
  condition:
  - after: 06:50:00
    condition: time
    weekday:
    - mon
    - tue
    - wed
    - thu
    - fri
  action:
  - data: {}
    entity_id: switch.sonoff_bedroom_light
    service: switch.turn_on
  - data:
      message: 'Wake Up!'
    service: tts.google_translate_say
    entity_id: media_player.house_speaker
  mode: single

I can see the bedroom light comes on fine but I then at the google_translate step it fails with 2 errors in the log:

Log Details (ERROR)

Logger: homeassistant.components.automation.wake_up_for_work
Source: helpers/script.py:906
Integration: Automation (documentation, issues)
First occurred: 6:50:00 (8 occurrences)
Last logged: 13:39:03

  • Wake up for work: Error executing script. Invalid data for call_service at pos 1: required key not provided @ data[‘entity_id’]
  • Wake up for work: Error executing script. Invalid data for call_service at pos 2: string value is None for dictionary value @ data[‘message’]
  • Wake up for work: Error executing script. Invalid data for call_service at pos 2: required key not provided @ data[‘entity_id’]

Logger: homeassistant.components.automation.wake_up_for_work
Source: core.py:1262
Integration: Automation (documentation, issues)
First occurred: 6:50:00 (7 occurrences)
Last logged: 13:35:34

While executing automation automation.wake_up_for_work

Traceback (most recent call last): File “/usr/src/homeassistant/homeassistant/components/automation/init.py”, line 430, in async_trigger await self.action_script.async_run(variables, trigger_context) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 802, in async_run await asyncio.shield(run.async_run()) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 183, in async_run await self._async_step(log_exceptions=False) File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 191, in _async_step await getattr( File “/usr/src/homeassistant/homeassistant/helpers/script.py”, line 380, in _async_call_service_step await service_task File “/usr/src/homeassistant/homeassistant/core.py”, line 1262, in async_call processed_data = handler.schema(service_data) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 272, in call return self._compiled(, data) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 594, in validate_dict return base_validate(path, iteritems(data), out) File “/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py”, line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: required key not provided @ data[‘entity_id’]

Any ideas what’s going on?

I’ve just tried a variant of the config cos i saw someone else had done similar, but still getting the same errors:

- id: '1600055429428'
  alias: Another Test
  description: ''
  trigger:
  - at: 06:30:00
    platform: time
  condition: []
  action:
  - service: tts.google_translate_say
    data:
      entity_id: media_player.house_speaker
      message: Wake Up.
  - service: automation.turn_off
  mode: single

Error executing script. Invalid data for call_service at pos 1: required key not provided @ data[‘entity_id’]

Error 1

not sure why this error is happening for you, but you’d just need to put entity_id in data. Typically that’s not needed but you have a empty data field there and it could be causing problems:

  - entity_id: switch.sonoff_bedroom_light
    service: switch.turn_on

Error 2 & 3

Same as above. Not sure why you’re getting either of these errors because you code contradicts the errors.

I’d be willing to bet you have/had spacing issues in your automation, because these should work. Worse case, you might have to move entity_id inside data. That’s had issues in the past.

  - data:
      entity_id: media_player.house_speaker
      message: 'Wake Up!'
    service: tts.google_translate_say

Error 4 (new automation)

That’s telling you that you didn’t provide an entity_id for a service. Remove the -service: automation.turn_off or add the entity_id to that service.