Skip to content

v3.1 — Native Home Assistant Integration

Latest

Choose a tag to compare

@MichaelB2018 MichaelB2018 released this 27 Mar 02:00
4c2fa57

Pi-Somfy v3.1 — Native Home Assistant Integration

Context

v3.0 was a pure modernization release. Its goal was to bring the codebase up to date — upgrading frontend libraries (Bootstrap 5, jQuery 4), restructuring the backend, and cleaning up technical debt — without adding new functionality.

v3.1 is a feature release, largely focused on adding native Home Assistant support. It introduces a custom integration component, a Supervisor add-on, Raspberry Pi 5 compatibility, and several backend improvements.

What's New

Home Assistant Custom Component

  • Native Home Assistant integration with config flow — discover and add Pi-Somfy from the UI
  • Cover entities with open, close, stop, and position control
  • Automatic polling via DataUpdateCoordinator with 30-second update interval
  • Stop button only appears in the UI while a shutter is actively moving
  • Diagnostics support for troubleshooting
  • HACS-compatible — installable as a custom repository
  • Branding assets (icon, logo) included

Home Assistant Supervisor Add-on

  • Run the Pi-Somfy backend directly on your Home Assistant host — no separate Pi needed
  • Dockerfile based on Debian Bookworm with GPIO access
  • Builds both pigpio and lgpio from source for broad hardware support
  • Automatic Pi 5 detection in the startup script
  • Configurable GPIO pin via the add-on settings UI

Raspberry Pi 5 Support (Experimental)

  • Automatic hardware detection using three fallback methods:
    /proc/device-tree/model/dev/gpiochip4/proc/cpuinfo revision codes
  • lgpio library support for the Pi 5's RP1 GPIO chip
  • Smart GPIO chip selection — tries gpiochip4, falls back to gpiochip0 (for containers)
  • Original pigpio code path preserved unchanged for Pi 1–4

Backend Improvements

  • New /getStatus and /setPosition HTTP endpoints in the web server, used by the custom component
  • paho-mqtt is now optional — only required when MQTT is enabled (-m flag)
  • MQTT client uses loop_start() background thread instead of blocking loop(timeout=30)
  • lgpio added to requirements.txt

Documentation

  • New README section: Home Assistant Integration (Section 7) covering the custom component, add-on, HACS install, manual install, and Pi 5 notes
  • MQTT section updated with a note that MQTT is not required when using the custom component
  • Upgrade instructions for users coming from previous versions
  • Modernization section updated to reflect all v3.0 and v3.1 changes

Files Changed (vs. v3.0)

Modified

  • operateShutters.py — Pi 5 detection, dual pigpio/lgpio support, setPosition handler
  • webserver.py/getStatus and /setPosition endpoints
  • mqtt.pyloop_start() fix
  • requirements.txt — added lgpio
  • README.md — Home Assistant section, MQTT notes, upgrade instructions

Added

  • Home Assistant/custom_components/pi_somfy/ — full custom component (13 files)
  • Home Assistant/addon/pi_somfy/ — full Supervisor add-on (11 files)