Fun had with Vstarcam C7837WIP

Before a couple of days ago I was just like the people here: Help me for my ipcam Vstarcam C7837WIP and here: ieGeek IP C7837WIP cameras with Home Assistant , i.e. an owner of some impulse-buy 30$ 720p PTZ cameras that was struggling to get them working at more than the basic level of MJPEG in HA.

First of all, I managed to get ONVIF working, with this configuration.yaml entry:

ffmpeg:

camera:
  - platform: onvif
    host: X.X.X.X:10080/tcp/av0_0
    name: 'living_room'
    username: admin 
    password: XXXXXXX

The 10080 ONVIF port is standard on these cameras, however you also need to first find (use nmap with a full TCP port scan on your camera’s IP address) the web port, then enter the camera’s web UI, then set its networking to static IP. This will ensure that whatever crazy web port it uses will stay the same, otherwise at every restart or DHCP IP change, it will also get a new web port.

With that out of the way, the next challenge was goddamn PTZ. I would have expected the HA ONVIF component’s PTZ support to work, but it most certainly did not (I remember reading somewhere that these particular cameras give back crappy http headers, which don’t work with the existing ONVIF PTZ component in HA).

Thus, I went for the agricultural approach and entered the camera web UI in Chrome, opened Chrome Dev Tools, went to the Network tab, set a position preset in the web UI and looked at what http request came out when I pressed the preset button in the web UI.

After cleaning it up a bit, the request looked like this: http://YOUR_IP:YOURCAMERWEBPORT/decoder_control.cgi?loginuse=YOURUSER&loginpas=YOURPASS&command=35&onestep=0

Then I used the REST component in configuration.yaml:

rest_command:
  living_room_camera_room_view:
    url: http://YOUR_IP:YOURCAMERWEBPORT/decoder_control.cgi?loginuse=YOURUSER&loginpas=YOURPASS&command=35&onestep=0

Then I restarted HA.

Then I created a script that looked like this:

  living_room_camera_room_view:
    alias: Living Room Camera Room View
    sequence:
      - service: rest_command.living_room_camera_room_view

Then I created a Lovelace card with the camera as background and this (and other) buttons) overlaid on it:

  - cards:
      - camera_image: camera.living_room
        entities:
          - entity: script.living_room_camera_up
            icon: 'mdi:arrow-up-bold-box'
          - entity: script.living_room_camera_down
            icon: 'mdi:arrow-down-bold-box'
          - entity: script.living_room_camera_left
            icon: 'mdi:arrow-left-bold-box'
          - entity: script.living_room_camera_right
            icon: 'mdi:arrow-right-bold-box'
          - entity: script.living_room_camera_room_view
            icon: 'mdi:sofa'
          - entity: script.living_room_camera_back_to_wall
            icon: 'mdi:wall'
        title: Living Room
        type: picture-glance

The other buttons I obtained via exactly the same procedure as the preset used in the living_room_camera_room_view one - you press the arrow in the camera’s web UI, capture the HTTP request then keep clicking on it in HA to get the movement you need.

BTW, I made an automation which turns the camera towards the wall when in “Home” mode and towards the room when in “Away” mode, thus hopefully mitigating any hacking (while at home) issue, as the camera would physically have to be pointed in my face to be able to see anything other than the wall :slight_smile:

Hope this helps someone!

3 Likes

Just what I needed! I have the exactly same camera!

But I’ve ran into a problem! In the log it says “FFmpeg isn’t running!”

I’ve put the path to ffmpeg in configuration.yaml, but I suspect that it might be a problem that I’m running Hass.io in Docker on Ubuntu and I don’t know how to fix that.

Do you have any ideas, since you seem to be a smart guy :wink:

I have the same setup (Ubuntu + Docker + HASS. IO), get the same message with ffmpeg and…ignore it :smiley: The camera itself works in ONVIF mode as described above despite the ffmpeg error in the log…does yours not show its feed in the UI or the entity in States?

BTW, I didn’t use any path or parameter for ffmpeg, simply “ffmpeg:” in configuration.yaml

hi.
this is my configuration:

camera:

thi configuration working, but i don’t listen nothing because the audio isn’t configured.
you have the better configuration for this camera?

I don’t actually use sound from cameras in HA, but definitely through MJPEG it isn’t possible to also get sound, as the MJPEG standard itself doesn’t support sound…have you tried the ONVIF configuration I wrote at the beginning of the thread?

i don’t try your configuration…
tomorrow i try …
thx

Fixing the camera’s IP address to static is important - good advice!

I tried johnflorin’s ONVIF port 10080 setup and unfortunately my home assistant wasn’t able to get an image. I don’t know why.

I also tried ethaniel’s mjpeg setup which also didn’t work, this gave some errors on the home assistant console and I assume that my mjpeg_url port is different.

Therefore I’ve gone back to using the still_image_url with digest authentication.

How do you do it with the still image with digest?
I didnt get much succes with the two methods above too.

Hi azel_inc, the method which works for me is at ieGeek IP C7837WIP cameras with Home Assistant. Good luck!

thanks @nabster
i managed to get it working using onvif platform. but wondering if generic works to, will give that a try once i m home later today. thanks!

I used the following config:

  • platform: onvif
    host: rtsp://192.168.1.11:10080/udp/av0_0
    name: ‘Camera’
    username: admin
    password: XXXXX

And I got the following error:
Cannot connect to host rtsp:80 ssl:None [getaddrinfo failed]

In your case, I think the host should be 192.168.1.11:10080/tcp/av0_0, not rtsp://192.168.1.11:10080/udp/av0_0 , why the rtsp and udp?

This is in the config page of the VStarcam C7837WIP… tcp doesn’t exist/work…

But the RTSP stream is different to the ONVIF stream, as far as I know…how about just 192.168.1.11:10080/udp/av0_0, without the rtsp?

Doesn’t work…

I tried this:

  - platform: onvif
    host: 192.168.1.11:10080/tcp/av0_0
    name: "Ver2"
    username: admin
    password: XXXXXX

I’m not getting any image… and no error…

I got this shaky error when trying to add via integration, also already add the recommend line in .yaml please help how to fix this. thanks.

Hi I have the onvif working by the integration and the feed is working how to I get the ptz controls and a card to view the camera with ptz control please ( I have not had to touch the config file as the natural intergraction worked