Node-Red Reolink JSON/HTTP Request help

I trying to get control of my PTZ preset viz Node Red. I know it can be done, but I cannot figure it out. Wondering if for some NR/JSON Guru can help. I need to be able to send the following data, mostly the “Request Payload” (don’t worry about the token I can send with u/p)


I tired using an inject node here is the setup and errors

It acts like it wants all that JSON data in the URL but I cannot figure out the formatting. Any and help appreciated.

@jchurch has reolink cameras that he does cool things with. He’s in the UK, but he’ll likely see this when he wakes up. Maybe he can give you a few pointers? I’m pretty jealous of his ingenuity with his platform.

2 Likes

Looks like you can do it using HTTP POST from Node-Red. I don’t have a Reolink PTZ camera to try it on but I see someone has done it at the end of this post. There is a Chrome extension called “Restman” that allows you to send a URL with POST body see if you can get it working there then move into Node-Red.

@april.brandt I am not in the UK I am in Australia I am offended :rofl: :joy: :rofl:

2 Likes

Yeah I been racking, my brain with that post by ‘Lord Business’. I Just can’t figure out how to get the JSON in correctly. Thanks for the tip on rest I’ll try it too.

1 Like

How dare she.!!!:grin::joy::rofl:

2 Likes

I knew that … i had a moment of … lack of coffee … er something.

1 Like

big thanks to @jchurch. Following his suggestion I found something they call “advanced REST client”. It was exactly what I needed to test the code until I got the correct one.

If anyone’s looking for resulting code it was (sent via payload to a http request node as POST
url - http://CAMERA_IP/cgi-bin/api.cgi?cmd=PtzCtrl&user=admin&password=YOURPASSWORD)…

[{"cmd":"PtzCtrl","action":0,"param":{"channel":0,"op":"ToPos","speed":32,"id":1}}]

Change ID# for each position you want to use.

Complete write-up with NR, HE, and smartly (dashboard overlay) controls to come.

1 Like