Skip to content

duczz/ha-fritzbox-smarthome

Repository files navigation

FRITZ!SmartHome

A patched & improved FRITZ!SmartHome integration for Home Assistant

HACS Custom Home Assistant Version License

Add to HACS


This fork of the official Home Assistant FRITZ!SmartHome integration fixes several upstream bugs and improves error handling and robustness across all platforms.

🔌 Supported Platforms

Platform Description
🚨 binary_sensor Alarm, window open, holiday/summer mode, battery low, lock state
🔘 button Apply FRITZ!SmartHome templates
🌡️ climate Control FRITZ!DECT thermostats (target temp, eco/comfort/boost/off)
🪟 cover Control FRITZ!DECT blinds and shutters
💡 light Control FRITZ!DECT smart bulbs (on/off, brightness, color, color temp)
📊 sensor Temperature, humidity, battery, power, voltage, current, energy, schedule
🔁 switch Smart plugs + FRITZ!SmartHome routines (triggers)
📋 Sensor details
Sensor Unit Device Class
Temperature °C temperature
Humidity % humidity
Battery level % battery
Power consumption W power
Voltage V voltage
Electric current A current
Total energy kWh energy
Comfort temperature °C temperature (diagnostic)
Eco temperature °C temperature (diagnostic)
Next scheduled temperature °C temperature (diagnostic)
Next schedule change time timestamp (diagnostic)
Next scheduled preset diagnostic
Current scheduled preset diagnostic

📦 Supported Devices

  • FRITZ!DECT 200 / 210 — smart plugs with energy metering
  • FRITZ!DECT 300 / 301 / 302 — thermostats
  • FRITZ!DECT 400 / 440 — buttons and wall switches
  • FRITZ!DECT 500 — smart bulb
  • Comet DECT thermostat
  • HAN-FUN devices (blinds, sensors, etc.)
  • FRITZ!SmartHome templates and routines

✅ Requirements

  • Home Assistant 2024.1.0 or newer
  • A FRITZ!Box with FRITZ!SmartHome support
  • Smart Home must be enabled in the FRITZ!Box UI

🚀 Installation

HACS (recommended)

  1. Open HACS in Home Assistant
  2. Go to Integrations → three-dot menu → Custom repositories
  3. Add this repository URL, category: Integration
  4. Search for FRITZ!SmartHome and install
  5. Restart Home Assistant

Manual

  1. Copy all .py, .json files and the translations/ folder into:
    <config>/custom_components/fritzbox/
    
  2. Restart Home Assistant

⚙️ Configuration

Settings → Devices & Services → Add Integration → FRITZ!SmartHome

Field Description
Host Hostname or IP (e.g. fritz.box or 192.168.178.1)
Username FRITZ!Box user account
Password Password for the user account
SSL Enable encrypted connection (optional)

Tip: Create a dedicated FRITZ!Box user with Smart Home permission only — do not use the admin account.

Auto-discovery via SSDP is supported. If your FRITZ!Box is on the local network, it may appear automatically.


🛠️ Improvements over the official integration

🐛 Bug Fixes

  • No ERROR log on session expiry — When a FRITZ!Box session expires (HTTP 403), the integration re-authenticates and retries the update silently. No ERROR entry appears in the HA log unless the re-login itself fails. (coordinator.py)

  • Automatic reauth on password change — If the FRITZ!Box password changes, HA automatically starts a reauth flow instead of leaving the integration in a silent error state. (coordinator.py)

  • Automatic reload on connection loss — A ConnectionError or TimeoutError (e.g. during nightly DSL forced reconnects) triggers a clean integration reload so the session is properly re-established. (coordinator.py)

  • Readable error messages in the HA UI — Connection errors now include the original exception message (e.g. Connection refused) in the HA UI instead of showing an empty error string. (coordinator.py)

  • Trigger entities are preserved during cleanup — FRITZ!SmartHome routines (triggers) are no longer incorrectly removed from the entity registry during device cleanup. (coordinator.py, __init__.py)

  • Cover position updates immediately — After setting a blind/shutter position, the state refreshes right away instead of waiting for the next poll interval. (cover.py)

  • No crash for bulbs without color data — If a FRITZ!DECT 500 returns None for hue or saturation, the integration no longer raises a TypeError. (light.py)

  • Climate platform loads correctly — A missing callback import that caused a NameError when loading the climate platform is fixed. (climate.py)

✨ Improvements

  • Routines included in diagnostic exports — FRITZ!SmartHome triggers (routines) are now part of the HA diagnostic download. (diagnostics.py)

  • Readable log messages — The coordinator name in HA logs shows the FRITZ!Box hostname instead of the internal config entry ID. (coordinator.py)


🤝 Contributing

Pull requests are welcome. For larger changes, please open an issue first to discuss your approach.


About

Patched & improved FRITZ!SmartHome integration for Home Assistant

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages