qrockz
(Qrockz)
June 12, 2024, 9:32am
1
- service: notify.persistent_notification
metadata: {}
data:
message: >
{{ now().strftime("%H:%M:%S") ~ '\n' ~ states('sensor.temperature_and_humidity_alarm_humidity') ~ '%\n'}}
title: veg_hum_on
I want the
sensor.temperature_and_humidity_alarm_humidity
displayed as bold text. Using ** around does not work.
title: veg_hum_on {{ now().strftime("%H:%M:%S")}}
does work
but
title: {{ now().strftime("%H:%M:%S")}} veg_hum_on
does not
(whole notification will not show up)
tom_l
June 12, 2024, 9:47am
2
You need to quote single line templates that don’t start with strings (you should quote them too though). So:
title: "veg_hum_on {{ now().strftime('%H:%M:%S') }}"
or
title: "{{ now().strftime('%H:%M:%S') }} veg_hum_on"
1 Like
tom_l
June 12, 2024, 9:48am
3
Try this:
message: >
{{ now().strftime("%H:%M:%S") ~ '\n <b>' ~ states('sensor.temperature_and_humidity_alarm_humidity') ~ '</b> %\n'}}
2 Likes
qrockz
(Qrockz)
June 12, 2024, 10:57am
4
The title can not be formatted?
petro
(Petro)
June 12, 2024, 11:13am
5
You can format persistent notifications with html.
tom_l
June 12, 2024, 11:22am
6
You didn’t ask for it to be. You only asked for:
St3fanNL
(St3fanNL)
January 9, 2025, 8:16am
7
For some reason html does not work anymore. I had my text bold when I initially made this system… now ** nor works.