Newline in Notifications

I dont know whats going on with how you are sending the notification but on my pixel 6 pro its working as described.

service: notify.mobile_app_dannys_pixel_6_pro
data:
  message: This is a\nline break

Its either your template, node-red or the device that is causing your issue at this point.

1 Like

I just tested it again with putting \\n into the node red function.
Now it will break lines on the Android device but on the iPhone it will not do it but actually shows me a \n instead.
It’s an iPhone 7 and an Pixel 5. But I know that using only \n also works on newer iPhones like 12 or something since a friend of mine uses this.
So the parity between both worlds does not work for me either… at least not within the node red functions/templates.

Take templates and node red out of the equation and if it works then you can use the elimination process to find out where the issue is. That’s should help you figure out what to do.

Well, this is kinda challenging as I never used anything else for automations or notifications than Node-Red. I kinda preferred the visual approach so right from the beginning I designed everything in there. So I am not really able to leave it out of the equation at this point as I have no non Node-Red notifications in place whatsoever :see_no_evil: :joy:

Hi, i don’t get line break to work, must be some small mistake, can anybody help?

alias: NOT - Puerta de xxxxx abierta 10min
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.sensor_puerta_xxxx_cerrada
    for:
      hours: 0
      minutes: 10
      seconds: 0
    from: "on"
    to: "off"
condition: []
action:
  - service: notify.mobile_app_iphone_de_atxxxx
    data:
      title: Puerta xxxxx 10 min
      message: La puerta de xxxxx lleva mas de 10 minutos abierta /n Puedes mirar la cámara
      data:
        url: /lovelace/8
        entity_id: camera.xxxxx_medium

incorrect slash direction not / but \ always make sure to double check everything when looking at examples like mine a few posts above :slight_smile:

nope, tried both, issue is still there

just realized your on an iPhone responding to an android thread. Not 100% sure iPhone supports line breaks.

For iPhone users

service: notify.mobile_app_iphone_de_atxxxx
data:
  title: Puerta xxxxx 10 min
  message: >
    La puerta de xxxxx lleva mas de 10 minutos abierta
    
    Puedes mirar la cámara
  data:
    url: /lovelace/8
    entity_id: camera.xxxxx_medium

Note the empty line to do a new line

1 Like