I’m finding that my notification message text is not wrapping for display on the phone, meaning that some of the message is not displayed. This seems related to sending an image as part of the notification.
I’ve spent a fair amount of time this afternoon trying to use line breaks to workaround the issue however I’m clearly missing something as I cannot find a way to make this work with data_template.
The automation I’m working with uses this notification action block:
- service: notify.mobile_app_turk
data_template:
title: "Driveway Alert"
message: >
Driveway camera motion detected at {{ as_timestamp(state_attr('camera.driveway', 'last_tripped_time')) | timestamp_custom('%H:%M') }}.
Score: {{ state_attr('binary_sensor.unifiprotect_motion_driveway', 'event_score') }}.
{% set time = ((as_timestamp(now()) - as_timestamp(state_attr('camera.driveway', 'last_tripped_time'))) | int) - 5 %}
{% set mins = ((time % 3600) / 60) | int %}
{% set secs = time - (mins * 60) %}
{% if time < 60 %}Length: {{ secs }}s
{% else %}Length: {{ mins }}m {{ secs }}s
{% endif %}
data:
image: "{{ states('sensor.snapshot_remote') }}driveway_motion.jpg"
actions:
- action: "URI"
title: "View Live Feed"
uri: "/lovelace/camera_driveway"
What I’ve tried:
- message: | : no difference in the resulting notification text
- Using {{- ‘\n’ -}} to denote line breaks - works without using data_template, not with.
- Using a quoted message block with multiple line spacing to donate new line.
Does anyone have a definitive tried and true method for formatting the network message?