I have my HA announcing everything using TTS. I have too many automations using this feature and when it I am sleeping, it wakes me up. Instead of disabling the automations (which are a lot), is there another way to mute the announcements, while the automations are still working?
Also, will I need to configure every single automation, or can this be done easier?
You could fill an input text and listen on a change by just one automation. As a condition you can use time or a boolean sensor. I know you have to edit all your existing automations, but this way, you have one central input for your TTS.
I use this solution to avoid bloating my Node-Red flows.
I am trying to avoid the editing of all automations, but I will do it if there is no other solution.
If you dont mind can you give a configuration example? This thing sounds really smart!
If I am not mistaken, you have one input_text and when executed it speaks the TTS.
So, when you create an automation, you just have it filling that input_text and execute it, right?
Oh my! pretty nice and clean! And I can just disable the central input when I am going to sleep. That way the other automations will keep working, but will be muted!
you would have to edit all of them for this, but it would be future proof.
setup NodeRed and use that to do the TTS, so you make a call to it in the automation and it then continues on with doing the rest of the automation, while NodeRed can run extra processing i.e. if it’s between 22:00 and 07:00 and the lights are all off then don’t alert me via TTS
Now i have not used NodeRed, but am planning on doing it at some point…
Here you go:
Something happened:
- id: washmachine_is_ready
alias: Clothes are clean
trigger:
platform: state
entity_id: binary_sensor.dectwash_history_active
to: 'off'
action:
- service: input_text.set_value
entity_id: input_text.notify_minix_android
data:
value: 'Hey, your machine is ready!'
Pipe text to google TTS and clean input_text afterwards
- id: speak_to_mpd
alias: TTS to media player
trigger:
platform: state
entity_id: input_text.notify_minix_android
from: ''
action:
- service: tts.google_say
entity_id: media_player.mpd
data_template:
message: >
{{ states('input_text.notify_minix_android') }}
- service: input_text.set_value
entity_id: input_text.notify_minix_android
data:
value: ''
As I said, I mainly use Node-RED flows for automation, but this should work, too…
Now you can activate/deactivate “speak_to_mpd” by frontend and/or create another automation to turn off by time etc.
Thats so good i might even stick it in my automations !
I’d make a script that replaces the service tts.google_say. Then do a search and replace on all tts.google_say and replace it with the script name. Inside the script, add a condition and perform the tts.google_say.
script:
tts_household:
sequence:
- condition: template
value_template: "{{ now().hour <= 23 or now().hour >= 7 }}"
- service: tts.google_say
data_template:
entity_id: "{{ entity_id }}"
message: "{{ message }}"
The only Issue i could see with this is if you used the entity_id outside your data sections. You’d have to move it inside the data section:
action:
- service: script.tts_household
data:
entity_id: media_player.media1
message: "blah blah blah"
Not to hijack this thread, but would you care to share how this binary knows your machine is ready? have several appliances that could use a sensor like that…
thx
I have an input_select with three values (Home, Away, and Night). I set these with other automations when it makes sense. We leave the house, set to away, come home, set to home, go to bed, set to night.
Depends on what you want. If you never want a TTS after 11pm, even if you’re still up and about, then I’d skip this and just do a time condition, but if you want the TTS to not go off when you’re in bed (maybe you go to bed early for some reason on day), then this would probably work well for you
I had to combine some sensors to achieve that…
Explanation:
I have an AVM switch FRITZ!DECT 200, which comes with a power consumption attribute.
When my washing machine is turned on the value is below 3W.
When I start the washing process the value is higher. But everytime my machine “sleeps” in the meantime, it could be interpreted by the sensor as false positive.
So I created a history sensor to check the last 3 minutes.
sensor history_stats
- platform: history_stats
name: waschmaschine_aktiv
entity_id: binary_sensor.dectwash_consumption
state: 'on'
type: time
duration: 00:03:00
end: '{{ now() }}'
binary template sensors:
dectwash_history_active:
value_template: "{{states('sensor.waschmaschine_aktiv')|float > 0 }}"
dectwash_consumption:
value_template: "{{states.switch.dectwash.attributes.current_power_w and states.switch.dectwash.attributes.current_power_w | float > 2.5 or false }}"
thank you.
i need it mostly for my espresso machine;-)
takes some 12 minutes to heatup (using 1278,2 watts…) and then starts switching between that and 1,7 watts.
Ive got the scenarios when it is without water, using <1 watts.
now try to create a setup for the startup, signaling its ready
cool.
Thank you so much for that! I will migrate my automations to this! Very cool and neat!
Another idea… I know you said that you don’t want to disable all of the automations to accomplish this, but consider using Groups to do just that.
I have all of my TTS notification automations grouped under “Daytime Automations”. I then have an input_select to set my mode (Day, Night, Away). A script runs when the mode is changed, and the “Daytime Automations” group only gets enabled for Day mode.
You wouldn’t have to modify your existing automations, and as you add more automations you can decide whether they should be allowed to run at night by adding them to the Daytime Automations group or not.
This is a great idea and I think this is what I wanted. I have already implemented @letsoulfly idea for some of my automations and for the last 4 hours it works really great. I will disable it tonight to see if it suits my needs.
While I find his idea really amazing and very neat, I find yours closer to my original request and also very organizing!
So… Day, Night and Away will be added to this!
You two guys made my day. I just achieved 2 in 1.