IPC-T54IR-ZE-S3 - AI Send Command to Openhab

oak guy

n3wb
Feb 22, 2018
18
4
Hi. My cameras are not behind an NVR. I'm trying to use the SEND COMMAND under the AI IVS settings. I want to send a command to my Openhab server to trigger an item action using it's REST api. When I select the Server (already setup) it populates the first part of the Command field. I copy my CURL command in the next field. My CURL command is not running but is tested outside of the camera interface and works perfectly. Will CURL commands execute this way? The Openhab server is added to the Server Config setup, enabled, and tested ok for communication.


The command string:

curl -X 'POST' \ '' \ -H 'accept: /' \ -H 'Content-Type: text/plain' \ -d 'ON'

Note copying the curl command in proper field changes the formatting then pasting that string into a terminal, I get a malformed URL error:

curl -X 'POST' \ '' \ -H 'accept: /' \ -H 'Content-Type: text/plain' \ -d 'ON'

curl: (3) URL rejected: Malformed input to a URL function

What actually works in a terminal:

1749764538326.png
I must have to insert new line characters?


Any ideas would be great! Below was an attempt to combine both fields if the camera was combining both fields internally.

Screenshot 2025-06-12 at 4.34.07 PM.png

Thanks

Guy
 
Hi! I have to type it in as one line in the camera interface. Dahua separates the server destination in one field and then the command to send in the next field. That alone messes up a Curl string.
 
Code:
command \
  parameter1=X \
  parameter2=Y

becomes

Code:
command parameter1=X parameter2=Y

But that is not going to work here anyways. The field behind the server is probably just the remainder of an URL, so you could make it like "rest/items/Patio_Lights_UPB_Level but OpenHAB has to know how to deal with this. It is not the same as your cURL POST. ChatGPT believes Dahua sends GET instead of POST. Very little documentation on this.
 
The remainder I did try and is what you see in the picture I posted originally. I did try the full url in the Command field as well. Hey, thanks for your help. Very little to no documentation on this is right. I may have to try a Wireshark capture so maybe I can see the string.