Signed-off-by: bullshit <coding@ow-software.pl>
ESPHome Components Collection
A collection of production-ready ESPHome components for various hardware integrations and monitoring solutions.
Available Components
🔋 UPS HID Component (ups_hid)
Monitor UPS devices via direct USB connection on ESP32-S3. Supports APC, CyberPower, and generic HID UPS devices with real-time monitoring of battery status, power conditions, and device information.
Key Features:
- Real-time UPS monitoring (battery, voltage, load, runtime)
- Multi-protocol support (APC Smart, APC HID, CyberPower HID, Generic HID)
- Auto-detection of UPS protocols
- RGB LED status indicator support
- Home Assistant integration
- Simulation mode for testing
Installation
Using External Components (Recommended)
Add to your ESPHome configuration:
external_components:
- source: github://bullshit/esphome-components
components: [ ups_hid ] # Add more components as needed
Manual Installation
-
Clone this repository:
git clone https://github.com/bullshit/esphome-components.git -
Copy component directories to your ESPHome project:
cp -r esphome-components/components/* /config/esphome/components/ -
Use local components in your configuration:
external_components: - source: type: local path: components
Quick Start
UPS HID Component Example
esphome:
name: ups-monitor
platform: ESP32
board: esp32-s3-devkitc-1
external_components:
- source:
type: local
path: components
# Configure UPS monitoring
ups_hid:
id: ups_monitor
update_interval: 30s
simulation_mode: false # Set to true for testing
# Monitor battery level
sensor:
- platform: ups_hid
ups_hid_id: ups_monitor
type: battery_level
name: "UPS Battery Level"
# Monitor UPS status
binary_sensor:
- platform: ups_hid
ups_hid_id: ups_monitor
type: online
name: "UPS Online"
Development
Project Structure
components/
├── ups_hid/ # UPS HID monitoring component
│ ├── README.md # Component-specific documentation
│ ├── __init__.py # Component configuration
│ ├── ups_hid.h # Main component header
│ ├── ups_hid.cpp # Main component implementation
│ ├── sensor.py # Sensor platform
│ ├── binary_sensor.py # Binary sensor platform
│ ├── text_sensor.py # Text sensor platform
│ └── ... # Protocol implementations
├── [future_component]/ # Additional components
│ └── ...
└── ...
tools/
├── generate_vendor_list.py # Vendor ID synchronization tool
├── scan-usb.sh # USB device scanning utility
└── README.md # Tools documentation
.vscode/
└── tasks.json # VSCode development tasks
Development Tools
- Generate Vendor List:
python3 tools/generate_vendor_list.py- Synchronizes vendor IDs between C++ and Python code
- Scan USB Devices:
bash tools/scan-usb.sh- Lists connected ESP32, UPS, and serial devices
- VSCode Tasks: Integrated development tasks via Command Palette
Adding New Components
- Create component directory:
components/your_component/ - Implement core files:
__init__.py- Component configuration and validationyour_component.h- Component headeryour_component.cpp- Component implementation- Platform files (
sensor.py, etc.) as needed
- Add component documentation:
components/your_component/README.md - Update this main README with component description
- Test with both real hardware and simulation where applicable
Coding Guidelines
- Follow ESPHome coding standards and patterns
- Don't use exceptions (ESPHome disables them)
- Include comprehensive logging with appropriate levels
- Implement thread-safe code where necessary
- Provide simulation modes for testing
- Include detailed documentation and examples
Hardware Requirements
Component-specific requirements are documented in each component's README:
- UPS HID: ESP32-S3-DevKitC-1 v1.1 with USB OTG support
- Future components: Requirements will be listed here
Contributing
Contributions are welcome! Please follow these guidelines:
- Fork the repository: github.com/bullshit/esphome-components
- Create a feature branch:
git checkout -b feature/your-feature-name - Follow coding guidelines: See development section above
- Test thoroughly: Include both unit and integration tests
- Update documentation: Add/update README files as needed
- Submit a Pull Request: Include detailed description of changes
Development Environment
This repository includes a complete development environment with:
- DevContainer: Pre-configured development environment
- VSCode Integration: Tasks, debugging, and extensions
- Development Tools: USB scanning, vendor management, etc.
- Test Configurations: Example YAML files for testing
Support
For issues and questions:
- Check component documentation - Each component has detailed troubleshooting
- Enable debug logging in your ESPHome configuration
- Search existing issues: GitHub Issues
- Create new issue with:
- Component name and version
- Complete ESPHome configuration
- Relevant log output
- Hardware information
License
This project is open source and available under the MIT License.
Roadmap
Planned Components
- 📡 RF Module: ASK/OOK transceiver integration
- 🌡️ Multi-Sensor Hub: I2C sensor aggregation
- 🔌 Smart Relay Controller: Multi-channel relay management
- 📊 Data Logger: SD card logging with web interface
Current Status
- ✅ UPS HID Component: Production ready
- 🔄 Documentation: Ongoing improvements
- 🔄 Test Coverage: Expanding automated tests
- 📋 Future Components: Planning and design phase
Stay tuned for updates and new component releases!