Echo Devices (Alexa) as Media Player - Testers Needed

Sorry if i am posting here the wrong way… Still very new at this home assistant and this forum…

How should i format my code correctly ?

I changed the target and the entity_id: to my echo dot 's name , as like i can see in home assistant , but no succes…
she only seems to react to set the volume , nothing else she does , the code from the link doesnt work neither , i see the script , i start it , but nothing happends

{
“entity_id”: “media_player.ginosechodot”,
“message”: “Test message”
}
if i start this json with the media_player.alexa_tts she speaks… so i guess she is connected the wright way or not ?

Thu Mar 21 2019 18:27:21 GMT+0100 (Midden-Europese standaardtijd)
Error executing service <ServiceCall script.alexa_test_announce (c:fbb5d03b69af427e8d75c3c237d9bf17)>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1147, in _safe_execute
await self._execute_service(handler, service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1160, in _execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/script/init.py”, line 116, in service_handler
context=service.context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/script/init.py”, line 174, in async_turn_on
kwargs.get(ATTR_VARIABLES), context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 131, in async_run
await self._handle_action(action, variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 210, in _handle_action
action, variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 299, in _async_call_service
context=context
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 88, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1115, in async_call
raise ServiceNotFound(domain, service) from None
homeassistant.exceptions.ServiceNotFound: (ServiceNotFound(…), ‘Service notify.alexa_media not found’)

this is the log

Nodered config if anyone is interested
echo%20show

2 Likes

The main purpose to do this alexa tts is to start my routines made in Alexa app.
But i am getting nowhere with this… Notify isnt working , start routines isnt working , need help please… I am realy a newbee at this…

Thx for this… I can believe its maybe frustrating for you guys with beginners like me… But hey , ive got to start somewhere… Any idea why i am not able to do wath i want with the alexa media player?

alexa_test_routine:
  sequence:
    - service: media_player.play_media
      data_template:
        entity_id: media_player.ginosechodot
        media_content_id: "dining light on"
        media_content_type: "routine"

This is my routine , its not working…

dash_button_test:
  alias: Dash Button Test
  sequence:
  - service: media_player.volume_set
    data:
      entity_id: media_player.ginosechodot
      volume_level: 0.8
  - delay: '00:00:02'
  - service: notify.alexa_media
    data_template:
      entity_id: media_player.ginosechodot
      message: "Hi Fifke,,, how is your programming going?"
      data_template:
        type: tts

this is a button test ive got here in the forum , it works till the volume is set , and then it stops

The second data_template is wrong

Should only be data

tried it before with only data , but its not working… i can see my echo as media player , did the complete installation again , filled in the captcha , i can set the volume , ican start the tts service and make her say something , i know its connected but still… its not working… just a question , the extra files in the topic , named .gitignore , .gitmodules and license , should these be copy and paste also somewhere in the directory?

try this, execute the script and tell us what happens:

dash_button_test:
  alias: Dash Button Test
  sequence:
    - service: notify.alexa_media
      data:
        entity_id: media_player.ginosechodot
        message: "Hi Fifke,,, how is your programming going?"
        data:
          type: tts

no, you don’t need those files. only the ones in the alexa_media folder.

thats what ive got , i tried the script…
not working , log :slight_smile:Thu Mar 21 2019 22:31:03 GMT+0100 (Midden-Europese standaardtijd)
Error executing service <ServiceCall script.dash_button_test (c:7a6a71d0b7434c8fb34b36c0aad0d449)>
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1147, in _safe_execute
await self._execute_service(handler, service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1160, in _execute_service
await handler.func(service_call)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/script/init.py”, line 116, in service_handler
context=service.context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/components/script/init.py”, line 174, in async_turn_on
kwargs.get(ATTR_VARIABLES), context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 131, in async_run
await self._handle_action(action, variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 210, in _handle_action
action, variables, context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/script.py”, line 299, in _async_call_service
context=context
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/service.py”, line 88, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context)
File “/usr/local/lib/python3.7/site-packages/homeassistant/core.py”, line 1115, in async_call
raise ServiceNotFound(domain, service) from None
homeassistant.exceptions.ServiceNotFound: (ServiceNotFound(…), ‘Service notify.alexa_media not found’)

can you take a screen shot of your directory structure of the folder where the alexa_media component is located.

also, how did you install the files into that location? did you copy the raw files, clone the repo and copy those files directly into the directory or put them there in some other way?

This is my directory , i copied the raw files and pasted them directly in the directory alexa_media i created…

This was in my log from last night…

Log Details (ERROR)
Fri Mar 22 2019 03:35:08 GMT+0100 (Midden-Europese standaardtijd)
Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py”, line 344, in _async_add_entity
raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: media_player.ginosechodot. Platform alexa_media does not generate unique IDs

@Fifke

try this:

alexa_test_tts:
  sequence:
    - service: media_player.volume_set
      data:
        entity_id: media_player.ginosechodot
        volume_level: 0.8
    - delay: '00:00:01'
    - service: notify.alexa_media
      data:
        target: media_player.ginosechodot
        message: "Test"
        data:
          type: tts

Please confirm you enabled the notify component in your configuration.yaml.

If enabled, something is not loading correctly. Are you on version 1.2.3? Check the __init__.py file.

For further debugging, we’ll need logs for custom_components.alexa_media to determine what’s happening. Please also format your logs like your code so it’s easier to read.

Will check that tonight. I will format my logs correctly next time , sorry for this , didnt knew i had to do it for my logs also , still duscovering this forum and home assistant. Thx for the help.