Echo Devices (Alexa) as Media Player - Testers Needed

@Corey_Maxim

You can if you modify your automobile base OS or tap in to the base OS autonomously from the base stuff. Not sure though if the API is out there but you can reverse engineer the my chevy app if you want.

Here can remote control two vehicles (not drive them though) - BMWs. It was just a computer tapping in to the bus and ODBII. I can start, open windows turn on lights and do all sorts of stuff. It was very low on the WAF when I took apart a new SUV.

Mostly though just sync the music in the cars to the home. It was just reverse engineering here sniffing the bus (network) and mimicking the commands.

I wish I could do that, unfortunately I’m not that smart lol. I hope eventually others that own a Chevy feel the need to get this working in HA and share their code. It would be sweet! I would even be happy if the MyChevy app just added Siri Shortcuts

Have you tried Apple CarPlay?

Are you on the pre-buy list to purchase the Echo Auto?

Using Home Assistant you can built a Home Assistant WiFi device (switch) and connect that to a modded (soldering wires) FOB for remote starting.

I am doing this today with a modded WiFi device for the garage door opener with open, closed, button and temperature sensors. You can maybe even install one of these inside of your automobile…not sure on the power draw.

Then with this you can tell your Alexa to start your car and tell you the temperature of the inside of your car.

That’s a interesting idea, let me know how your works out! Good luck!

Anyone else seeing this
“Error call service, home assistant api error. Error Message: Service not found.”
just started today. happens anytime i try to send tts message . Error is coming from node red debug window.
Not seeing anything in home assistant logs.

As you seem to have a problem between Node Red and HA, I doubt your problem has anything to do with this Alexa component. Especially in light of your other post here:

Oh sorry, didn’t realize i double posted here.duh
And the only node in node red that i am having trouble with is the alexa tts service and it has worked flawlessly for a long time, so i thought maybe it was related.

Update:
FYI incase anyone else has this problem.
It seems the updated node red hassio component that @frenck put out this morning to fix the big-timer issue some how broke my node red alexa tts call service node only’s ability to communicate with the hassio api. All other call service nodes worked fine.
I run a virtual machine so i rolled back to a checkpoint before the update and removed the big-timer nodes then reentered the captcha and all is working again.
This may be limited to me and my system or it may not, i do not know but wanted to post here incase someone else is having the same issue.
To confirm i reloaded another checkpoint that i did right after the update that fixed the bigtimer issue and the communication error was back.
I am sure this is probably not the right place for this but maybe someone better versed at the forums can place it where it goes if so. Thanks for all the help that everyone offers.

@Corey_Maxim stupid question but how did you get the following;

  - binary_sensor.cameron_home
  - binary_sensor.corey_home
  - binary_sensor.courtney_home
  - binary_sensor.mom_home
  - binary_sensor.morgan_home
  - binary_sensor.wendy_home
  - binary_sensor.andy_home
  - binary_sensor.jasmine_home
  - binary_sensor.brandon_home

I only seem to see binary_sensor.people_home in my entities

@caple in your automation under the mplayer: variable can you put a number of devices ?

such as …

mplayer: “media_player.charlotte_s_bedroom,media_player.dressing_room,media_player.hot_tub,media_player.katie_s_bedroom,media_player.kitchen,media_player.master_bedroom,media_player.office”

Thanks in advance

@caple found this in an answer to a previous question, however I am getting an error in the logs;

Invalid config for [script]: expected a dictionary for dictionary value @ data[‘script’][‘audio_notify’][‘sequence’][0][‘data_template’]. Got None
extra keys not allowed @ data[‘script’][‘audio_notify’][‘sequence’][0][‘message’]. Got ‘{{ tts_msg }}’
not a valid value for dictionary value @ data[‘script’][‘audio_notify’][‘sequence’][0][‘entity_id’]. Got ‘{% if (mplayer == “all”) %}\n media_player.charlotte_s_bedroom,media_player.dressing_room,media_player.hot_tub,media_player.katie_s_bedroom,media_player.kitchen,media_player.master_bedroom,media_player.office\n{% elif (mplayer == “downstairs_media_players”) %}\n media_player.kitchen,media_player.office\n{% else %}\n media_player.{{ mplayer }}\n{% endif %} \n’. (See /config/configuration.yaml, line 700). Please check the docs at https://home-assistant.io/components/script/

