I’ve browsed these helpful forums and found much useful advice. I went to the iSpy site and found relevant CGI URLs appropriate for my Foscam FI8918W camera.
I can configure it as a generic camera device and get successful snapshots once every 10 seconds or so, so HA and the camera play nice and my network is not at fault.
But try as I might I can’t get MJPEG streaming to work at any resolution.
From the hassio SSH add-on, I can use curl to stream the video just fine, with:
curl --anyauth --user [USERID]:[PASSWORD] http://[IPADDRESS]/videostream.cgi
So I know that the HA box can definitely pull down the video.
My configuration.yaml includes:
# Enable FOSCAM camera
camera:
# - platform: generic
# name: 'GarageCam'
# still_image_url: 'http://[IPADDRESS]/snapshot.cgi'
# framerate: 1
# username: '[USERID]'
# password: '[PASSWORD]'
# authentication: digest
- platform: mjpeg
mjpeg_url: 'http://[IPADDRESS]/videostream.cgi?resolution=32&rate=0'
still_image_url: 'http://[IPADDRESS]/snapshot.cgi'
name: 'G-Cam mjpeg'
username: '[USERID]'
password: '[PASSWORD]'
But in the Overview, I see only a grey card with the right title containing a broken image icon (blue question mark) and in the /config/home-assistant.log I get unending repeats of:
2018-10-28 21:16:00 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1921564752] Sending {'id': 30, 'type': 'result', 'success': True, 'result': {'content_type': 'image/jpeg', 'content': 'PEhUTUw+PEhFQUQ+PFRJVExFPjQwMSBVbmF1dGhvcml6ZWQ8L1RJVExFPjwvSEVBRD4KPEJPRFkgQkdDT0xPUj0iI2NjOTk5OSI+PEg0PjQwMSBVbmF1dGhvcml6ZWQ8L0g0PgpBdXRob3JpemF0aW9uIHJlcXVpcmVkLgo8L0JPRFk+PC9IVE1MPgo='}}
2018-10-28 21:16:10 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1921564752] Received {'type': 'camera_thumbnail', 'entity_id': 'camera.gcam_mjpeg', 'id': 31}
2018-10-28 21:16:10 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1921564752] Sending {'id': 31, 'type': 'result', 'success': True, 'result': {'content_type': 'image/jpeg', 'content': 'PEhUTUw+PEhFQUQ+PFRJVExFPjQwMSBVbmF1dGhvcml6ZWQ8L1RJVExFPjwvSEVBRD4KPEJPRFkgQkdDT0xPUj0iI2NjOTk5OSI+PEg0PjQwMSBVbmF1dGhvcml6ZWQ8L0g0PgpBdXRob3JpemF0aW9uIHJlcXVpcmVkLgo8L0JPRFk+PC9IVE1MPgo='}}
2018-10-28 21:16:20 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.1921564752] Received {'type': 'camera_thumbnail', 'entity_id': 'camera.gcam_mjpeg', 'id': 32}
Any advice or pointers to my buffoonery will be appreciated!
Mike