home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.53k stars 297 forks source link

Camera preview in iPhone notifications not working any more #2246

Open eikowagenknecht opened 1 year ago

eikowagenknecht commented 1 year ago

Model Name: iPhone XS Software Version: 16.1 App version: 2022.10.1 (2022.424)

Home Assistant Core Version latest beta

Describe the bug Hey! I'm using the official iPhone app to show a notification on my phone when a movement was detected. The preview image does not show any more. This worked fine before and stopped a few month ago (yeah it's been taking me a while to follow up on this).

So what I get is this (fine): image

But when I maximize the notification it shows like this:

image

The same behaviour is on my apple watch (only the error message is shown).

Error message: HLS Stream not available. URLSessionTask failed with error.

To Reproduce Set up app with camera entity like:

...
  data:
    entity_id: camera.au_terrasse_kamera
    tag: kamera_terrasse
    url: lovelace-haussteuerung/sicherheit
    push:
      interruption-level: time-sensitive
...

Expected behavior Bigger image in maximized notification. No errors.

Screenshots See above

ultimate-tester commented 1 year ago

I'm having the exact same issue. Sometimes it's HLS-stream not available, other times it simply gives a 404 "unacceptable response" error. I have the exact same setup but without the "push" and "interruption-level" attribute, so these are not key to this issue.

eikowagenknecht commented 1 year ago

It seems that for me it is because Eufy cameras do not stream constantly (as they are battery powered). But the notification refers to the live stream (which is not available), so it fails. Not sure if Home Assistant can do sth. against that. Would be nice if the last still image could be shown instead when the camery entity currently is not streaming, but as a workaround, I fixed it with the following automation and the Eufy integration v6.2.0:

alias: Kamera - Hauseingang Bewegung - Benachrichtigung (+Snapshot)
description: ""
trigger:
  - platform: state
    entity_id:
      - binary_sensor.au_vorgarten_kamera_hauseingang_bewegung
      - binary_sensor.au_vorgarten_kamera_hauseingang_person
    to: "on"
condition: []
action:
  - service: script.nachricht_an_alle_anwesenden
    data:
      data:
        title: Hauseingang
        message: Es wurde eine Bewegung erkannt
        data:
          tag: kamera_hauseingang
          url: lovelace-haussteuerung/sicherheit
  - service: eufy_security.start_rtsp_livestream
    data: {}
    target:
      entity_id: camera.au_vorgarten_kamera_hauseingang
  - service: eufy_security.generate_image
    data: {}
    target:
      entity_id: camera.au_vorgarten_kamera_hauseingang
  - service: eufy_security.stop_rtsp_livestream
    data: {}
    target:
      entity_id: camera.au_vorgarten_kamera_hauseingang
  - service: script.nachricht_an_alle_anwesenden
    data:
      data:
        title: Hauseingang
        message: Es wurde eine Bewegung erkannt
        data:
          image: /api/camera_proxy/camera.au_vorgarten_kamera_hauseingang
          tag: kamera_hauseingang
          url: lovelace-haussteuerung/sicherheit
mode: single

Notes:

Can't say if this helps for any non-Eufy integrated cameras as well.