A sleek and responsive Home Assistant Lovelace card for controlling Xiaomi Mi Humidifier (Deerma) devices. This custom card provides an intuitive interface for managing your smart humidifier with features like target humidity control, water level monitoring, and real-time status updates. Built with TypeScript and Lit Element, it offers a modern, dark theme-compatible design that seamlessly integrates with your Home Assistant dashboard.
- π― Target humidity control with slider and +/- buttons
- π§ Water level monitoring with status indicator
- β‘ Power control with loading states
- π¨ Modern, responsive design
- π Dark theme support
- π Real-time status updates
- Initial release
- Target humidity control with slider and buttons
- Water level monitoring
- Power control with loading states
- Modern, responsive design
- Dark theme support
- Real-time status updates
- Unit tests and documentation
- Open HACS in your Home Assistant instance
- Go to "Frontend" section
- Click the menu icon in the top right and select "Custom repositories"
- Add this repository URL with category "Lovelace"
- Install "Mi Humidifier Card"
- Refresh your browser
- Download
ha-mi-humidifier-card.js
from the latest release - Copy it to your
config/www
folder - Add the resource in your dashboard:
resources: - url: /local/ha-mi-humidifier-card.js type: module
- Refresh your browser
Add the card to your dashboard with this configuration:
type: custom:ha-mi-humidifier-card
entity: humidifier.your_mi_humidifier_entity
Name | Type | Default | Description |
---|---|---|---|
entity | string | Required | Your Mi Humidifier entity ID |
- Node.js (v14 or later)
- Home Assistant instance
- Clone this repository
- Install dependencies:
npm install
- Start development server:
npm start
- The card will be served at
http://localhost:5000/ha-mi-humidifier-card.js
npm run build
Built files will be in the dist
folder.
The project uses Jest for unit testing. Tests are written in TypeScript and located in src/*.test.ts
files.
To run tests:
npm test
To run tests in watch mode:
npm run test:watch
Current test coverage includes:
- Configuration validation
- Target humidity control
- State management
- Error handling
Contributions are welcome! Please feel free to submit a Pull Request.
Before submitting:
- Make sure all tests pass
- Add tests for new features
- Follow the existing code style
- Update documentation as needed
This project is under the MIT License. See the LICENSE file for details.
If you find this card helpful, please consider:
- Giving it a βοΈ on GitHub
- Sharing it with others
- Contributing to its development