I sadly wrote out my message when I was packing up for the evening so of course I did not yet try it with the HDMI cable unplugged but I have now just tried it but it still isn’t working just yet.
I’ve definitely added HA to the vlc usergroup.
Just playing around with seeing if the media player goes off idle, will report back soon
#Movie Night Notification
- alias: Movie Night
trigger:
platform: time
at: "18:30:00"
condition:
condition: and
conditions:
- condition: state
entity_id: device_tracker.3ccd932b7f17
state: home
- condition: time
weekday:
- sat
- condition: state
entity_id: input_boolean.information_messages
state: 'on'
action:
- service: tts.google_say
entity_id: media_player.pi_speaker
data:
message: 'Hey kids, it is movie and ice cream night'
well I really can’t see where the problem is . To me your config is just fine, and if you install vlc properly and add HA to the usergroup, everything should run smoothly.
If you replace the tts action by a notification or some other thing that you can see (light,…) do the automation work ?
I am really confused, I did a fresh install yesterday of hassbian because my sd card got corrupted after a power outage, followed the procedure I explained here for the setup of vlc and tts, and everything is directly back to normal, without any problem.
Thanks for the feedback. At least I’m not doing something obviously wrong, it’ll most likely work somehow.
Could it possibly be the speaker itself? I’m awaiting a simple hamburger speaker arriving from ebay but in the meantime I’ve used an old CD player unit that has an AUX in? I would have thought it still would work though as it is designed to accept mp3 files and is definitely on the correct source.
Only other thing I can think of is just doing a full reboot of the pi and see what happens. Perhaps when I removed the HDMI cable I should have rebooted afterwards?
With the automations, I know they work as the mp3 files are definitely being created. In fact if I just trigger the tts function off the speaker, I see the mp3 get created but alas the media player sits idle
You can add it straight into the automation as you have it there, see mine below when I turn the last light off it says a version of goodnight, be careful he spaces are correct;
- alias: 'Say good night'
initial_state: on
trigger:
platform: state
entity_id: switch.table_light
to: 'off'
action:
service: tts.google_say
entity_id: media_player.tts_bluetooth_speaker [or whatever your tts speaker is- I have 3]
data_template:
message: >-
{{ [
"Good night. " ,
"Good evening. " ,
"Sweet dreams. " ,
"See you tomorrow. " ,
"Have a wonderful night. " ,
"See you soon. "
] |random }}'
There is also option of ‘name’ in the config platform I’m not using that in this bluetooth speaker but am on the example speaker you gave for my sound jack on the Pi;
- alias: Lampara Sofa
trigger:
- platform: event
event_type: cube_action
event_data:
entity_id: binary_sensor.cube_XXXXXXXXXX
action_type: tap_twice
action:
- service: light.toggle
entity_id: light.salon
- service: tts.google_say
entity_id: media_player.jabra
data:
message: 'May the Force be with you.'
The test (speaker-test -c2 -D hw:CARD=USB,DEV=0 --test=wav -w /usr/share/sounds/alsa/Front_Center.wav) works really good, but I´m not getting any success on the automation script (The light.toggle works good, but not the tts) Can anybody help me with it, please?
P.S. I have defined in base_url my URL: base_url: https://xxxx.duckdns.org
Do you need to media_player.turn_on first before tts.google_say ? There r times on my tests that I need to like “hey google” first just to make sure its on, or turn it on from hass before firing tts.google_say
Tested audio output with … cvlc --vout none LRMonoPhase4.wav
… all works good!
Tried to call tts.google_say in my config and even in the dev tools but I’ve no audio!
In the dev tools I called…
service: tts.google_say
entity: media_player.speaker_1
data: {"entity_id": "media_player.speaker_1", "message": "Hello"}
Why I’ve no audio?