Electra-Desktop-Controller-KDE

April 30, 2026 · View on GitHub

KDE Plasma 6 widget that controls Electra (ElectraSmart) air conditioners via a Home Assistant instance. Pure QML — no separate daemon.

If you already have your AC working in Home Assistant (via ha-electrasmart or similar), this widget is a thin remote control on top: power, mode, target temp, fan, swing.

Why route through Home Assistant?

Electra's cloud API binds tokens to a locally-generated IMEI plus your phone number. Running a second client alongside the HA integration risks (a) a re-OTP invalidating HA's token, and (b) tripping the account-scoped 5-minute VALIDATE_TOKEN rate limit when both clients refresh sessions concurrently.

Talking to HA instead means one auth surface, one rate-limit budget, LAN-local calls, and HA stays the single source of truth for any automations on the AC.

Setup

1. Long-lived access token

In Home Assistant: profile (bottom-left) → SecurityLong-lived access tokens → create one, copy it.

2. Install the widget

kpackagetool6 -t Plasma/Applet -i ./plasmoid

Add Electra Controller via Plasma's Add Widgets dialog (right-click the desktop or panel).

3. Configure

Right-click the widget → Configure… and fill in:

  • HA URL — e.g. http://10.0.0.3:8123
  • Long-lived token — from step 1
  • Entity — click Discover to fetch all climate.* entities; pick yours by friendly name (e.g. Office, Bedroom)

Upgrade / uninstall

kpackagetool6 -t Plasma/Applet -u ./plasmoid          # upgrade in place
kquitapp6 plasmashell && kstart plasmashell           # reload to pick up changes
kpackagetool6 -t Plasma/Applet -r com.danielrosehill.electradesktopcontroller

Endpoints used

HA endpointPurpose
GET /api/statesDiscover climate.* entities
GET /api/states/<entity_id>Poll current state
POST /api/services/climate/turn_on / turn_offPower
POST /api/services/climate/set_hvac_modeMode (cool/heat/dry/fan_only/auto)
POST /api/services/climate/set_temperatureTarget temp
POST /api/services/climate/set_fan_modeFan speed
POST /api/services/climate/set_swing_modeSwing

The widget reads hvac_modes, fan_modes, swing_modes, min_temp, max_temp, target_temp_step from the entity's attributes, so it adapts to whatever the underlying integration exposes (works for any HA climate.* entity, not just Electra).

License

MIT