kerberos-io / machinery

(DEPRECATED) An open source image processing framework, which uses your USB-, IP- or RPi-camera to recognize events (e.g. motion).
https://www.kerberos.io
490 stars 104 forks source link

Error processing webhook in Home Assistant #211

Open vazquezjm opened 4 years ago

vazquezjm commented 4 years ago

Hi!

As per the docs (https://doc.kerberos.io/opensource/machinery#output-1), the payload of the JSON has this format:

[
'regionCoordinates' : [618, 317, 703, 493],
'numberOfChanges' : 5446,
'timestamp' : '1465894497',
'microseconds' : '5-97451',
'token' : 695,
'pathToImage' : '1465894497_5-97451_frontdoor_618-317-703-493_5446_695.jpg',
'instanceName' : 'frontdoor',
]

(single quotes)

BTW: the last key/value pair in the example has an ending comma and JSON object is not surrounded by curly braces {}

When I try to trigger an automation in Home Assistant, I get an error about the quotes (requires double quotes), so if I change the example payload to what is shown below, automation works fine (tried on an API test tool):

{
"regionCoordinates" : [618, 317, 703, 493],
"numberOfChanges" : 5446,
"timestamp" : "1465894497",
"microseconds" : "5-97451",
"token" : 695,
"pathToImage" : "1465894497_5-97451_frontdoor_618-317-703-493_5446_695.jpg",
"instanceName" : "frontdoor"
}

How can I have Kerberos to send single quotes?