Himdola
August 13, 2024, 9:20am
581
What is wrong here, everything works now but i don’t get any notification. When i run the automation manually, it works well.
alias: OgleVakti
description: ""
trigger:
- platform: time
at: sensor.ogle
id: Ogle
condition:
- condition: trigger
id:
- Ogle
action:
- data:
message: Ogle Namazi
action: notify.mobile_app_xxxxx
- metadata: {}
data:
volume_level: 0.15
target:
entity_id: media_player.xxxxx
action: media_player.volume_set
- action: media_player.play_media
metadata: {}
data:
media_content_id: http://xxxxxxxxxx:8123/local/xxx.mp3
media_content_type: audio/mp3
target:
entity_id: media_player.xxxx
mode: single
Has anyone elses playback started failing after 2024.8.0?
opened 10:17AM - 13 Aug 24 UTC
integration: media_player
### The problem
After 2024.8.0 (and also now on 2024.8.1), media_player no lo… nger plays a locally hosted file (either through url or locally stored media:
`# Automations
automation:
# Adhan
- alias: Adhan
trigger:
- platform: state
entity_id: sensor.salah_actual
to:
- Fajr
- Dhuhr
- Asr
- Maghrib
- Isha
action:
- action: notify.ios_all
data:
message: "It is {{ states.sensor.salah_actual.state }} time, please perform wudhu."
- action: media_player.media_pause
target:
entity_id:
- media_player.android
- media_player.shield
- action: switch.turn_on
target:
entity_id: switch.pc_mute
- action: media_player.volume_set
target:
entity_id: media_player.living_room_speaker
data:
volume_level: 0.6
- action: media_player.play_media
data:
media_content_id: "http://10.10.1.200:8123/local/adhan-{{'fajr' if trigger.to_state.state == 'Fajr' else 'main'}}.mp3"
media_content_type: music
target:
entity_id:
- media_player.living_room_speaker
- media_player.bedroom`
### What version of Home Assistant Core has the issue?
2024.8.1
### What was the last working version of Home Assistant Core?
2024.7.x
### What type of installation are you running?
Home Assistant OS
### Integration causing the issue
Automation
### Link to integration documentation on our website
https://www.home-assistant.io/integrations/media_player/
### Diagnostics information
_No response_
### Example YAML snippet
```yaml
# Automations
automation:
# Adhan
- alias: Adhan
trigger:
- platform: state
entity_id: sensor.salah_actual
to:
- Fajr
- Dhuhr
- Asr
- Maghrib
- Isha
action:
- action: notify.ios_all
data:
message: "It is {{ states.sensor.salah_actual.state }} time, please perform wudhu."
- action: media_player.media_pause
target:
entity_id:
- media_player.android
- media_player.shield
- action: switch.turn_on
target:
entity_id: switch.pc_mute
- action: media_player.volume_set
target:
entity_id: media_player.living_room_speaker
data:
volume_level: 0.6
- action: media_player.play_media
data:
media_content_id: "http://10.10.1.200:8123/local/adhan-{{'fajr' if trigger.to_state.state == 'Fajr' else 'main'}}.mp3"
media_content_type: music
target:
entity_id:
- media_player.living_room_speaker
- media_player.bedroom
```
### Anything in the logs that might be useful for us?
_No response_
### Additional information
I've also tried using the following:
`media_content_id: "media-source://media_source/local/adhan-{{'fajr' if trigger.to_state.state == 'Fajr' else 'main'}}.mp3"`
2 Likes
raub21
(Raub21)
August 15, 2024, 12:08pm
583
I am not an expert but it looks like after action. you should issue a call of service and in this case it should be notify first and then data with message:
action:
- service: notify.mobile_app_xxxxx
data:
message: Ogle Namazi
title: 🕌 Prayer Time 🕌
This is assuming you only have issue getting notification on your mobile and the adhan plays fine on your speakers
banstro
(AB)
November 15, 2024, 7:02pm
584
Use this format for local files.
data:
media_content_id: /local/adhan/Adhan.mp3
media_content_type: audio/mp3
target:
entity_id: media_player.receiver
action: media_player.play_media