Thank you for building this. I can get it to work with my Sonos speakers alone, but not with my Alexa (Echo) speakers. What I want is to run this on both Sonos and Echo speakers at the same time. Below is a sample automation to announce when the washing machine is done. I took the Chime TTS YAML for Alexa directly from the GitHub here. However, this gives me the following error message when I try to save the automation:
Message malformed: extra keys not allowed @ data['sequence']
Here is the automation that will not save:
alias: Laundry Washing Machine Notification
description: >-
Send a push notification to phones and announce on Echo and Sonos devices if
it is not between 1 and 3:30 pm on the weekend or 7:30 pm and 7:00 am any day
when washing machine current consumption is above 5 watts for 1 min 30 sec and
then falls below 5 watts for 1 min 30 sec
trigger:
- platform: numeric_state
entity_id: sensor.washing_machine_current_consumption
for:
hours: 0
minutes: 1
seconds: 30
above: 5
condition:
- condition: state
entity_id: input_boolean.kill_switch
state: "off"
- condition: state
entity_id: input_boolean.washing_machine_override
state: "off"
action:
- wait_for_trigger:
- platform: numeric_state
entity_id: sensor.washing_machine_current_consumption
for:
hours: 0
minutes: 1
seconds: 30
below: 5
- service: notify.mobile_app_michaels_iphone
data:
message: >-
Washing machine is done at {{as_timestamp
(states.sensor.washing_machine_current_consumption.last_changed) |
timestamp_custom("%-I:%M %p (%m-%d-%y)")}}
data:
clickAction: /lovelace-minimalist-2/laundry
url: /lovelace-minimalist-2/laundry
title: Laundry
- service: notify.mobile_app_ashleys_iphone
data:
message: >-
Washing machine is done at {{as_timestamp
(states.sensor.washing_machine_current_consumption.last_changed) |
timestamp_custom("%-I:%M %p (%m-%d-%y)")}}
data:
clickAction: /lovelace-minimalist-2/laundry
url: /lovelace-minimalist-2/laundry
title: Laundry
- condition: or
conditions:
- condition: not
conditions:
- condition: time
after: "13:00:00"
before: "15:30:00"
weekday:
- sun
- sat
- condition: time
after: "19:30:00"
before: "07:00:00"
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
sequence:
- service: chime_tts.say_url
response_variable: chime_tts
data:
message: The washing machine is done
tts_platform: google_translate
audio_conversion: Alexa
language: en
chime_path: custom_chime_path_1
tld: com
- service: notify.alexa_media
data:
message: <audio src="{{chime_tts.url}}"/>
target:
- media_player.michael_s_echo
data:
type: tts
mode: single
Here is just the notification portion for a Sonos speaker that does work (my goal is to have this work for both Sonos and Alexa in the same automation):
- service: chime_tts.say
target:
device_id:
- c99b88e8d7470f54d1b33ed6f2fc607f
data:
chime_path: custom_chime_path_1
end_chime_path: ""
final_delay: 0
tts_speed: 100
tts_pitch: 0
volume_level: 0.3
tts_platform: google_translate
message: The washing machine is done
And finally, here is the notify portion that was working across Sonos and Alexa before I installed Chime TTS:
- service: notify.alexa_media
data:
message: The washing machine is done
data:
type: tts
target:
- media_player.michael_s_echo
- media_player.michael_s_echo_dot
- service: tts.google_translate_say
data:
cache: false
message: The washing machine is done
entity_id: media_player.basement_bedroom