I have an automation that has been in place for a while, using the Islamic prayer time integration. I have a few template sensors setup to convert the timestamps and one that shows the current prayer time. These are used in a single automation that has been working flawlessly for a few years. Up until recently, I’m not exactly sure when, but it must have been a recent HA update, where the notify service on the automation stopped showing the prayer name in the message itself.
YAML:
# Sensors
sensor:
- platform: template
sensors:
salah_fajr:
friendly_name: "Fajr"
icon_template: mdi:weather-sunset-up
value_template: '{{ (states("sensor.islamic_prayer_times_fajr_prayer").split("T")[1].split(":")[0]) +":"+ (states("sensor.islamic_prayer_times_fajr_prayer").split("T")[1].split(":")[1])}}'
salah_dhuhr:
friendly_name: "Dhuhr"
icon_template: mdi:weather-sunny
value_template: '{{ (states("sensor.islamic_prayer_times_dhuhr_prayer").split("T")[1].split(":")[0]) +":"+ (states("sensor.islamic_prayer_times_dhuhr_prayer").split("T")[1].split(":")[1])}}'
salah_asr:
friendly_name: "Asr"
icon_template: mdi:weather-sunset
value_template: '{{ (states("sensor.islamic_prayer_times_asr_prayer").split("T")[1].split(":")[0]) +":"+ (states("sensor.islamic_prayer_times_asr_prayer").split("T")[1].split(":")[1]) }}'
salah_maghrib:
friendly_name: "Maghrib"
icon_template: mdi:weather-sunset-down
value_template: '{{ (states("sensor.islamic_prayer_times_maghrib_prayer").split("T")[1].split(":")[0]) +":"+ (states("sensor.islamic_prayer_times_maghrib_prayer").split("T")[1].split(":")[1]) }}'
salah_isha:
friendly_name: "Isha"
icon_template: mdi:weather-night
value_template: '{{ (states("sensor.islamic_prayer_times_isha_prayer").split("T")[1].split(":")[0]) +":"+ (states("sensor.islamic_prayer_times_isha_prayer").split("T")[1].split(":")[1]) }}'
salah_actual:
friendly_name: Salah Actual
value_template: >
{%- if is_state('sensor.salah_fajr', states('sensor.time_utc')) -%}
Fajr
{%- elif is_state('sensor.salah_dhuhr', states('sensor.time_utc')) -%}
Dhuhr
{%- elif is_state('sensor.salah_asr', states('sensor.time_utc')) -%}
Asr
{%- elif is_state('sensor.salah_maghrib', states('sensor.time_utc')) -%}
Maghrib
{%- elif is_state('sensor.salah_isha', states('sensor.time_utc')) -%}
Isha
{%- endif -%}
# Automations
automation:
# Adhan
- alias: Adhan
trigger:
- platform: time
at:
- sensor.islamic_prayer_times_fajr_prayer
- sensor.islamic_prayer_times_dhuhr_prayer
- sensor.islamic_prayer_times_asr_prayer
- sensor.islamic_prayer_times_maghrib_prayer
- sensor.islamic_prayer_times_isha_prayer
action:
- service: notify.ios_all
data:
message: "It is {{ states.sensor.salah_actual.state }} time, please perform wudhu."
- service: media_player.media_pause
data:
entity_id: media_player.android
- service: switch.turn_on
data:
entity_id: switch.pc_mute
- service: media_player.volume_set
data:
entity_id: media_player.living_room_speaker
volume_level: 0.6
- service: media_player.play_media
target:
entity_id:
- media_player.living_room_speaker
- media_player.kids_bedroom
data:
media_content_id: "http://10.10.1.200:8123/local/adhan-{{'fajr' if trigger.entity_id == 'sensor.fajr_prayer' else 'main'}}.mp3"
media_content_type: music
The template sensor appears to be working fine as indicated in the template tester in dev tools (captured at the right time, within the minute of the sensor in question):
But the notification on the clients shows the text as “It is time, please perform wudhu.”
Other template sensors work fine in my setup and where the same notify service is used, presents the Jinja data fine.
Any ideas what why the Jinja would no longer be shown?
Thanks in advance.