Using Amazon Echo as a speaker?

I’d like my Amazon Echo to give me a weather report when I wake up in the morning but without me having to ask (ie I don’t want to use Alexa’s alarm or Flash Briefing)!

Is it possible to use Home Assistant to get the Echo to act as a speaker, if I can find a weather report from somewhere and set it to the the Echo.

(I have used Tasker (an adroid app) to detect when I first pick up my phone - and I want this to be the trigger)

1 Like

Have a look at this

There are a lot of posts, but bottom line is that you can trigger your flash briefing using HA using this process. I use this to do a lot of things. I have it tell me when I need to get going for work, if doors are left open, etc.

1 Like

You can use my latest ha-alexa-tts in HA.

Instead of using the "-e speak: " command, you can use one of those:
(from the script help)

-e : run command, additional SEQUENCECMDs: weather,traffic,flashbriefing,goodmorning,singasong,tellstory,speak:'<text>',automation:'<routine name>'

With Tasker you can trigger an action in HA using the webhook trigger:

Obviously you have to write the action in HA then, and use the ha-alexa-tts script.

Hope that helps.

Cheers!

1 Like

I used this component (third party) to add Alexa as a media player.

I’d wanted to get some announcements working for some time but had no luck with the various tts options. This works great and I got more Alexa devices on the strength of it. Once you have got it working you can then use any Alexa devices you have to send messages/alerts. I have quite a long winded morning announcement that I love but am not sure how the other half enjoys… :-/

An automation triggers it;

- id: 'Wake_Up'
  alias: 'Wake Up Alarm'
  trigger:
    platform: time
    at: 07:05:00
  condition:
    - condition: state
      entity_id: binary_sensor.workday_sensor
      state: 'on'
    - condition: state
      entity_id: calendar.work
      state: 'off'
  action:  
    - service: scene.turn_on
      data:
        entity_id: scene.workmorning
    - service: script.announcement_morning

and then the script pulls all the information in;

announcement_morning:
  alias: Morning
  sequence:
    - service: media_player.alexa_tts
      data_template:
        entity_id: media_player.bedroom_echo
        message: ->
          'Good morning Luke, it is {{ as_timestamp(now()) | timestamp_custom("%I %M %p") }} on {{ as_timestamp(now()) | timestamp_custom("%A") }} the {{ states("sensor.date_human") }} of {{ as_timestamp(now()) | timestamp_custom("%B") }}. You {% if states("calendar.work") == "on" or states("binary_sensor.workday_sensor") == "off" -%} are not {%- else -%} are {%- endif %} due in work today. The temperature outside feels like {{ states("sensor.dark_sky_apparent_temperature")}} degrees. Your indoor temperature is {{ state_attr("climate.heating", "current_temperature") }} degrees. The probability of rain for the hour is {{ states("sensor.dark_sky_precip_probability") }} percent. You have {{ states("sensor.annual_leave")}} days of Annual Leave remaining and your flexitime balance is {{ states("sensor.flexi_balance")}} hours. It looks like it will take you {{ states("sensor.luke_work_to_home_travel_time") }} minutes to get to work. {% set curr_date = as_timestamp(now()) | timestamp_custom("%Y-%m-%d") %}{% for state in states.calendar if state.name == "Google Family" or state.name == "Google Lift Share"  -%}{% set cal_start_date = as_timestamp(state.attributes.start_time) | timestamp_custom("%Y-%m-%d") %}{% set cal_start_time = as_timestamp(state.attributes.start_time) | timestamp_custom("%I %M %p") %}{% if cal_start_date == curr_date -%}The first item on your {{ state.name }} calendar today is {{state.attributes.message }} at {{ cal_start_time }}{%- else -%} You have nothing on your {{ state.name }} calendar today {% endif -%}{%- endfor %}'
    - delay: '00:00:40'
    #- wait_template: '{{ not is_state("media_player.bedroom_echo", "playing") }}' 
    # media player is not in playing state for tts
    - service: media_player.play_media
      data:
        entity_id: media_player.bedroom_echo
        media_content_id: 'Morning Ambient'
        media_content_type: 'AMAZON_MUSIC
2 Likes

This will not allow you to trigger flash briefings though. At least it did not the last time I used it. You can definitely do your own HA briefing as you’ve shown. Pros and cons of each

I dont have android, so I’m mostly just curious. When you “pick up your phone” is that removing it from a charger? If it is, does HA know if the device is charging or not? My iPhone does report if it’s charging, or not charging, you could use that as a trigger and it would not require tasker. Not sure how fast it is at reporting charging states though.

Thanks a lot all. A helluva lot to read up on.

I have Tasker “arm” the accelerometer at 5am to trigger off detection of movement. I don’t always charge my phone overnight so can’t use that as a trigger.

I haven’t actually tried HA before (but I have a Raspberry pi sat not doing anything, so I’m going to try it out.

What is the link to your component?

It’s not a component, it’s a wrapper I forked with few additions.
It’s here https://github.com/raidolo/ha-alexa-tts

1 Like

for some reason I can’t get past the cookie stuff :frowning:
not even with firefox
also it does not even create a alexa.login file that I can check…
stuck big time

Could you provide details for your entities?
entity_id: binary_sensor.workday_sensor
entity_id: calendar.work

Thanks!

Sure. calendar.work is just the standard Google Calendar integration with just my work leave in there, and binary_sensor.workday_sensor is just the standard HA Workday sensor.