I have my Blueiris NVR all setup to work with deepstack for object detection. Blueiris then sends an MQTT message with the JSON response from deepstack to my home assistant.
Here is the JSON output that home assistant is receiving.
[
{
"api": "objects",
"found": {
"success": true,
"predictions": [
{
"confidence": 0.76804876,
"label": "car",
"y_min": 272,
"x_min": 655,
"y_max": 378,
"x_max": 856
}
],
"duration": 0
}
}
]
I am struggling to get this data into a usable format in home assistant. What I really want is to be able to access the “label” field and the “confidence” field, so that I can display a message like “Car detected in driveway. x% Confident.” Blueiris can send a “memo” (instead of full JSON) displaying a message like this, but I would like to be able to work with the JSON so I can do things like count the number of cars, and keep it more extensible.
I have tried numerous things with value templates, like below, but can’t seem to make it work.
- platform: mqtt
unique_id: farmvision_driveway
name: "farmvision_driveway"
state_topic: "farmvision/driveway"
value_template: "{{value_json.farmvision_driveway[0].found.predicitions[0].label}}"
I’m still trying to fully grasp value templates and json attributes in home assistant. Maybe I have a conceptual misunderstanding of how this is supposed to work.