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
DataUpdateCoordinatorwith 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/cpuinforevision codes - lgpio library support for the Pi 5's RP1 GPIO chip
- Smart GPIO chip selection — tries
gpiochip4, falls back togpiochip0(for containers) - Original pigpio code path preserved unchanged for Pi 1–4
Backend Improvements
- New
/getStatusand/setPositionHTTP endpoints in the web server, used by the custom component paho-mqttis now optional — only required when MQTT is enabled (-mflag)- MQTT client uses
loop_start()background thread instead of blockingloop(timeout=30) lgpioadded torequirements.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,setPositionhandlerwebserver.py—/getStatusand/setPositionendpointsmqtt.py—loop_start()fixrequirements.txt— addedlgpioREADME.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)