Image not show in notification

Hi. Im trying to send a snapshot of my doorbell in a notification, I already try sending the image like this:

service: notify.mobile_app_androidluis
data_template:
  title: Están Tocando el timbre...
  message: Esta persona esta tocando...
  data:
    color: red
    image: /media/local/facesnap/snap.jpg

With the image saved in:
/media/facesnap/snap.jpg

And also using a hosted image in my hassio in the WWW/snapshots/ folder with the URL: https://mycloudflaretunnel/local/snapshots/snap.jpg?raw=true

Already check and in the pc and phone I can see the image in that Url, but in the notification do not show either both methods.

the image should load, check for errors in the HA logs

you can also try the local relative URL for the image too

Already check the logs and there isn´t one related to that automation or notifications :confused:

What is “local relative URL” ?

check the companion app logs instead of HA core logs

/local/snapshots/snap.jpg

In the companion app I don´t see nothing wrong either

I also try the local relative URL with this path:

/media/facesnap/snap.jpg

and sending this url:

And this work some times but the least I would say that 3 of 10 times works. The Url as the image work perfect all the times the first may be 4 days and then… nothing :confused:

I also notice that it works better in iphone than android

this is not the log but notification history, please first open the app, reproduce the issue then go to Settings > Companion App > Troubleshooting > Show and share logs

this means there is probably a network issue that the logs will indicate…there is only 1 attempt made to download the image and that is when the notification is posted.

1 Like

Ohh, already see it this are the lines related to the notification, but again with no image.

08-28 22:59:11.928 14395 14607 D SensorManager: registerListener :: 41, TMD4910 Uncalibrated lux Sensor, 200000, 0, 
08-28 22:59:11.928 14395 14607 D LightSensor: Light sensor listener registered
08-28 22:59:11.954 14395 14395 D MessagingService: Creating notification with following data: {color=#F0741A, image=https://mycloudflaretunnel/local/snapshots/snap.jpg?raw=true, title=Están Tocando el timbre..., webhook_id=b2f888953af48c55f679e1299d4724a27b6b28d529868b04a852246ff57f3aa7, message=Esta persona esta tocando..., ledColor=#F0741A, server_id=1}
08-28 22:59:11.981 14395 14395 D ServerConnectionInfo: localUrl is: true, usesInternalSsid is: false, usesWifi is: false
08-28 22:59:11.982 14395 14395 D ServerConnectionInfo: Using external URL
08-28 22:59:11.985 14395 14607 D NextAlarm: No alarm is scheduled, sending unavailable
08-28 22:59:12.017 14395 14607 D SensorManager: registerListener :: 6, LPS22H Barometer Sensor, 200000, 0, 
08-28 22:59:12.018 14395 14607 D PressureSensor: Pressure sensor listener registered
08-28 22:59:12.023 14395 14608 E MessagingService: Couldn't download image for notification
08-28 22:59:12.026 14395 14607 D SensorManager: registerListener :: 1600479601, Palm Proximity Sensor, 200000, 0, 

Something interesting is if I recieved a notification while the app is open it works perfect.

This are le logs when it works (with the app open when i recieved it)

08-28 23:04:32.804 14395 25722 D FCMService: From: 331041709873
08-28 23:04:32.813 14395 14395 D MessagingService: Creating notification with following data: {color=#F0741A, image=https://mycloudflaretunnel/local/snapshots/snap.jpg?raw=true, title=Están Tocando el timbre..., webhook_id=b2f888953af48c55f679e1299d4724a27b6b28d529868b04a852246ff57f3aa7, message=Esta persona esta tocando..., ledColor=#F0741A, server_id=1}
08-28 23:04:32.828 14395 14395 D ServerConnectionInfo: localUrl is: true, usesInternalSsid is: false, usesWifi is: false
08-28 23:04:32.828 14395 14395 D ServerConnectionInfo: Using external URL
08-28 23:04:32.855 14395 17798 D TrafficStats: tagSocket(103) with statsTag=0xffffffff, statsUid=-1

Im thinking that maybe it cloud be related with something of battery saving but not shure its only one idea…

check to make sure the app has permission to run in the background, this will vary from device to device

Final results:

No always work with the battery saving ON or OFF no make any diference.

This way work fine but it dont work with the saving battery i dont know why if i selected the Home Assistant app to never suspense, I have to search more.

Thanks for the help!

I hijack the thread. I get the image in the notification but i can’t make it big. Before it was possible on Android

@dshokouhi

i cant be of help without yaml example

action:

  • service: camera.record
    target:
    entity_id: camera.baksidan
    data:
    filename: /media/cctv_baksidan/baksidan_{{ now().strftime(“%Y%m%d-%H%M”) }}.mp4
    duration: 30
  • service: camera.snapshot
    target:
    entity_id: camera.baksidan
    data:
    filename: ‘/media/cctv_snapshot_notify/baksidan.jpg’
  • delay:
    seconds: 5
  • service: notify.mobile_app_pixel_6_pro
    data:
    message: Någon gick in på baksidan
    data:
    url: “/lovelace/camera”
    priority: high
    image: “/media/local/cctv_snapshot_notify/baksidan.jpg”
    actions:
    - action: “URI”
    title: “Se live”
    uri: “lovelace/camera”
    - action: “URI”
    title: “Sparade videoklipp”
    uri: “lovelace/cctv-files”

this is invalid on android, should be clickAction per the docs

https://companion.home-assistant.io/docs/notifications/notifications-basic/#opening-a-url

The image is still small

Not expand

Expand

are you in the app beta by any chance? if so update to teh latest version please

1 Like

That did it, thank you!

1 Like