Setting up Reolink cameras and hub

Hello @Will_71

I hope I haven’t contacted the wrong person (sorry if I have).

I have 4 Reolink cameras (one wired and 3 Wi-Fi).

They are all connected to a Reolink hub for video and image storage.

I installed the Reolink integration under Gladys (I’m currently on HA but I would like to migrate to Gladys in the long run as I find the product more intuitive even if I’m still missing some features) but I can’t get my cameras detected.

I tried the configuration by entering the hub address and then another configuration by entering the IP address of my Ethernet-connected camera, but the scan doesn’t find any cameras (note that the 3 Wi-Fi cameras do have an IP address, but it’s not an address from my local network).

Are there any tricks to know for the configuration? A specific configuration when you have a hub?

Under HA, I had just configured the hub, but I think it’s different under Gladys.

Thanks for your help

Re,

I think I have my answer, actually.

I checked on GitHub and, apparently, the integration does not support the homehub.

@filbou40 I took the liberty of changing the title to make it more explicit.

Hi @filbou40,

You haven’t mixed up the person. To be honest, I don’t have an answer about the hub for now. I have a camera myself and it was recognized right away.
But we’ll try to make sure you get your hub back like on Home Assistant. I won’t be available for the next 4 days but as soon as I can, I’ll reach out to you to run some tests if that’s okay with you.

In the meantime, could you specify the models of your hub and cameras?
Thanks in advance.

Thanks @Will_71 for your feedback,

