A powerful Home Assistant custom integration for the Energy OWL CM160 energy meter, providing real-time current monitoring and comprehensive historical data analysis.
- Live Current Readings: Get electrical current measurements every 15 seconds
- Device Status Tracking: Monitor connection status and error reporting
- Automatic Reconnection: Robust error handling with automatic reconnection
- Historical Data Collection: Automatic collection of timestamped historical readings
- Progress Monitoring: Track historical data sync with dedicated diagnostic sensor
- Event-Driven Integration: Real-time events for Home Assistant automations
- Data Services: Programmatic access to historical data via services
- Energy Dashboard Compatible: Perfect for Home Assistant's Energy dashboard
- Multiple Sensors: Current sensor + diagnostic sensors for comprehensive monitoring
- Device Registry: Proper device identification and management
- Configuration Flow: Easy setup through Home Assistant UI
- Home Assistant: Version 2024.11.0 or later
- Hardware: Energy OWL CM160 device connected via USB/Serial
- Dependencies: Automatically managed through HACS
- Install HACS if not already installed
- Add Custom Repository:
- Go to HACS β Integrations
- Click the three dots menu β Custom repositories
- Add:
https://github.com/PBrunot/energy_owl_hacs - Category: Integration
- Install Integration:
- Search for "Energy OWL" in HACS
- Click Install
- Restart Home Assistant
- Download the latest release from GitHub Releases
- Extract to
custom_components/energy_owl/in your Home Assistant config directory - Restart Home Assistant
- Connect the CM160 to your Home Assistant machine via USB
- Note the port path:
- Linux: Usually
/dev/ttyUSB0or/dev/ttyUSB1 - Windows: Usually
COM3,COM4, etc. - VM Users: Ensure USB device is bridged to the VM
- Linux: Usually
π‘ Tip: On Linux, run
dmesg | grep ttyafter connecting to find the port
-
Add Integration:
- Go to Settings β Devices & Services
- Click "Add Integration"
- Search for "Energy OWL"
- Enter your serial port path (e.g.,
/dev/ttyUSB0)
-
Wait for Initial Sync:
- The device sends historical data first (may take several minutes)
- Real-time data starts after historical sync completes
- Monitor progress with the "Historical Data Status" sensor showing "Syncing (X records)" β "Complete"
| Entity | Type | Description |
|---|---|---|
CM160 - Current |
Sensor | Real-time current measurement (Amperes) |
CM160 - Historical Data Status |
Diagnostic | Historical data sync status with progress |
The integration fires the following events for automation:
energy_owl_historical_data: Fired for each historical recordenergy_owl_historical_data_complete: Fired when historical sync completes
automation:
- alias: "Historical Data Complete"
trigger:
platform: event
event_type: energy_owl_historical_data_complete
action:
service: notify.mobile_app_phone
data:
message: "Energy OWL historical data sync completed!"service: energy_owl.get_historical_data
target:
device_id: "your_device_id"
data:
clear_existing: falseservice: energy_owl.clear_historical_data
target:
device_id: "your_device_id"-
Create Power Helper:
- Go to Settings β Devices & Services β Helpers
- Add "Template" sensor:
template: - sensor: name: "CM160 Power" unit_of_measurement: "W" device_class: power state: "{{ states('sensor.cm160_current') | float * 230 }}"
-
Create Energy Helper:
- Add "Integration - Riemann sum integral" helper
- Source:
sensor.cm160_power - Method: Trapezoidal rule
- Unit: kWh
-
Add to Energy Dashboard:
- Go to Energy Dashboard
- Add your energy helper as consumption
| Issue | Solution |
|---|---|
| Port not found | Check device connection and port permissions |
| No data after setup | Wait for historical sync to complete (can take 5-10 minutes) |
| Connection errors | Verify port path and ensure no other software is using the device |
| Permission denied | Add Home Assistant user to dialout group on Linux |
Add to configuration.yaml:
logger:
logs:
custom_components.energy_owl: debug
owlsensor: debug- β Historical Data Support: Complete historical data collection and exposure
- β Event System: Real-time events for Home Assistant automations
- β Services: Get and clear historical data programmatically
- β Enhanced Monitoring: Progress tracking and status reporting
- β Best Practices: Following Home Assistant development standards
- v0.1.2: Basic real-time current monitoring
- v0.1.1: Initial HACS release
- v0.1.0: Initial release
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Energy OWL for creating the CM160 device
- owlsensor library for device communication
- Home Assistant community for integration standards
Need help? Open an issue or check the discussions.

