Hi there,
I am struggling to play an audio file in my www folder through my Google Home. I am new to HA. Is there any configuration that I need to write to get the media to work? (I don’t currently have anything around media in my config folder.
When I run the code, I get the Google Home turning on through a beep, but the media file is not playing.
- alias: Doorbell Ring
trigger:
platform: state
entity_id: sensor.doorbell_action
to: 'on'
condition:
condition: time
after: "06:30:00"
before: "22:00:00"
action:
service: media_player.play_media
data:
entity_id: media_player.google_home
media_content_id: http://homeassistant.local/:8123/config/www/media/doorbell-1.mp3
media_content_type: audio/mp3
This is my current code. I don’t know what’s wrong with it. I am using an Ikea shortcut button as a doorbell. Is my trace wrong? I have looked at many other forum posts as well as HA documentation but nothing seems to work.
Yes, but I don’t know if I have done it correctly. Since I have configured http in my config, it is saying that I need to have an internal URL that is set to a domain and covered by the certificate.
Any thoughts?
I got it to work with this code by adding an external URL to the configuration file. All you need to do is add external URLs and media directories to allow access to the media file.
- id: Doorbell_please_ring
alias: Doorbell Ring
trigger:
- platform: state
entity_id:
- sensor.doorbell_action
to: 'on'
condition:
- condition: time
after: '06:30:00'
before: '22:00:00'
action:
- service: media_player.play_media
target:
entity_id: media_player.google_home
data:
media_content_type: audio/mp3
#media_content_id: "https://www.soundjay.com/door/sounds/doorbell-1.mp3"
media_content_id: /local/Bell.mp3