That make any sense to you ?

I made a input_boolean for each person in my home, then sent that into HomeKit.

Then used my Apple home app to turn the switches on and off if that person comes home or leaves.

Then I made binary sensors based on those input_booleans to trigger it. This allows my HomeKit to “talk” to Home Assistant
It works very well.

Lastly, there are no stupid questions! I’m happy to help anywhere that I can!

3 Likes

what is the best way to install on hass.io installed with docker on raspbeian streck lite (rpi3b+)
Please guide
thanks

Looks like we need to move to the embedded platform…the component is broken in 0.88.

1 Like

Same here…updated HA this morning and broke it.
Downgraded to 87.1 anyhow and…

It is running in Docker so redid everything.

1 - docker exec -it home-assistant /bin/bash
2 - /usr/src/app# pip3 install --force git+https://gitlab.com/alandtse/alexapy.git

It is working fine now.

@ kirpat

For version 1.0 or greater just run the docker exec as above do the pip3 install and copy over the two alexa python files as described in the wiki.

You may need update some stuff in docker and the pip3 install will error out if you need to add or update anything.

I am the one that added the last_alexa attribute… and I share your concern about hiring the undocumented API too often. Honestly, that and the fact the I can’t get it to work reliably right now are reasons I haven’t been trumpeting it’s inclusion yet.

Alan is working on splitting the different functionality into separate components. I hope to get some time soon to try it out, because I’d like to refactor the last_alexa attribute into a stand-alone sensor. As it works currently it has to hit the API for each Echo in your house to check for an ID match. I would like to figure out a way to cache the list of devices locally somehow so the sensor can speedily compare and locate the right device.

1 Like

things like last alexa and tts, but also things like triggering routines and weather and traffic should all be in a seperate component.
it could all be in the package mediaplayer, but it should be available without the mediaplayer also.

when it wants to be an official component it should be like all other components.
TTS belongs in the TTS components
mediaplayer in the mediaplayer components
last_alexa in the sensor components
starting things like routines should be provided as service only.

it all can be on the alexa platform though, but not 1 component.
and they all should be available for every device seperately.

i know that that means a lot of work and splitting up things, but thats the way HA is setup.
and then the amount of traffic can be brought down to a minimum, because there are a lot of people that never need to setup a mediaplayer for every device (but now they need to when they want TTS available)

with new beta version version=0.88.0b0
alexa media player broke down

Error loading custom_components.media_player.alexa. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/loader.py", line 147, in _load_file
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/config/custom_components/media_player/alexa.py", line 16, in <module>
    from homeassistant.components.media_player import (
ImportError: cannot import name 'MEDIA_TYPE_MUSIC' from 'homeassistant.components.media_player' (/usr/local/lib/python3.7/site-packages/homeassistant/components/media_player/__init__.py)

FYI, I already refactored it so it it’s message passing based and only done on the main polling (which has been reduced and rate_limited). All devices will update their state when this message is generated.

2 Likes

Got this installed and the media portion works flawlessly, but when I attempt to send text through the entity on the HA page I get these errors in the log.

Traceback (most recent call last):
File “/home/zrikz/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py”, line 291, in _handle_service_platform_call
await func(entity, data)
File “/usr/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/zrikz/.homeassistant/custom_components/media_player/alexa.py”, line 619, in play_media
self.alexa_api.send_tts("Sorry, text to speech can only be called "
File “/home/zrikz/.homeassistant/custom_components/media_player/alexa.py”, line 1052, in send_tts
“", "textToSpeak": "” + message + “"}}}”,
AttributeError: ‘AlexaAPI’ object has no attribute ‘_device_owner_customer_id’