{"id":15660348,"url":"https://github.com/robmarkcole/hass-machinebox-classificationbox","last_synced_at":"2026-03-27T03:10:21.932Z","repository":{"id":43191055,"uuid":"135166048","full_name":"robmarkcole/HASS-Machinebox-Classificationbox","owner":"robmarkcole","description":"Home-Assistant image classification using Machinebox.io","archived":false,"fork":false,"pushed_at":"2022-07-05T04:19:34.000Z","size":14481,"stargazers_count":20,"open_issues_count":3,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2026-02-26T23:54:03.921Z","etag":null,"topics":["computer-vision","deep-neural-networks","home-assistant","home-automation","machinebox"],"latest_commit_sha":null,"homepage":"https://www.hackster.io/robin-cole/motion-activated-image-capture-and-classification-of-birds-6ef1ce","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/robmarkcole.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"robmarkcole"}},"created_at":"2018-05-28T13:40:09.000Z","updated_at":"2023-09-03T05:47:37.000Z","dependencies_parsed_at":"2022-08-24T14:36:00.508Z","dependency_job_id":null,"html_url":"https://github.com/robmarkcole/HASS-Machinebox-Classificationbox","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/robmarkcole/HASS-Machinebox-Classificationbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Classificationbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Classificationbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Classificationbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Classificationbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robmarkcole","download_url":"https://codeload.github.com/robmarkcole/HASS-Machinebox-Classificationbox/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robmarkcole%2FHASS-Machinebox-Classificationbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31013961,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-27T02:58:54.984Z","status":"ssl_error","status_checked_at":"2026-03-27T02:58:46.993Z","response_time":164,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["computer-vision","deep-neural-networks","home-assistant","home-automation","machinebox"],"created_at":"2024-10-03T13:21:11.880Z","updated_at":"2026-03-27T03:10:21.914Z","avatar_url":"https://github.com/robmarkcole.png","language":"Jupyter Notebook","funding_links":["https://github.com/sponsors/robmarkcole"],"categories":[],"sub_categories":[],"readme":"Home-Assistant image classification using [Classificationbox](https://machinebox.io/docs/classificationbox). Follow [this guide](https://blog.machinebox.io/how-anyone-can-build-a-machine-learning-image-classifier-from-photos-on-your-hard-drive-very-5c20c6f2764f ) to create a model/models on Classificationbox. This component adds an `image_processing` entity for each model you have created on Classificationbox, where the state of the entity is the most likely classification of an image using that model. An `image_processing.image_classification` event is fired when the confidence in classification is above the threshold set by `confidence`, which defaults to 80%.\n\nPlace the `custom_components` folder in your configuration directory (or add its contents to an existing custom_components folder).\n\nAdd to your HA config:\n```yaml\nimage_processing:\n  - platform: classificationbox\n    ip_address: localhost\n    port: 8080\n    username: my_username\n    password: my_password\n    confidence: 50\n    source:\n      - entity_id: camera.local_file\n```\n\nConfiguration variables:\n- **ip_address**: the ip of your Tagbox instance\n- **port**: the port of your Tagbox instance\n- **username**: (Optional) the username if you are using authentication\n- **password**: (Optional) the password if you are using authentication\n- **confidence** (Optional): The minimum of confidence in percent to fire an event. Defaults to 80\n- **source**: must be a camera.\n\n## Automations using events\n\nEvents can be used as a trigger for automations, and in the example automation below are used to trigger a notification with the image and the classification:\n\n```yaml\n- action:\n  - data_template:\n      message: Class {{ trigger.event.data.id }} with probability {{ trigger.event.data.confidence\n        }}\n      title: New image classified\n      data:\n        file: ' {{states.camera.local_file.attributes.file_path}} '\n    service: notify.pushbullet\n  alias: Send classification\n  condition: []\n  id: '1120092824611'\n  trigger:\n  - event_data:\n      id: birds\n    event_type: image_processing.image_classification\n    platform: event\n```\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/robmarkcole/HASS-Machinebox-Classificationbox/blob/master/usage.png\" width=\"650\"\u003e\n\u003c/p\u003e\n\n### Classificationbox\nGet/update Classificationbox [from Dockerhub](https://hub.docker.com/r/machinebox/classificationbox/) by running:\n```\nsudo docker pull machinebox/classificationbox\n```\n\nRun the container with:\n```\nMB_KEY=\"INSERT-YOUR-KEY-HERE\"\nsudo docker run -p 8080:8080 -e \"MB_KEY=$MB_KEY\" machinebox/classificationbox\n```\n\nTo run [with authentication](https://machinebox.io/docs/machine-box-apis#basic-authentication):\n```\nsudo docker run -e \"MB_BASICAUTH_USER=my_username\" -e \"MB_BASICAUTH_PASS=my_password\" -p 8080:8080 -e \"MB_KEY=$MB_KEY\" machinebox/classificationbox\n```\n\n#### Limiting computation\n[Image-classifier components](https://www.home-assistant.io/components/image_processing/) process the image from a camera at a fixed period given by the `scan_interval`. This leads to excessive computation if the image on the camera hasn't changed (for example if you are using a [local file camera](https://www.home-assistant.io/components/camera.local_file/) to display an image captured by a motion triggered system and this doesn't change often). The default `scan_interval` [is 10 seconds](https://github.com/home-assistant/home-assistant/blob/98e4d514a5130b747112cc0788fc2ef1d8e687c9/homeassistant/components/image_processing/__init__.py#L27). You can override this by adding to your config `scan_interval: 10000` (setting the interval to 10,000 seconds), and then call the `scan` [service](https://github.com/home-assistant/home-assistant/blob/98e4d514a5130b747112cc0788fc2ef1d8e687c9/homeassistant/components/image_processing/__init__.py#L62) when you actually want to process a camera image. So in my setup, I use an automation to call `scan` when a new motion triggered image has been saved and displayed on my local file camera.\n\n\n## Local file camera\nNote that for development I am using a [file camera](https://www.home-assistant.io/components/camera.local_file/).\n```yaml\ncamera:\n  - platform: local_file\n    file_path: /images/bird.jpg\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobmarkcole%2Fhass-machinebox-classificationbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobmarkcole%2Fhass-machinebox-classificationbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobmarkcole%2Fhass-machinebox-classificationbox/lists"}