A Node.js service that integrates Electrolux/AEG appliances with MQTT, enabling monitoring and control of your devices through Home Assistant.
This project is HIGHLY EXPERIMENTAL and in the EARLY STAGES of development. It should be used with extreme caution and is not recommended for production environments.
- It has only been tested with a tumbler dryer model
- No guarantees are made about compatibility with other Electrolux/AEG appliance types
- The API implementation may change without notice as the official Electrolux API evolves
- Use at your own risk - no responsibility for any issues that may arise
This service periodically polls the Electrolux API and publishes device data to MQTT topics. It bridges the gap between Electrolux/AEG connected appliances and MQTT-based home automation systems, providing visibility into appliance status and limited control capabilities.
- Integration with Electrolux API for appliance data
- Publishing appliance status to MQTT topics in JSON format, compatible with Home Assistant with auto discovery
- Configurable polling interval
- Automatic reconnection to MQTT broker
- Dockerized for easy deployment
- Structured logging
- Mock data support for testing and development
# Clone the repository
git clone https://github.com/franciscofsales/electrolux2mqtt.git
cd electrolux2mqtt
# Install dependencies
npm install- Copy the environment variables example file:
cp .env.example .env-
Edit the
.envfile to set your Electrolux API credentials, MQTT broker details, and other configuration options -
Run the service in development mode:
npm run devThe service can be run with Docker in two ways:
This option runs both the service and a Mosquitto MQTT broker in Docker:
# Build and start the containers
docker compose up -d
# View logs
docker compose logs -fTo use an external MQTT broker (like HiveMQ or Home Assistant's broker), edit the docker-compose.yml file accordingly, then run:
docker compose up -dThe service publishes to the following MQTT topics:
{MQTT_TOPIC_PREFIX}/data- Device data and status information{MQTT_TOPIC_PREFIX}/status- Service status (online/offline){MQTT_TOPIC_PREFIX}/{applianceId}- Device-specific data and state
{
"timestamp": "2023-05-03T12:34:56.789Z",
"applianceId": "electrolux-dryer-001",
"name": "Tumbler Dryer",
"modelName": "Electrolux EW9H2924DC",
"serialNumber": "DR12345678",
"connected": true,
"state": {
"doorState": "CLOSED",
"programState": "RUNNING",
"programName": "Cotton",
"remainingTimeMinutes": 45,
"dryLevel": "CUPBOARD_DRY",
"temperature": 65,
"connectionState": "CONNECTED"
}
}This service includes basic integration with Home Assistant via MQTT discovery. When enabled, it will create device entities in Home Assistant automatically for your Electrolux appliance.
To enable Home Assistant integration, set the following environment variable:
HOME_ASSISTANT_ENABLED=true
NODE_ENV: Node.js environment (development/production)LOG_LEVEL: Logger level (debug, info, warn, error) (default: info)
MQTT_HOST: MQTT broker hostname or IP (required)MQTT_PORT: MQTT broker port (default: 1883)MQTT_PROTOCOL: MQTT protocol (mqtt, mqtts, ws, wss) (default: mqtt)MQTT_CLIENT_ID: Client ID for MQTT connection (default: generated)MQTT_TOPIC_PREFIX: Prefix for MQTT topics (default: electrolux2mqtt)MQTT_USERNAME: Username for MQTT authentication (optional)MQTT_PASSWORD: Password for MQTT authentication (optional)MQTT_CONNECT_TIMEOUT: Connection timeout in milliseconds (default: 5000)
POLLING_INTERVAL_SECONDS: How often to fetch data in seconds (default: 30)API_USE_MOCK: Set to 'true' to use mock data, 'false' to use the Electrolux API
ELECTROLUX_API_URL: URL of the Electrolux API endpoint (default: https://api.electrolux.one)ELECTROLUX_API_KEY: Your API key from the Electrolux developer portal (required)ELECTROLUX_REFRESH_TOKEN: Initial refresh token from the Electrolux developer portal (required)
HOME_ASSISTANT_ENABLED: Set to 'true' to enable Home Assistant MQTT discovery (default: false)HOME_ASSISTANT_DISCOVERY_PREFIX: MQTT discovery prefix (default: homeassistant)HOME_ASSISTANT_NODE_ID: Node ID for the integration (default: electrolux2mqtt)
├── src/ # TypeScript source files
│ ├── services/ # Service implementations
│ │ ├── electrolux.ts # Electrolux API client
│ │ ├── homeAssistant.ts # Home Assistant integration
│ │ ├── mock.ts # Mock data
│ │ └── types.ts # Type definitions
│ ├── utils/ # Utility modules
│ │ ├── logger.ts # Custom logger implementation
│ │ ├── mqtt.ts # MQTT client implementation
│ │ ├── api.ts # API client implementation
│ │ └── polling.ts # Polling service implementation
│ └── index.ts # Application entry point
├── mosquitto/ # Mosquitto MQTT broker configuration
├── Dockerfile # Docker configuration
├── docker-compose.yml # Docker Compose configuration
└── .env.example # Example environment variables
As this project is in its early stages, contributions are welcome! Please be aware that the API implementation may change significantly as development progresses.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Currently only tested with a tumbler dryer model
- Limited error handling for various API edge cases
- No comprehensive test suite yet
- May not support all features of the Electrolux API
- Add support for more Electrolux/AEG appliance types
- Improve error handling and resilience
- Add comprehensive test suite
- Enhance Home Assistant integration
- Support for sending commands to appliances (when API allows)
Add CI/CD pipelinePublish to dockerhub a pre-built image
MIT

