Custom component microsoft vision API

Sharing my custom component for the Microsoft Vision API
microsoft_vision component

I prefer my approach since it calls the API using a service you can trigger yourself, it is not calling the API frequently, it is easier to stay under the free tier

You will need the Azure API as describe in Microsoft Face Component

To configure it, add lines to your configuration.yaml

image_processing:
  - platform: microsoft_vision
    api_key: YOUR_AZURE_API _KEY
    azure_region: YOUR_AZURE_REGION
    services:
    - describe

It requires the camera component

To call the service from a script:
sequence:

  • service: image_processing.call_api
    data:
    entity_id: image_processing.describe
    camera_entity: camera.cam120
  • service: notify.notifyme
    data_template:
    message: I see ā€œ{{ states.image_processing.describe.attributes.description }}ā€

Under services, you can add more option, each option will add a new entity

  • analyze
  • describe
  • detect
  • recognizeText

The image processing platform has the scan service for triggered updates. But anyways, nice work. Tempted to submit as an official component?

Thanks for the feedback, this is my first python program, I would love to submit it as official component.
Might need some help though, I understand is not recommended making direct calls to external service, as Iā€™m calling the API with a requests.post()

Yes create a lib on pypi to handle the requests. I did this recently for the london tube component, lib at https://github.com/robmarkcole/London-tube-status

Is this still working on 0.90? Just trying to set it up and I dont see the call_api service under image_processing. If I try call the describe service directly i get this error
"Error call service, home assistant api error. Error Message: 'NoneType' object has no attribute 'content'"