Skip to content

Kirbo/electrolux-to-mqtt

Repository files navigation

Electrolux Comfort 600 to MQTT / Home Assistant

Latest Release GitLab Last Commit CI/CD Pipeline Status GitLab Issues GitLab Merge Requests Docker Pulls

Relevant links:

How to install

  1. Sign up/sign in into Electrolux for Developer
  2. Create a new API Key and copy the value
  3. Setup configs to either docker-compose.yml or copy config.example.yml into config.yml
  4. Start the container by following the instructions

Starting container

Using docker with config.yml

  1. Create config.yml file, by copying contents of config.example.yml and make changes accordingly
  2. Run:
docker pull kirbownz/electrolux-to-mqtt:latest
docker run --rm -v ./config.yml:/app/config.yml --name electrolux-to-mqtt kirbownz/electrolux-to-mqtt:latest

Using docker with environmental variables

docker pull kirbownz/electrolux-to-mqtt:latest
docker run --rm \
  # Mandatory variables \
  -e MQTT_URL=mqtt://192.168.1.1:1883 \
  -e MQTT_USERNAME=mqtt-user \
  -e MQTT_PASSWORD=mqtt-password \
  -e ELECTROLUX_API_KEY=electrolux-api-key \
  -e ELECTROLUX_USERNAME=electrolux-user@example.com \
  -e ELECTROLUX_PASSWORD=electrolux-password \
  -e ELECTROLUX_COUNTRY_CODE=FI \
  # Optional variables \
  # -e MQTT_TOPIC_PREFIX=electrolux_ \
  # -e MQTT_CLIENT_ID=electrolux-comfort600 \
  # -e MQTT_RETAIN=false \
  # -e MQTT_QOS=2 \
  # -e ELECTROLUX_REFRESH_INTERVAL=30 \
  # -e HOME_ASSISTANT_AUTO_DISCOVERY=true \
  # -e LOG_LEVEL=info \
  --name electrolux-to-mqtt kirbownz/electrolux-to-mqtt:latest

Using docker compose

  1. Copy docker-compose.example.yml as docker-compose.yml (cp docker-compose.example.yml docker-compose.yml)
  2. Modify the docker-compose.yml accordingly (code docker-compose.yml) and save changes
  3. Run:
docker compose pull && docker compose up -d

Using Portainer

  1. Add new Stack
  2. Give it a name, e.g. electrolux-to-mqtt
  3. Select Web editor, copy the following variables and make changes accordingly, finally press Deploy the stack:
services:
  electrolux-to-mqtt:
    image: kirbownz/electrolux-to-mqtt:latest
    mem_limit: 128mb
    memswap_limit: 256mb
    restart: unless-stopped
    volumes:
      - "/etc/localtime:/etc/localtime:ro"
      - "/etc/timezone:/etc/timezone:ro"
    environment:
      - # Mandatory variables
      - MQTT_URL=mqtt://192.168.1.1:1883
      - MQTT_USERNAME=mqtt-user
      - MQTT_PASSWORD=mqtt-password
      - ELECTROLUX_API_KEY=electrolux-api-key
      - ELECTROLUX_USERNAME=electrolux-user@example.com
      - ELECTROLUX_PASSWORD=electrolux-password
      - ELECTROLUX_COUNTRY_CODE=FI
      - # Optional variables
      # - MQTT_TOPIC_PREFIX=electrolux_
      # - MQTT_CLIENT_ID=electrolux-comfort600
      # - MQTT_RETAIN=false
      # - MQTT_QOS=2
      # - ELECTROLUX_REFRESH_INTERVAL=30
      # - HOME_ASSISTANT_AUTO_DISCOVERY=true
      # - LOG_LEVEL=info

Developing locally

Either running natively locally:

# Copy config.example.yml
cp config.example.yml config.yml
# Modify as needed
code config.yml
# Make sure you have correct NodeJS version
# If you don't have nvm installed, follow installation guide from https://github.com/nvm-sh/nvm?tab=readme-ov-file#installing-and-updating
nvm use
# Install correct pnpm version if not installed already
npm install -g $(node -p "require('./package.json').packageManager")
# Install the dependencies
pnpm install
# Run the app in development mode
pnpm dev

..or if you want to use Docker instead:

# Modify as needed
code docker-compose.local.yml
# Run the stack
docker compose -f docker-compose.local.yml down ; docker compose -f docker-compose.local.yml up --build

Epilogue

Inspired and thanks to Dannyyy for making the Electrolux to MQTT repository. As I constantly had some issues with it, I decided to make my own implementation, based on Public Electrolux API.

Contributors 2

  •  
  •