I need help as newbie

I found in the net this template:

      media_content_id: '{% if now().strftime("%M")|int == 30 %} https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/cuckoo-clock-01.wav
        {% else %} https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config/sounds/cuckoo-clock-{{now().strftime("%I")}}.wav
        {% endif %}'

and it works good in an automation, but i’d like to have those sounds locally and i downloaded all of them.
Now i’d like to change that template to play those sounds locally.
Can someone help me to do this?

First you need to put them somewhere HA can serve or some other location on your network.

I will assume that:

  1. You’re not handling SSL directly in HomeAssistant
  2. Your HA host is on 192.168.0.42
  3. You copied them into /config/www/sounds

If all those are true you would replace https://raw.githubusercontent.com/CCOSTAN/Home-AssistantConfig/master/config with http://192.168.0.42:8123/local:

      media_content_id: '{% if now().strftime("%M")|int == 30 %} http://192.168.0.42:8123/local/sounds/cuckoo-clock-01.wav
        {% else %} http://192.168.0.42:8123/local/sounds/cuckoo-clock-{{now().strftime("%I")}}.wav
        {% endif %}'
1 Like

Thanks a lot…