2023-01-09

Getting a Tuya based video doorbell integrated into Home Assistant


A while back my step father gifted me a Geeni Merkury Doorbell (The CW014 before it got renamed to Doorpeek).  Geeni is basically a Wal-Mart rebrand of Tuya smart home equipment.  So instead of using the actual Geeni app I just used the Smart Life app and figured Home Assistant would add it to my devices like the plugs I already have with the Tuya integration.

However, doorbells aren’t officially supported by the Tuya integration and the information in the Smart Life app wasn’t helping either.  It didn’t even give me the internal IP address. It only contained the external IP address of my modem.

It took a some digging to find the resources I needed and piece it together.  So I figured I’d share the process in case anyone else was looking to do something similar.

Find the IP Address

I used Net Analyzer (for iOS) but you can use WireShark or even the list of devices on your router.  I just went through the list of unknown IP addresses


Login to Web UI

The next step is to login to the web based user interface.  I just had to type in the ip address into the address bar and it came up.  If that doesn’t work for you the try using the iSpy Camera Connection Database.  This is a great idea because this is how I discovered the login credentials for my camera.

Accounts

You’ll definitely want to change the default admin password and create a second basic account with less rights to access the feed.  That way if anyone ever gets your credentials they only have your visitor account.

Once I logged into the web portal I clicked the gear icon above the video feed.  I then click on the Setup heading to expand it and then clicked on User Permissions.

On the password line for the admin account I entered a new password.  Then on the next line I created a guest account with a password.  Then I clicked on the permissions line to make sure the drown down option was Visitor.  And then click Save.

Video Stream URL

Now for the important part, finding the URL to the video stream.  The first thing you need to do is navigate back to the video stream.  For me that meant clicking on the Video Camera icon on the tabs at the top of the screen.  I then right-clicked the center of the video and selected "Inspect" since I was using Chrome.  The section of code that is highlighted should be what you're looking for.  For me this was the format I found:

http://[Device IP Address]:8099/cgi-bin/videostream.cgi&user=[Username]&pwd[Password]

So just copy that URL to your clipboard and you're ready for the next step.  I also saved it into the documentation I keep for ALL my Home Assistant Integrations

Use MJPEG Integration

Now we just add the stream URL to the MJPEG integration in Home Assistant and we will be ready to go!

Method 1 - Automated

  1. If you are on the same network as your Home Assistant instance then you can just go to the web page for the MJPEG integration and click the  button.
  2. Follow the directions to be navigated to Home Assistant webpage or mobile app
  3. Enter a unique name you want to use for the camera
  4. Paste the URL you copied earlier into the line labelled MJPEG URL
  5. Click Submit
Method 2 - Manual
  1. Open your Home Assistant instance (via webpage or app)
  2. Navigate to Settings... Devices & Services... Click the blue "+ Add Integration" button at the bottom right of the window.
  3. Enter a unique name you want to use for the camera
  4. Paste the URL you copied earlier into the line labelled MJPEG URL
  5. Click Submit

Then you can just search for that device by name and add it to whichever dashboard you want.  I just searched the devices list, clicked on the device to open its page and then clicked "Add To Dashboard" and used the default entity (picture-entity).

Good luck automators!

No comments: