home-assistant / android

:iphone: Home Assistant Companion for Android
https://companion.home-assistant.io/
Apache License 2.0
2.07k stars 587 forks source link

Images don't show in notifications 2024.4.1-full #4342

Closed jonny190 closed 1 week ago

jonny190 commented 1 month ago

Home Assistant Android app version(s): 2024.4.1

Android version(s): 15 and 14

Device model(s): Google Pixel 8 Pro

Home Assistant version: 2024.4.2

Last working Home Assistant release (if known):

Description of problem, include YAML if issue is related to notifications:

Using a basic service call from HA:

service: notify.mobile_app_pixel_8_pro
data:
  message: "Camera Test"
  title: Test
  data:
    # example of a relative url
    image: "https://github.com/home-assistant/assets/blob/master/logo/logo.png?raw=true"

I get the notification on my device but no image expanded or not, this was originally noticed when trying to use Alarmo to send a camera thumbnail, so to test I tried using the service call to send a camera thumbnail. With previous tests failing I fell back to RTFM page with that failing i thought i'd check the logs for anything obvious (see below) Companion App Logs:

04-12 13:03:58.223  6141 20029 W FirebaseMessaging: Unable to log event: analytics library is missing
04-12 13:03:58.223  6141 20029 D FCMService: From: 331041709873
04-12 13:03:58.224  6141  6141 D MessagingService: Creating notification with following data: {image=https://github.com/home-assistant/assets/blob/master/logo/logo.png?raw=true, title=Test, webhook_id=67deeb1d140fb37f7a40696c75cf4f4515a24986807a4f0ae7efebf80596193f, message=Camera Test, server_id=2}
04-12 13:03:58.227  6141  6141 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
04-12 13:03:58.227  6141  6141 D ServerConnectionInfo: Using external URL
04-12 13:03:58.255  6141 19946 D HWUI    : --- Failed to create image decoder with message 'unimplemented'
04-12 13:03:58.259  6141  6141 D MessagingService: Show notification with tag "null" and id "-768512881"
04-12 13:03:58.624  6141 20029 W FirebaseMessaging: Unable to log event: analytics library is missing
04-12 13:03:58.624  6141 20029 D FCMService: From: 331041709873
04-12 13:03:58.624  6141  6141 D MessagingService: Creating notification with following data: {image=https://github.com/home-assistant/assets/blob/master/logo/logo.png?raw=true, title=Test, webhook_id=67deeb1d140fb37f7a40696c75cf4f4515a24986807a4f0ae7efebf80596193f, message=Camera Test, server_id=2}
04-12 13:03:58.626  6141  6141 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
04-12 13:03:58.626  6141  6141 D ServerConnectionInfo: Using external URL
04-12 13:03:58.657  6141 19946 D HWUI    : --- Failed to create image decoder with message 'unimplemented'
04-12 13:03:58.659  6141  6141 D MessagingService: Show notification with tag "null" and id "-768512480"
04-12 13:03:58.730  6141  6141 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: true, expireMillis: 1712923310661, currentMillis: 1712923438730)
04-12 13:03:58.730  6141  6141 D IntegrationRepository: setAppActive(): true
04-12 13:04:02.046  6141 20029 W FirebaseMessaging: Unable to log event: analytics library is missing
04-12 13:04:02.046  6141 20029 D FCMService: From: 331041709873
04-12 13:04:02.050  6141  6141 D MessagingService: Creating notification with following data: {image=https://github.com/home-assistant/assets/blob/master/logo/logo.png?raw=true, title=Test, webhook_id=67deeb1d140fb37f7a40696c75cf4f4515a24986807a4f0ae7efebf80596193f, message=Camera Test, server_id=2}
04-12 13:04:02.054  6141  6141 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
04-12 13:04:02.054  6141  6141 D ServerConnectionInfo: Using external URL
04-12 13:04:02.103  6141 19946 D HWUI    : --- Failed to create image decoder with message 'unimplemented'
04-12 13:04:02.106  6141  6141 D MessagingService: Show notification with tag "null" and id "-768509058"
04-12 13:04:03.986  6141  6141 W Choreographer: Frame time is 0.034419 ms in the future!  Check that graphics HAL is generating vsync timestamps using the correct timebase.
04-12 13:04:04.040  6141 19946 D LogcatReader: Read logcat for pid 6141

Screenshot or video of problem: Link to video (as too big to upload) https://photos.app.goo.gl/ocprkELQP1fGoC9A9 Additional information:

dshokouhi commented 1 month ago

https://github.com/home-assistant/assets/blob/master/logo/logo.png?raw=true

this produces a 404 file not found error, you need to use a valid image.

we need a valid image in order to troubleshoot.

edit: yes docs need to be updated but that does not negate needing to use valid images

edit2: docs have been updated to give an example of a valid image

jonny190 commented 4 weeks ago

The same happens with https://github.com/home-assistant/assets/blob/master/stickers/sticker_v3/sticker_v3_300.png?raw=true as an image

dshokouhi commented 4 weeks ago

The same happens with https://github.com/home-assistant/assets/blob/master/stickers/sticker_v3/sticker_v3_300.png?raw=true as an image

This image is a redirect URL, you will notice it if you attempt to load it in a browser and see the URL change. After that its working for me. Please provide a valid example like the one you mentioned regarding camera thumbnail.

service: notify.mobile_app_dannys_pixel_8_pro
data:
  message: test
  data:
    image: https://raw.githubusercontent.com/home-assistant/assets/master/stickers/sticker_v3/sticker_v3_300.png

image

DonRomaniello commented 1 week ago

Is this still a bug?

dshokouhi commented 1 week ago

@DonRomaniello please provide a YAML example and logs if you have an issue, we have not heard back from the author on this issue and this issue is at risk of being closed due to lack of response. And no, images are working for most if not all users. All examples in this issue are invalid images so we dont know what the actual issue is, if any.

jonny190 commented 1 week ago

@DonRomaniello Thanks, Sorry for the delay, Static images appear to work, just not dynamic ones

service: notify.mobile_app_pixel_8_pro
data:
  message: test
  data:
    entity_id: camera.doorcam

The logs show:

05-06 19:41:27.524  9804  9804 D ActivitySM: Received activity update.
05-06 19:41:32.044  9804 26277 E WebSocketRepository: Websocket: onFailure
05-06 19:41:32.044  9804 26277 E WebSocketRepository: java.io.EOFException
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at okio.RealBufferedSource.require(RealBufferedSource.kt:202)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at okio.RealBufferedSource.readByte(RealBufferedSource.kt:212)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at okhttp3.internal.ws.WebSocketReader.readHeader(WebSocketReader.kt:119)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at okhttp3.internal.ws.WebSocketReader.processNextFrame(WebSocketReader.kt:102)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at okhttp3.internal.ws.RealWebSocket.loopReader(RealWebSocket.kt:293)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at okhttp3.internal.ws.RealWebSocket$connect$1.onResponse(RealWebSocket.kt:195)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.kt:519)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
05-06 19:41:32.044  9804 26277 E WebSocketRepository:   at java.lang.Thread.run(Thread.java:1012)
05-06 19:41:37.116  9804 26400 W FirebaseMessaging: Unable to log event: analytics library is missing
05-06 19:41:37.116  9804 26400 D FCMService: From: 331041709873
05-06 19:41:37.117  9804  9804 D MessagingService: Creating notification with following data: {webhook_id=67deeb1d140fb37f7a40696c75cf4f4515a24986807a4f0ae7efebf80596193f, message=test, server_id=2}
05-06 19:41:37.125  9804  9804 D MessagingService: Show notification with tag "null" and id "1328946012"
05-06 19:41:40.242  9804  9804 D LocBroadcastReceiver: Received location update.
05-06 19:41:40.243  9804  9804 D ForegrndServiceLauncher: Check if service HighAccuracyLocationService is running. Service running = false
05-06 19:41:40.244  9804 26305 D LocBroadcastReceiver: Last Location: 
05-06 19:41:40.244  9804 26305 D LocBroadcastReceiver: Coords:(**.9028817, -**.4523159)
05-06 19:41:40.244  9804 26305 D LocBroadcastReceiver: Accuracy: 100.0
05-06 19:41:40.244  9804 26305 D LocBroadcastReceiver: Bearing: 0.0
05-06 19:41:40.245  9804 26305 D LocBroadcastReceiver: Begin evaluating if location update should be skipped
05-06 19:41:40.245  9804 26305 D LocBroadcastReceiver: Received location that is 31 milliseconds old, 1715020900214 compared to 1715020900245 with source fused
05-06 19:41:40.245  9804 26305 D LocBroadcastReceiver: Duplicate location received, not sending to HA
05-06 19:41:42.053  9804 22877 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
05-06 19:41:42.053  9804 22877 D ServerConnectionInfo: Using external URL
05-06 19:41:42.057  9804 22877 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
05-06 19:41:42.058  9804 22877 D ServerConnectionInfo: Using external URL
05-06 19:41:42.133  9804 26277 D TrafficStats: tagSocket(164) with statsTag=0xffffffff, statsUid=-1
05-06 19:41:42.162  9804 26277 D WebSocketRepository: Websocket: onOpen
05-06 19:41:42.162  9804 26277 D WebSocketRepository: Websocket: onMessage (text)
05-06 19:41:42.164  9804 26277 D WebSocketRepository: Message number null received
05-06 19:41:42.166  9804 22877 D WebSocketRepository: Auth Requested
05-06 19:41:42.171  9804 26277 D WebSocketRepository: Websocket: onMessage (text)
05-06 19:41:42.171  9804 26277 D WebSocketRepository: Message number null received
05-06 19:41:42.172  9804 24387 D WebSocketRepository: Sending message 4708: {type=supported_features, id=4708, features={coalesce_messages=1}}
05-06 19:41:42.173  9804 24387 D WebSocketRepository: Resubscribing to active subscriptions...
05-06 19:41:42.173  9804 24387 D WebSocketRepository: Sending message 4709: {type=subscribe_trigger, trigger={platform=state, entity_id=[sensor.audi_e_tron_primary_engine_percent]}, id=4709}
05-06 19:41:42.173  9804 24387 D WebSocketRepository: Message number 4709 sent
05-06 19:41:42.178  9804 26277 D WebSocketRepository: Websocket: onMessage (text)
05-06 19:41:42.179  9804 26277 D WebSocketRepository: Message number 4708 received
05-06 19:41:42.183  9804 26277 D WebSocketRepository: Websocket: onMessage (text)
05-06 19:41:42.183  9804 26277 D WebSocketRepository: Message number 4709 received
05-06 19:41:42.185  9804 22877 D WebSocketRepository: Sending message 4710: {type=subscribe_trigger, trigger={platform=state, entity_id=[sensor.solar_inverter_state_of_charge]}, id=4710}
05-06 19:41:42.185  9804 22877 D WebSocketRepository: Message number 4710 sent
05-06 19:41:42.192  9804 26277 D WebSocketRepository: Websocket: onMessage (text)
05-06 19:41:42.192  9804 26277 D WebSocketRepository: Message number 4710 received
05-06 19:41:44.600  9804  9804 D NotifManagerCompat: Cancel notification with tag "null" and id "0"
05-06 19:41:44.601  9804  9804 D NotifManagerCompat: Check if the notification is in a group...
05-06 19:41:44.601  9804  9804 D NotifManagerCompat: Notification is not in a group. Cancel notification...
05-06 19:41:44.604  9804 22877 D ServerConnectionInfo: localUrl is: false, usesInternalSsid is: false, usesWifi is: true
05-06 19:41:44.749  9804 22877 D NotifDeleteReceiver: Notification cleared event successful!
05-06 19:41:45.166  9804  9804 D IntegrationRepository: isAppLocked(): false. (LockEnabled: false, appActive: true, expireMillis: 1715020137227, currentMillis: 1715020905166)
05-06 19:41:45.166  9804  9804 D IntegrationRepository: setAppActive(): true
05-06 19:41:46.189  9804 22877 D LogcatReader: Read logcat for pid 9804
jpelgrom commented 1 week ago

Static images appear to work, just not dynamic ones

Dynamic attachments are an iOS-only feature, but assuming you mean dynamic as images that change every time...

service: notify.mobile_app_pixel_8_pro
data:
  message: test
  data:
    entity_id: camera.doorcam

This is not a valid format for notification attachments. For an image of your camera, you probably want to use:

service: notify.mobile_app_pixel_8_pro
data:
  message: test
  data:
    image: /api/camera_proxy/camera.doorcam

Closing this issue as none of the examples given point to app bugs.

jonny190 commented 1 week ago

My bad, on it not being an android option.

the format was taken from the documentaion https://companion.home-assistant.io/docs/notifications/dynamic-content#camera-stream

jpelgrom commented 1 week ago

the format was taken from the documentaion

At the top of the page it mentions it is iOS specific/only, but that's easy to miss and we were all focused on that you said it used to work :)

DonRomaniello commented 1 week ago

Ah, well! So the bug exists in iOS?

jonny190 commented 1 week ago

No Bugs, Just me fatgingering the URL for images then expexting funtionality that is not there by missing the iOS tab at the top of the page :)