Notifications in the lock screen

I am having trouble getting notifications to work on the lock screen of my pixel 7.

I have allowed show all notification content for the lock screen field of my channel, override DND enabled enabled sensitive notifications, set show conversations, default, and silent in my phones notification settings and removed any battery saving settings.

I have tried setting channel importance and using ttl: 0 with priority: high.

The only way I can get it to work is if I set up a persistent connection to the server. I want to try and avoid the battery drain cause by doing this.

Current code from node red is below. I normally use the visual editor for JSON so I initially had everything in quotations. Switched to expressions to try with/without for
ttl, priority, importance, and visibility to see if it made any difference.

{
  "title": "Front Door",
  "message": "There is someone at the front door",
  "data": {
    "ttl": 0,
    "priority": high,
    "channel": "cctv",
    "importance": high,
    "visibility": public,
    "notification_icon": "mdi:cctv",
    "clickAction": "/lovelace/camera_testing",
    "image": "/api/camera_proxy/camera.doorcam"
  }
}

whats the actual issue? the notification not showing up when expected?

The notification does not show up until I unlock my phone.

did you grant the app background access?

Yes unrestricted battery usage, unrestricted data usage, background data is enabled.

can you try it with just ttl and priority like

service: notify.mobile_app
data:
  message: TEST
  data:
    ttl: 0
    priority: high

these are whats required for notifications to be delivered immediately and work on all my pixel devices.

I assume you have it set to show the full notification on th lock screen for that notification channel?

This worked in developer tools.

Final code for node red:

{
  "title": "Front Door",
  "message": "There is someone at the front door",
  "data": {
    "ttl": 0,
    "priority": "high",
    "channel": "cctv",
    "notification_icon": "mdi:cctv",
    "clickAction": "/lovelace/camera_testing",
    "image": "/api/camera_proxy/camera.doorcam"
  }
}

Thanks for your help!

1 Like