Hello community,
I really need some help/advice on this problem. I have a Webhook call from platerecognizer containing the following data:
{"hook": {"target": "XXX", "id": 906, "event": "image.done"}, "data": {"processing_time": 28.196, "results": [{"box": {"xmin": 176, "ymin": 245, "xmax": 251, "ymax": 273}, "plate": "as6772", "region": {"code": "dk", "score": 0.046}, "score": 0.773, "candidates": [{"score": 0.773, "plate": "as6772"}, {"score": 0.705, "plate": "as67721"}, {"score": 0.676, "plate": "as3772"}, {"score": 0.65, "plate": "as6722"}, {"score": 0.622, "plate": "as37721"}, {"score": 0.6, "plate": "as67221"}, {"score": 0.553, "plate": "as3722"}, {"score": 0.517, "plate": "as37221"}], "dscore": 0.748, "vehicle": {"score": 0.605, "type": "Sedan", "box": {"xmin": 12, "ymin": 29, "xmax": 313, "ymax": 323}}}], "filename": "0702_MTBVi_upload.jpg", "version": 1, "camera_id": null, "timestamp": "2023-11-14T07:02:01.213Z"}}
I am attempting to extract information from the first spotted license plate and subsequently update a sensor with the information “plate”: “XXX”.
Next, I am attempting to save the image attached in the webhooks locally to a folder in Home Assistant.
I can successfully get Home Assistant to update an input_text
sensor with a pre-defined value using the following automation. However, I am encountering difficulties in adapting it to work with the plate data received from the webhook:
alias: "Opdater Anpr Sensor med Webhook"
trigger:
platform: webhook
webhook_id: "XXX"
action:
- service: input_text.set_value
target:
entity_id: input_text.plate_value
data:
value: "XXXX"
Your guidance on how to incorporate the dynamic plate data into this automation would be greatly appreciated.
Thanks.