From ab7e64abd653163c476821723fc3bf52bb3e58b7 Mon Sep 17 00:00:00 2001 From: CCOSTAN Date: Fri, 10 Feb 2017 01:59:17 +0000 Subject: [PATCH] Adding in Repeat Function for TTS via MQTT. --- automation/tts_repeat.yaml | 16 ++++++++++++++++ script/voice_notify.yaml | 2 +- sensor/MQTT.yaml | 7 +++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100755 automation/tts_repeat.yaml create mode 100755 sensor/MQTT.yaml diff --git a/automation/tts_repeat.yaml b/automation/tts_repeat.yaml new file mode 100755 index 00000000..e81a17ad --- /dev/null +++ b/automation/tts_repeat.yaml @@ -0,0 +1,16 @@ +###################################################################### +## Announce when people come or go. +## Announce over all Chromecast Audios +###################################################################### +- alias: 'State Announcements' + + trigger: + - platform: state + entity_id: input_boolean.repeat_message + state: 'on' + from: 'off' + + action: + - service: script.Voice_notify + data_template: + value1: "{{ trigger.entity_id.split('.')[1]|replace('_', ' ')|replace('garadget large', 'The large garage ')|replace('garadget small', 'The small garage ') }} is {{ (trigger.to_state.state)|replace('_', ' ') }}." \ No newline at end of file diff --git a/script/voice_notify.yaml b/script/voice_notify.yaml index ef53e24c..ad76b944 100755 --- a/script/voice_notify.yaml +++ b/script/voice_notify.yaml @@ -61,7 +61,7 @@ voice_notify: - service: mqtt.publish data_template: - payload: '{{ value1 }}"' + payload: '{{ value1 }}' topic: 'polly/lastmsg' retain: true diff --git a/sensor/MQTT.yaml b/sensor/MQTT.yaml new file mode 100755 index 00000000..78bd1db0 --- /dev/null +++ b/sensor/MQTT.yaml @@ -0,0 +1,7 @@ +################################################### +## Various MQTT sensors +################################################### + +- platform: mqtt + name: "Latest Arrival" + state_topic: "polly/lastmsg" \ No newline at end of file