Extract numeric values from IP camera video streams using OCR (Optical Character Recognition). Perfect for monitoring displays like boiler temperatures, pressure gauges, energy meters, or any device with a digital/analog display.
- Video Stream Support: Connect to RTSP and HTTP video streams from IP cameras
- OCR Value Extraction: Automatically extract numeric values from camera images
- Region of Interest (ROI): Define specific areas of the frame to analyze
- Template Matching: Handle camera movement/rotation by using reference templates
- Auto-Discovery: Discover ONVIF-compatible cameras on your network
- Web UI Panel: Easy-to-use interface for configuration and ROI selection
- Home Assistant Integration: Exposes values as sensor entities for automations and monitoring
- Two Installation Methods: Available as both a Custom Integration and an Add-on
View all configured cameras and their extracted values at a glance.
Easily select the region of interest by clicking and dragging on the camera frame.
Configure camera settings, preprocessing options, and scan intervals.
Choose one of the following installation methods based on your needs:
| Method | Best For | Requires |
|---|---|---|
| Add-on | Home Assistant OS / Supervised | Nothing extra |
| Custom Integration | Any HA installation | Tesseract OCR on host |
This is the easiest method for Home Assistant OS and Supervised installations. The add-on runs in its own container with all dependencies included.
Click the button above, or follow the manual steps below:
- Go to Settings → Add-ons → Add-on Store
- Click the three dots menu (⋮) in the top right → Repositories
- Add this repository URL:
https://github.com/tursoft/ha-camera-data-extractor - Click Add → Close
- Find "Camera Data Extractor" in the add-on store and click it
- Click Install
- Configure your cameras in the Configuration tab
- Start the add-on
- Click Open Web UI to access the interface
cameras:
- name: Boiler Temperature
stream_url: rtsp://192.168.1.100:554/stream1
username: admin
password: your_password
value_name: Temperature
unit: °C
roi_x: 100
roi_y: 50
roi_width: 200
roi_height: 80
preprocessing: auto
- name: Pressure Gauge
stream_url: http://192.168.1.101/video
value_name: Pressure
unit: bar
scan_interval: 30
log_level: infoFor advanced users or non-OS installations who want sensor entities.
Click the button above, or follow the manual steps below:
- Open HACS in Home Assistant
- Click the three dots menu (⋮) → Custom repositories
- Add
https://github.com/tursoft/ha-camera-data-extractoras an Integration - Search for "Camera Data Extractor" and install
- Restart Home Assistant
- Go to Settings → Devices & Services → Add Integration
- Search for "Camera Data Extractor" and configure
For manual installation without HACS.
- Download the latest release from GitHub
- Extract and copy the
custom_components/camera_data_extractorfolder to your Home Assistant'scustom_componentsdirectory - Restart Home Assistant
Note: If you installed the Add-on, skip this section - all dependencies are included.
The custom integration requires Tesseract OCR to be installed on your Home Assistant system.
Tesseract should be available automatically. If not, you may need to install it via the terminal add-on:
apk add tesseract-ocrAdd Tesseract to your Docker image or mount it from the host:
apt-get install tesseract-ocrInstall Tesseract on your system:
# Ubuntu/Debian
sudo apt-get install tesseract-ocr
# Fedora
sudo dnf install tesseract
# macOS
brew install tesseract-
Go to Settings → Devices & Services → Add Integration
-
Search for "Camera Data Extractor"
-
Enter your camera details:
- Camera Name: A friendly name for your camera
- Stream URL: The RTSP or HTTP URL of your camera stream
- RTSP example:
rtsp://192.168.1.100:554/stream1 - HTTP example:
http://192.168.1.100/video
- RTSP example:
- Username/Password: Optional credentials for camera authentication
-
Configure extraction settings:
- Value Name: Name for the extracted value (e.g., "Temperature")
- Unit of Measurement: Unit for display (e.g., "°C", "bar", "%")
- Scan Interval: How often to capture and analyze frames (seconds)
- Preprocessing: Image preprocessing method for better OCR accuracy
-
Set up the Region of Interest (ROI):
- Set coordinates to define the area containing the value
- Use the Web UI panel for visual selection (recommended)
After installation, a new Camera Data Extractor panel appears in your Home Assistant sidebar.
- Cameras Tab: View configured cameras and capture live frames
- ROI Selection Tab:
- Click and drag on the frame to select the region containing the value
- Fine-tune using the coordinate inputs
- Save as a template for cameras that may move
- Templates Tab: Manage saved templates and test template matching
- Discovery Tab: Scan your network for ONVIF cameras
If your camera can pan/tilt/zoom, use template matching to find the correct region even when the camera moves:
- Position your camera to show the display
- Go to the ROI Selection tab
- Select the region containing the value
- Enter a template name and click "Save as Template"
- Use the
camera_data_extractor.use_templateservice to update the ROI based on the current camera position
| Brand | Typical RTSP URL |
|---|---|
| TP-Link Tapo | rtsp://user:pass@IP:554/stream1 (HD) or stream2 (SD) |
| Hikvision | rtsp://user:pass@IP:554/Streaming/Channels/101 |
| Dahua | rtsp://user:pass@IP:554/cam/realmonitor?channel=1&subtype=0 |
| Reolink | rtsp://user:pass@IP:554/h264Preview_01_main |
| Amcrest | rtsp://user:pass@IP:554/cam/realmonitor?channel=1&subtype=0 |
| Ubiquiti | rtsp://user:pass@IP:554/live |
| Generic ONVIF | rtsp://user:pass@IP:554/stream1 |
Note for Tapo cameras: You must create a "Camera Account" in the Tapo app (Settings → Advanced Settings → Camera Account). Use these credentials for RTSP access, not your TP-Link account credentials.
Immediately capture a frame and update the sensor value.
service: camera_data_extractor.capture_frame
data:
entity_id: sensor.boiler_temperatureUpdate the Region of Interest coordinates.
service: camera_data_extractor.update_roi
data:
entity_id: sensor.boiler_temperature
roi_x: 100
roi_y: 50
roi_width: 200
roi_height: 80Find and apply ROI from a saved template (for moving cameras).
service: camera_data_extractor.use_template
data:
entity_id: sensor.boiler_temperature
template_name: boiler_displayEach sensor provides these attributes:
| Attribute | Description |
|---|---|
raw_text |
Raw text extracted by OCR |
confidence |
OCR confidence percentage |
last_frame_time |
Timestamp of last analyzed frame |
camera_name |
Name of the camera |
roi_x, roi_y, roi_width, roi_height |
Current ROI coordinates |
preprocessing |
Preprocessing method used |
stream_url |
Camera stream URL |
automation:
- alias: "Boiler Temperature Alert"
trigger:
- platform: numeric_state
entity_id: sensor.boiler_temperature
above: 80
action:
- service: notify.mobile_app
data:
title: "Boiler Alert"
message: "Temperature is {{ states('sensor.boiler_temperature') }}°C!"automation:
- alias: "Log Boiler Temperature"
trigger:
- platform: state
entity_id: sensor.boiler_temperature
action:
- service: logbook.log
data:
name: Boiler
message: "Temperature changed to {{ states('sensor.boiler_temperature') }}°C"automation:
- alias: "Update Boiler Camera ROI"
trigger:
- platform: time_pattern
minutes: "/5"
action:
- service: camera_data_extractor.use_template
data:
entity_id: sensor.boiler_temperature
template_name: boiler_display| Option | Description | Best For |
|---|---|---|
auto |
Automatically determines best method | General use |
none |
No preprocessing | Clear, high-contrast displays |
threshold |
Binary threshold (Otsu's method) | LCD/LED displays |
adaptive |
Adaptive threshold | Varying lighting conditions |
invert |
Inverted colors | Light text on dark background |
- Adjust ROI: Make sure the ROI tightly frames only the numeric display
- Try Different Preprocessing: Switch between
auto,threshold, andadaptive - Improve Lighting: Ensure adequate lighting on the display
- Increase Resolution: Use a higher resolution stream if available
- Check Decimal Places: Adjust the decimal places setting
- Verify Stream URL: Test the URL in VLC or another media player
- Check Credentials: Ensure username/password are correct
- Firewall Rules: Make sure Home Assistant can reach the camera
- RTSP Port: Default is 554, but some cameras use different ports
- Retake Template: Capture a new template in good lighting
- Check Confidence: If confidence is low, the camera view may have changed too much
- Reduce Movement: Template matching works best with small position changes
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Muhammet Turşak Email: tursoft@gmail.com Website: https://tursoft.net



