HA Integration for Obico ML REST API server addon. This integration allows you to turn any HA Camera entity into a source for Obico's AI 3D printing failure detection.
- Automatically detects 3D printing errors by periodically sending camera images to an external detection backend.
- Configurable detection interval, threshold, and camera entity.
- Provides three Home Assistant entities:
- Camera: Displays the image with detected errors.
- Binary Sensor: Indicates whether any errors have been detected.
- Sensor: Indicates detected failure confidence.
- Switch: Toggles communication with the detection API.
- Install HACS (Home Assistant Community Store) if you haven't already.
- Add this repository to HACS as a custom repository:
- Go to HACS > Integrations.
- Click on the three dots in the upper-right corner and select Custom repositories.
- Enter the URL:
https://github.com/nobodyguy/obico_ml_ha_integration
. - Choose Integration as the category.
- Search for Obico ML in HACS and install the integration.
- Restart Home Assistant.
Alternatively, you can manually copy the obico_ml_ha_integration
folder to your custom_components
directory.
To configure the integration:
- Go to Configuration > Integrations in Home Assistant.
- Click on the Add Integration button.
- Search for Obico ML and click on it to configure.
- Fill in the configuration parameters.
- API URL: The URL of the detection backend.
- Camera Entity: The camera entity used to capture images for error detection.
- Detection Interval: The interval (in seconds) between detection API calls.
- Detection Threshold: Optional. The threshold for error detection sensitivity.
Displays the image with detected 3D printing errors. This camera entity updates periodically based on the detection interval.
A binary sensor that indicates whether any errors have been detected. If errors are found in the image, the sensor will show on
, otherwise off
.
A numeric sensor that indicates detected failure confidence.
Allows you to enable or disable the periodic communication with the detection API to save HW resources. When switched off, error detection is paused.
# Example automation for detecting 3D printing failures
automation:
- alias: "Toggle Obico ML Detection based on Printer State"
trigger:
- platform: state
entity_id: sensor.prusalink
action:
- choose:
- conditions:
- condition: state
entity_id: sensor.prusalink
state: "printing"
sequence:
- service: switch.turn_on
target:
entity_id: switch.obico_ml_communication
- conditions:
- condition: not
conditions:
- condition: state
entity_id: sensor.prusalink
state: "printing"
sequence:
- service: switch.turn_off
target:
entity_id: switch.obico_ml_communication
- alias: "Notify on 3D printing failure"
trigger:
- platform: state
entity_id: binary_sensor.obico_ml_failure_detected
to: "on"
action:
- service: notify.notify
data:
message: "3D printing failure detected!"
data:
image: /api/camera_proxy/camera.obico_ml_detection_camera
If you encounter issues with the integration, check the Home Assistant logs for error messages. Common issues include:
- Camera entity not found: Ensure that the camera entity you configured is available and working.
- API communication issues: Verify that the detection backend is running and reachable by Home Assistant.
If you encounter any issues or have feature requests, please open an issue on the GitHub repository.
Contributions are welcome! Please open a pull request with any changes or improvements.
This project is licensed under the MIT License. See the LICENSE file for more information.
- Port predictions - https://github.com/TheSpaghettiDetective/obico-server/blob/release/backend/api/octoprint_views.py#L122
- Resize image