core: generic camera doesn't support taking username: / password: for stream_source: URL

Home Assistant release with the issue:

arch | x86_64 dev | false docker | true hassio | false os_name | Linux python_version | 3.7.3 timezone | America/New_York version | 0.91.2 virtualenv | false

Last working Home Assistant release (if known):

Operating environment (Hass.io/Docker/Windows/etc.): x86_64 Ubuntu Linux 18.04 running home assistant as a Docker image homeassistant/home-assistant:0.91.2 from hub.docker.com

Component/platform: https://www.home-assistant.io/components/generic/

Description of problem: When using the generic camera component, the stream_source: URL specification doesn’t use the supplied username: and password: parameters, like the still_image_url: URL specification. Of course, I can embed the username and password in the URL, but that’s not putting the password in the configuration and secrets file, or the stream URL with the IP address in both the configuration YAML and secrets file…

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

camera:
  # hikvision DS-2CD2032-I front porch
  - name: cam5
    platform: generic
    username: !secret cam5_user
    password: !secret cam5_password
    still_image_url: http://10.200.34.206/onvif/snapshot
    stream_source: rtsp://10.200.34.206:554

does not work. If I include the password in the stream_source: URL, it does work. The still_image_url: URL spec doesn’t require this.

Traceback (if applicable):

An authentication error shows up in the log since the username/password isn’t picked up.

Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 25 (8 by maintainers)

Most upvoted comments

This is still an issue in 2021.8.2

I personally lost interest since I switched from generic to onvif, but I believe this is still an issue and should remain open.

This is still an issue

There’s an attempted fix in https://github.com/home-assistant/home-assistant/pull/28333 but unfortunately there doesn’t seem to be any appetite to approve it.