Releases: Nickduino/Pi-Somfy
v3.1 — Native Home Assistant Integration
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)
v3.0 - Modernization Release
Modernize frontend and restructure backend
Summary
Full modernization of the Pi-Somfy project — updated web interface, restructured backend, and numerous bug fixes.
Web Interface
- Modernized design with a mobile-friendly, responsive layout that works well on phones, tablets, and desktops
- Replaced all bitmap button icons with crisp vector (SVG) graphics
- Consolidated 20+ favicon formats into a single SVG favicon
- Fixed schedule page visual glitches: toggle labels, clock picker positioning, and dropdown menus clipping
- Fixed a bug where deleting a schedule and then adding a new one could fail
- Removed dependency on external icon font files (Bootstrap Icons webfont)
- Fixed 27 spelling mistakes
Alexa Integration
- No restart required: Adding or removing shutters via the web UI is now automatically picked up by Alexa — no service restart needed
- More reliable device discovery (responses sent multiple times to guard against network packet loss)
MQTT / Home Assistant
- Updated to the modern Home Assistant MQTT discovery format
- Now compatible with both paho-mqtt 1.x and 2.x
Backend
- Consolidated 9 Python files into 6 (cleaner structure, less duplication)
- Configuration file writes are now safer — protected against corruption from power loss or crashes
- Fixed several bugs in the scheduler, configuration reader, and shutter control (demo mode)
- Updated deprecated Python API calls for compatibility with current Python versions
- Can now run on Windows for development/testing (web server and Alexa work; GPIO requires a Pi)
Housekeeping
- Added
.gitignoreentries for user config and log files (contain personal data) - Removed unused
fauxmo_config.json - Removed unused CSS/JS library files (functionality replaced with inline code)
- Net reduction of ~2,100 lines of code
Testing
- Tested on Windows (web interface + Alexa discovery)
- Tested on Raspberry Pi (full stack including Alexa voice control)
2022 Release v2.0
Last stable release before the modernization update.
This version includes all features and fixes up to the point before the frontend/backend restructuring (PR #170).
Pi-Somfy v1.0
The state of things before Michael brought his great upgrades