HomeKit Camera "Failed to start/reconfigure stream, deleting session"

I was a little lost as to where to post this, but since it looks like the issue is isolated to hassio rather than Home Assistant, HomeKit or MotionEye it looks like this is the best place to start.

I have a webcam configured in the motioneye add on that shows correctly in Home Assistant using the following snippet from my configuration.yaml:

camera:
  - platform: mjpeg
    mjpeg_url: http://localhost:8081/
    name: frontright

I can use the HomeKit integration to get this camera to show in my Home apps, and it shows a single frame as the preview. I donā€™t have native h264 stream support enabled for this camera. However when I open it from the Home app, it loads indefinitely, and I get the following errors in my home assistant logs:

2021-01-28 12:16:58 ERROR (MainThread) [homeassistant.components.homekit.type_cameras] Camera has no stream source
2021-01-28 12:16:58 ERROR (MainThread) [pyhap.camera] [dd6a0653-89a8-4447-b51f-ad2135c5f189] Failed to start/reconfigure stream, deleting session.
2021-01-28 12:17:17 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyhap/camera.py", line 600, in _stop_stream
stream_idx = session_info['stream_idx']
TypeError: 'NoneType' object is not subscriptable

Does anyone know how I can fix this? Iā€™m not sure if itā€™s an outdated library in the version of hassio Iā€™m running, or how to confirm this / update it. Iā€™m running Home Assistant OS 5.10 in a VM hosted from an Unraid server, the webcam is passed through but Iā€™ve had no other troubles with my configuration. This issue persists on a fresh install of Hassio too, which I found out hard way after overloading my UPS and ending up with a corrupt virtual disk :cry:

If this is in the wrong place, please let me know, otherwise Iā€™d appreciate any help I can get :slight_smile:

Iā€™ve got the exact same issue. I have several camera streams working in HA. The Picture Entity card in Lovelace works just fine. Whether I use the RTSP stream direlty, or the MJPEG feed from MotionEye, attempting to view the camera streams in Home.app (vie the HomeKit integration bridge) fails with the same errors in the Core log:

2021-03-24 06:30:52 ERROR (MainThread) [homeassistant.components.homekit.type_cameras] Camera has no stream source
2021-03-24 06:30:52 ERROR (MainThread) [pyhap.camera] [e6c19267-5f25-4ee4-a032-300720480f21] Failed to start/reconfigure stream, deleting session.
2021-03-24 06:31:22 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyhap/camera.py", line 599, in _stop_stream
    stream_idx = session_info['stream_idx']
TypeError: 'NoneType' object is not subscriptable

My system details:

  • core-2021.3.4
  • supervisor-2021.03.6
  • Home Assistant OS 5.12
1 Like

Wow, I forgot about this. I gave up trying to get it working a few days after my post. Hopefully, someone has an answer for us because Iā€™d love to have the feature working.

@lnxd
have the same Problem. Have you found any solution so far?

My HA is using mjpeg stream provided by frigate:

  platform: mjpeg
  name: Eingang
  mjpeg_url: http://172.29.1.124:5000/api/front_door
  still_image_url: http://172.29.1.124:5000/api/front_door/latest.jpg

In the HA WebUI its running fine.
But if i use the home.app i get the following error in the log:

2021-04-24 10:01:56 ERROR (MainThread) [homeassistant.components.homekit.type_cameras] Camera has no stream source
2021-04-24 10:01:56 ERROR (MainThread) [pyhap.camera] [a953577c-1df1-40ae-a08c-1806a0a5aa74] Failed to start/reconfigure stream, deleting session.
2021-04-24 10:02:01 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyhap/camera.py", line 600, in _stop_stream
    stream_idx = session_info['stream_idx']
TypeError: 'NoneType' object is not subscriptable

And in the App:

Do you have any idea?

I have the same problem with the eufy-security add-on. I can get streams within HA, but once I use the Home.app I get the same error back in HA of ā€˜stream source not foundā€™.

Any thoughts @nonsleepr ?

i got it working. :nerd_face:

configuration.yml contains:

...
camera: !include_dir_list custom/cameras/
homekit: !include custom/homekit/bridges.yaml
...

in the directory custom/cameras/ there is a file stream_cam3_frontdoor.yaml containing the hass camera definition:

...
  platform: mjpeg
  name: Eingang
  mjpeg_url: http://172.29.1.124:5000/api/front_door
  still_image_url: http://172.29.1.124:5000/api/front_door/latest.jpg
...

the file custom/homekit/bridges.yaml defines a bridge for the defined camera.eingang entity, and also sets some homebridge camera specific settings, like the stream source (again) and the doorbell entity.

  - name: HB Cam3 Eingang
    port: 51828
    filter:
      include_entities:
        - camera.eingang
    entity_config:
      camera.eingang:
        stream_source: "-i http://172.29.1.124:5000/api/front_door"
        support_audio: False
        linked_doorbell_sensor: binary_sensor.front_door_trigger_group

seems like the camera is the basis and the bridge configuration needs to be adjusted
hope this helps!

1 Like

Followed your solution, it helped (removed the ā€œFailed to start/reconfigure stream, deleting sessionā€ from logs).

But it still doesnā€™t stream (timeout).
Now it logs a ā€œFailed to close streamā€ at the end of the timeout.