Can anybody give me an example which combines alert with tts. Is it possible? Or can alert be only used with notification services?
You can add a second service to the automation to call a script or play a message:
automation:
- alias: FanOn
trigger:
platform: numeric_state
entity_id: sensor.furnace
above: 2
action:
service: notify.mypushbullet
data_template:
title: "Furnace fan is running"
message: "Fan running because current is {{ states.sensor.furnace.state }} amps"
service: script.turn_on
entity_ip: script.sonos_tts
data:
variables:
where: 'living_room'
whar: "Fan running because current is {{ states.sensor.furnace.state }} amps"
That will call out the automation everytime the value is above 2. So TTS will speak out every sensor update.
So you will have to introduce an input boolean which will go off. And if you put it up - than there is no more need in alert component as it’s just easier to add notification service in the rule…
Something like
- alias: Kids Notify Humidity
trigger:
platform: numeric_state
entity_id: sensor.humidity_158d00017140xx
below: 30
condition:
- condition: state
entity_id: input_boolean.notify_kids_humidity
state: 'off'
- condition: state
entity_id: input_boolean.rules_away
state: 'off'
- condition: state
entity_id: input_boolean.rules_sleeping
state: 'off'
action:
- service: mqtt.publish
data:
topic: "exchange"
payload: "kidshumidity"
- service: notify.telegram
data_template:
message: "Low Humidity {{ trigger.to_state.state }}"
- service: media_player.volume_set
data:
entity_id: media_player.vannaya
volume_level: 1.0
- service: tts.google_say
entity_id: media_player.vannaya
data:
message: " Low humidity in kids room"
- service: homeassistant.turn_on
entity_id: input_boolean.notify_kids_humidity
- alias: Kids Notify Humidity reset
trigger:
platform: state
entity_id: input_boolean.notify_kids_humidity
to: "On"
for:
hours: 2
minutes: 0
seconds: 0
action:
service: homeassistant.turn_off
entity_id:
- input_boolean.notify_kids_humidity