I haven’t yet setup a working binary_sensor with the appropriate rest parameters. But, I finally got a curl command to work so I’m sharing it. Chances are someone else has already posted this information.
I submitted the following support request to Reolink:
NVR is sending email for person and vehicle detection as expected. But http://10.0.0.xxx/api.cgi?cmd=GetAiState&channel=1&user=admin&password=xxx returns an error [ { “cmd” : “Unknown”, “code” : 1, “error” : { “detail” : “not support”, “rspCode” : -9 } } ]. Why is GetAiState failing?
They responded that I needed to upgrade the NVR firmware to the attached file. They also sent the attached portion of the API documentation.
Here are the curl command and the response:
MBP-wifi:~ jalperin$ curl -s -k -X POST -H “Content-Type : application/json” -d “[{“cmd”:“GetAiState”,“param”:{“channel”:3}}]” “https://10.0.0.123/cgi-bin/api.cgi?cmd=GetAiState&user=admin&password=password”
[
{
“cmd” : “GetAiState”,
“code” : 0,
“value” : {
“channel” : 3,
“dog_cat” : {
“alarm_state” : 0,
“support” : 0
},
“face” : {
“alarm_state” : 0,
“support” : 0
},
“people” : {
“alarm_state” : 0,
“support” : 1
},
“vehicle” : {
“alarm_state” : 0,
“support” : 1
}
}
}
]
Hope this helps someone.