Call Reolink Scenes from Home Assistant - Enable and disable PUSH alerts

Reolink cameras allow to change scenes from the App in order to enable/disable push alerts, recording, etc. with a touch of a button. This is very useful when leaving home or coming back so you don’t receive too many alerts when at home, for example:

I guess I could integrate it if I knew the URL code that is sent to the NVR from the App. However, I don’t know such URL. Is there any way to add some code into Home Assistant so these buttons are set as scripts or similar so I can call such scenes manually or through automations?

I could find a workaround to do what I wanted to do, which it was basically to be able to enable/disable PUSH alerts with buttons or even with an automation (for example, enabling them when leaving home and disabling them upon returning.

I must say that Reolink Support team was very helpful, as they shared with me a couple of documents where some CGI and URL commands where listed. They replied with the documents in just a few hours! It is not the first time that I ask them for support, so it is worth mentioning that they are always quick and efficient. It was not just a straight forward copy and paste though, but it helped a lot.

Just in case someone is interested, basically, I created the following rest_command entries in configuration.yaml. Do note that the payload has the right string that must be posted to the NVR URL for enabling/disabling PUSH state:

rest_command:
  reolink_push_on:
    url: !secret ReolinkURL
    payload: '[{"cmd":"SetPushV20","param":{"Push":{"enable":1}}}]'
  reolink_push_off:
    url: !secret ReolinkURL
    payload: '[{"cmd":"SetPushV20","param":{"Push":{"enable":0}}}]'

Then, I included the following in secrets.yaml in order to stay on the safe side, as the URL contains NVR user/password:

ReolinkURL: http://[HOST_OR_IP]:[PORT]/api.cgi?cmd=SetPushV20&user=admin&password=[NVR_PASSWORD]

Once done, the following services can be found in the Home Assistant environment:

  • rest_command.reolink_push_on
  • rest_command.reolink_push_off

With them, you can just create a couple of buttons that call such services and customize them with icons. Of course, you can also use them as actions for an automation.

My next challenge is to be able to refresh the current PUSH ON/OFF state so I can update some sort of icon or something according to current Reolink NVR state. But, with what I have already achieved, I am more than happy. :slight_smile:

Hope this helps someone!

1 Like

@sesardelaisla I found your post very interesting and the solution you posted is exactly what I’m trying to achieve. I have just one big issue when I test the rest call I get errors and nothing works as you can see from the attached pic.

Any ideas? My camera is a Reolink E1 Zoom

Thanks

Hi @smingoli,

I am not sure whether the E1 Zoom expects the same URL string as my Reolink NVR. Try to change “SetPushV20” for “SetPush” (it seems older software versions use this). If that doesn’t work, you can use Firefox web developer tools (network tab) to get what URL is specifically used for your camera model upon toggling the PUSH switch trough the camera web interface. Do feel free to ask whether you need further help. Good luck!

Thanks, you were right, checked with firefox and it’s “SetPush”. However it’s still not working. I think it has to something to do with authentication. The URL that I get from firefox is something like

http://192.xxx.xxx.xxx/cgi-bin/api.cgi?cmd=SetPush&token=7e3c8942539ba09

Also when trying to execute the post via postman this time I get:

[
{
"cmd" : "Unknown",
"code" : 1,
"error" : {
"detail" : "invalid user",
"rspCode" : -27
}
}
]

Looks like I have some studying to do :slight_smile:

Use the following URL format as stated in my second post in this thread:

http://[HOST_OR_IP]:[PORT]/api.cgi?cmd=SetPush&user=admin&password=[NVR_PASSWORD]

Do note that token variable cannot be used. Use &user=admin&password=[NVR_PASSWORD] instead (change your user according to you camera model).

Yes sure, that’s the way I called the rest API… I worded my post wrong

Server response is clear: you are using wrong credentials. Double check that you are using right credentials and that you are not skipping any character in the URL, like the ‘?’ symbol or any ‘&’.

You can also download the documents that Reolink Support shared with me with the link below. They were the ones I used to set up everything. I hope they also help you. :slight_smile:

Thanks for the docs… I’ll try and figure out what’s wrong.

How did you get those home and away buttons in your app? Is that only available with an NVR?

I am not sure… I have an NVR, so I cannot confirm whether they are available for standalone cameras. Just swipe down in the home screen and check whether you see that “Scenes” zone on top of the cameras thumbnail list.

EDIT: It looks like this “Scenes Mode” option is also available for standalone cameras:

Thanks. I found it. I had to drag down and it appeared. I am amazed i have not noticed this before. I have been using Reolink for quite a while now and i was always wandering why there was not an ability to set scenes like this for when you leave home and arrive etc. Now i find out its been there the whole time! haha

Did you get this working? I am trying to get it to work with a RLC-810a with no NVR but im not able to. Im struggling to work out how to get the URL in firefox in developers tool, but using both SetPush and SetPushV20 doesnt work.

Yes in the end I was able to make it work. For some reason the API didn’t like my password (it had some strage characters in it) . Once I changed the password to something easier everything worked fine.

This is my configuration:

defined the following in configuration.yaml

rest_command:
  reo_mansarda_push_on:
    url: !secret ReoMansardaURL
    payload: '[{"cmd":"SetPush","action":0,"param":{"Push":{"schedule":{"enable":1,"table":"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}}}}]'
  reo_mansarda_push_off:
    url: !secret ReoMansardaURL
    payload: '[{"cmd":"SetPush","action":0,"param":{"Push":{"schedule":{"enable":0,"table":"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}}}}]'
  reo_external_push_on:
    url: !secret ReoExternalURL
    payload: '[{"cmd":"SetPush","action":0,"param":{"Push":{"schedule":{"enable":1,"table":"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}}}}]'
  reo_external_push_off:
    url: !secret ReoExternalURL
    payload: '[{"cmd":"SetPush","action":0,"param":{"Push":{"schedule":{"enable":0,"table":"111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"}}}}]'

In my secrets.yaml added (I have 2 cams)

ReoMansardaURL: http://192.xxx.xxx.xxx/api.cgi?cmd=SetPush&user=admin&password=[PASSWORD]
ReoExternalURL: http://192.xxx.xxx.xxx/api.cgi?cmd=SetPush&user=admin&password=[PASSWORD]

then in made some test scripts:

reo_mansarda_enable_push:
  sequence:
  - service: rest_command.reo_mansarda_push_on
  - service: notify.stefano
    data:
      message: 'Telecamera Mansarda Push On'

reo_mansarda_disable_push:
  sequence:
  - service: rest_command.reo_mansarda_push_off
  - service: notify.stefano
    data:
      message: 'Telecamera Mansarda Push Off'

reo_external_enable_push:
  sequence:
  - service: rest_command.reo_external_push_on
  - service: notify.stefano
    data:
      message: 'Telecamera Esterna Push On'

reo_external_disable_push:
  sequence:
  - service: rest_command.reo_external_push_off
  - service: notify.stefano
    data:
      message: 'Telecamera Esterna Push Off'

I just ordered an NVR yesterday. It should be here by this evening. Let’s see if I can get that to work also :slight_smile:

Im still not able to get this to work. I can see the rest services created, and when i call them it shows successful but the push state on the camera doesnt change. Do you see the toggle change on the camera straight away or is there a delay? What cameras have you confirmed this works with?

I am using RLC-810A cameras connected to a RLN8-410 NVR, and it works fine. Could you paste the code you are using so we can check it?

By the way, I see how the state changes 1-2 seconds after pushing the button (after sending the command). However, sometimes the state is not consistent and refreshed across all Reolink interfaces (iOS App, web interface and Reolink OSX client). The one that it always refreshes is the Reolink iOS App. You have to quit the configuration page and come backup for it to be refreshed though, as the state is not dynamically updated. It looks like it is queried upon entering the config page.

Just one quick question. Where do you check the toggle? In the web browser or in the mobile app? I’m asking because I noticed that the API calls don’t change the status of the toggle in the mobile app when checking the status of a single camera. It toggles if you are checking the NVR.

However if you enable motion detection in the app and then you use the API to toggle motion detection on/off you will see that in the web browser motion detection goes on/off accordingly while the motion detection in the mobile app will stay on. Everything still works though. Meaning that Motion detection on in both the mobile app and web browser you get notification. Motion detection on in the mobile app and off in the browser no notification.

The cameras I use are E1 Zoom and RLC-520.

As said in my previous post, I usually check it in the mobile app.

Hi,
I use reolink camera and i would like to know if it’s possible to activate/desactivate push notification with only a http link. I’am a beginer and i don’t understand all this post.

How have i to customize this link : http://[HOST_OR_IP]:[PORT]/api.cgi?cmd=SetPushV20&user=admin&password=[NVR_PASSWORD]

Sorry for my english, i’m french.