For my part, I’m going on vacation tomorrow for 10 days, so I won’t be really available during these 10 days (but, in any case, there’s no urgency :wink:

When I get back, I’ll of course be available to do the tests you want.

I have a home hub version 1 (Reolink Home Hub - Centre de surveillance sans fil avec stockage local chiffré et gestion multi-appareils | Reolink Officiel) to which I have connected:

  • an Argus 3 Ultra
  • a battery-powered video doorbell (powered by solar panel)
  • an RLC-510A
  • 2 E1 Zooms (one of which is powered by solar panel).

The RLC is connected to a powerline adapter

I can of course give you more precise information (configuration on the home hub) if you wish.

Thanks again

Okay, thanks. Have a good vacation and I’ll keep you posted about the tests.

Hello @filbou40,

Good news: I made progress on Home Hub support during your absence. It’s implemented and tested on the code side, all that’s left is validation on your actual hardware.

What has been done

The integration can now recognize a Home Hub (or an NVR) and list the cameras behind it. Each camera becomes a distinct Gladys device, with its own features depending on the model — the battery on the Argus 3 Ultra, the button on the Video Doorbell, the PTZ presets on the E1 Zoom, etc. The RTSP stream and snapshots each point to the right channel.

Two points required some care:

  • Camera identity. The channel number is a position, not an identity: a re-paired camera can change place, and Gladys devices identified by the channel would then silently point to the wrong camera. I therefore use the UID specific to each camera when the hub announces it.
  • Battery-powered cameras. The hub knows if a camera is sleeping and responds on its behalf during this time. Waking up a camera is much more expensive than the query itself, so a sleeping camera is excluded from automatic refresh — but remains consultable when you open its widget. This is important for your installation, with the Argus and the Doorbell on solar power.

I simulated your complete setup (Hub + Argus 3 Ultra + Doorbell + RLC-510A + 2 E1 Zoom) and the 5 cameras come out as 5 distinct devices.

What I need from you

The code relies on the documented response format, but I don’t have a Home Hub on hand to check what yours actually returns. Two fields are optional depending on the firmware versions, and I’d like to confirm they are present on yours.

If you can run these two commands from a machine on your network (replacing the IP and password):

curl -k -s -X POST "http://<hub-ip>/cgi-bin/api.cgi?cmd=Login" \
  -d '[{"cmd":"Login","action":0,"param":{"User":{"userName":"admin","password":"YOUR_PASSWORD"}}}]'

The response contains a « name » in the Token block — this is the token to use in the second command:

curl -k -s -X POST "http://<hub-ip>/cgi-bin/api.cgi?cmd=GetChannelstatus&token=THE_TOKEN" \
  -d '[{"cmd":"GetChannelstatus","action":0,"param":{}}]'

Remember to remove the password from the output before pasting it here. Camera UIDs are not sensitive, but you can also partially mask them if you prefer — I just need to know if the uid and sleep fields are filled, not their exact value.

If your hub is HTTPS only, replace http:// with https:// (the -k is already there for the self-signed certificate).

With that, I’ll be able to confirm everything fits and propose a version for you to test. No rush, take your time coming back from vacation!

Hi @Will_71,

Great. I’ll check it out when I’m back (earliest next Tuesday, but more likely Wednesday) and I’ll get back to you.

Cheers

Hello,

Thanks for this integration!

I have a solar Argus 4 Pro camera that runs on battery. Is it compatible without a hub?

I tried connecting it but without success. I’m even wondering if I’m using the correct login/password…

Be careful with battery-powered cameras, for example with TAPO the RTSP stream is not allowed otherwise the battery drains too quickly, I think it’s similar for Reolink

Yes, I confirm. Thanks for your reply.

Hi @Will_71,

Well, I tried running the command on my Windows laptop, but the command runs without any output (no messages). However, it takes a bit of time to return control, so I imagine it’s running.

do you think I should test it on a Linux machine? In that case, I need to find one :smiling_face:.

Thanks

complete.

I ran the command in a regular (non-admin) window.

I tried again in an admin command window and got this:

Invoke-WebRequest: No parameter found with the name « k ».
At line:1 char:6

  • curl -k -s -X POST « https://192.168.1.69/cgi-bin/api.cgi?cmd=Login » - …
  •  ~~
    
    • CategoryInfo : InvalidArgument : (:slight_smile: [Invoke-WebRequest], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

ok, let’s start over. Ignore previous messages.

However, under Windows, in an admin CMD window, I get this:

[
{
« cmd » : « Login »,
« code » : 1,
« error » :
{
« detail » : « please login first »,
« rspCode » : -6
}
}
]

et ça en http (le précédent était en https)

302 Found

302 Found


nginx

Hi @filbou40,

No worries, you didn’t break anything — the hub is responding correctly, it’s just that the command arrives empty on its end.

Here’s what’s happening. Under Windows, cmd.exe doesn’t understand single quotes ‹ … › that I had around the -d (it’s a Linux/macOS syntax). So the JSON with your identifier and password is sent in pieces, the hub sees no identifier, and it logically responds please login first. Nothing to do with your password or your config.

For the HTTP 302 Found: it’s normal, your hub forces HTTPS. So you must keep https://, and it’s useful information for me — I’ll check that the integration handles this case well.

The corrected commands for Windows. To run in a CMD window (not PowerShell — in PowerShell, curl is an alias that doesn’t know the same options, hence the error « Could not find a parameter that matches parameter name ‹ k › » from your previous message). A normal window is enough, no need for admin.

All on one line, and internal quotes are properly escaped by " and replacing the password:

curl -k -s -X POST "https://192.168.1.69/cgi-bin/api.cgi?cmd=Login" -H "Content-Type: application/json" -d "[{\"cmd\":\"Login\",\"action\":0,\"param\":{\"User\":{\"userName\":\"admin\",\"password\":\"YOUR_PASSWORD\"}}}]"

This time you should receive a Token block containing a name — it’s the token to report in the second command, in place of THE_TOKEN:

curl -k -s -X POST "https://192.168.1.69/cgi-bin/api.cgi?cmd=GetChannelstatus&token=THE_TOKEN" -H "Content-Type: application/json" -d "[{\"cmd\":\"GetChannelstatus\",\"action\":0,\"param\":{}}]"

The token expires after a while, so chain the two commands without waiting too long.

What interests me in the response. It’s the output of the second command. Remember to remove your password from the first before pasting anything. For the camera UIDs, you can truncate them if you prefer — I mainly need to know if the uid and sleep fields are filled for each channel, not their exact value.

Thanks

Hi @Will_71,

Here is the response to the second command:

[
{
« cmd » : « GetChannelstatus »,
« code » : 0,
« value » :
{
« count » : 8,
« status » :
[
{
« channel » : 0,
« name » : « Garden Opening »,
« online » : 1,
« sleep » : 0,
« uid » : « 9527000IWMNL1B1K »
},
{
« channel » : 1,
« name » : « porch camera »,
« online » : 1,
« sleep » : 1,
« uid » : « 9527000KN95C1JG7 »
},
{
« channel » : 2,
« name » : « Gate »,
« online » : 1,
« sleep » : 1,
« uid » : « 9527000ICVT7S58V »
},
{
« channel » : 3,
« name » : « living room »,
« online » : 1,
« sleep » : 0,
« uid » : « 9527000IXL6TIQIB »
},
{
« channel » : 4,
« name » : « veranda »,
« online » : 1,
« sleep » : 0,
« uid » : « 9527000IXL7E1YS3 »
},
{
« channel » : 5,
« name » : «  »,
« online » : 0,
« sleep » : 0,
« uid » : «  »
},
{
« channel » : 6,
« name » : «  »,
« online » : 0,
« sleep » : 0,
« uid » : «  »
},
{
« channel » : 7,
« name » : «  »,
« online » : 0,
« sleep » : 0,
« uid » : «  »
}
]
}
}
]

Okay, now we have a response from your hub. I’ll check in the afternoon and let you know when the next version is ready.

OK. Thanks and no urgency of course.

Thanks a lot, this answer is very enlightening. :+1:

It confirms that the hub is indeed detected and that the 5 cameras are correctly seen, with their UID and their sleep state (« camera porche » and « Portail » were sleeping at the time of the test, which is normal for battery models).

You mentioned that Home Assistant retrieves everything well: I went to see how they do it, and it gave me the answer. Your firmware does not return the typeInfo field in the channel list, but there is another command, GetChnTypeInfo, which gives the channel model one by one. That’s the one I should have used from the start.

:warning: To run in cmd.exe, not in PowerShell (curl is an alias there that doesn’t understand -k). The token expires after one hour: if you get please login first (code -6), repeat step 1.

Step 1 — retrieve a token (replace the password):

curl -k -s -X POST "https://192.168.1.69/cgi-bin/api.cgi?cmd=Login" -H "Content-Type: application/json" -d "[{\"cmd\":\"Login\",\"action\":0,\"param\":{\"User\":{\"userName\":\"admin\",\"password\":\"YOUR_PASSWORD\"}}}]"

Look for « name » in the Token block: that’s your token.

Step 2 — the type of each camera (replace LE_TOKEN):

curl -k -s -X POST "https://192.168.1.69/cgi-bin/api.cgi?cmd=GetChnTypeInfo&token=LE_TOKEN" -H "Content-Type: application/json" -d "[{\"cmd\":\"GetChnTypeInfo\",\"action\":0,\"param\":{\"channel\":0}},{\"cmd\":\"GetChnTypeInfo\",\"action\":0,\"param\":{\"channel\":1}},{\"cmd\":\"GetChnTypeInfo\",\"action\":0,\"param\":{\"channel\":2}},{\"cmd\":\"GetChnTypeInfo\",\"action\":0,\"param\":{\"channel\":3}},{\"cmd\":\"GetChnTypeInfo\",\"action\":0,\"param\":{\"channel\":4}}]"

It queries the hub and not the cameras: those that are sleeping will not be woken up. It’s the type field of each ChnTypeInfo block that interests me.

This should be enough for me to automatically identify your doorbell and add the « doorbell button » capability. Thanks again, your comment about Home Assistant put me on the right track.