Feature/mqtt ha config - #178
Conversation
The cache-busting ADD and REPO_URL/GIT_REF overrides were only needed while testing against this fork's branch; revert to cloning the upstream Nickduino release tag ahead of pushing this branch upstream.
|
Out of curiosity, what limitation are you running into with the current HTTP-based approach? Is there a specific use case that requires MQTT instead? |
|
I personally prefer using MQTT, since it’s event-based rather than continuously polling every few seconds. |
|
Thanks for putting this together, and sorry for the slow back and forth. I'd rather explain my thinking properly than leave this sitting. Where I've landed: I'm inclined not to merge this as it stands, but I want to talk it through rather than close it silently, because it's very possible I'm missing something. Why I'm hesitant Pi-Somfy already has a complete MQTT interface with Home Assistant auto-discovery built in. Run it standalone with The add-on has intentionally been the other path: web UI and scheduler, no broker, no MQTT dependency.
That's the add-on's reason for existing, and it works well as it is. Adding MQTT to it means two ways to do the same thing, five new options to document and support, and more surface for me to keep working across HA releases. Also more confused users trying to understand why there are parameters they don't need. What would change my mind Is there something the standalone install can't do for you here? If there's a real blocker, something about your setup that makes standalone impractical, I'd want to know, because that would change my view. A smaller version I would merge If the answer is essentially "standalone works, but running the add-on is much more convenient", I'm still open to it, just in a much leaner form. HA add-ons can declare MQTT_HOST=$(bashio::services mqtt "host")
MQTT_PORT=$(bashio::services mqtt "port")
MQTT_USER=$(bashio::services mqtt "username")
MQTT_PASSWORD=$(bashio::services mqtt "password")That drops One technical note either way The None of this is meant to dismiss the work. I appreciate you taking the time, and the polling versus events argument is a fair one. I just want to be careful about what goes into the add-on. Let me know what you think. |
|
No worries on the back-and-forth :) I see the add-on as a way to expose all config options like this more accessibly, rather than needing a second, separate install just to get MQTT. |
|
Perfect, This is exactly what I had in mind, thanks for reworking it. Nice and small. Four things before I merge, two functional and two docs. If you can apply them and confirm it still works on your setup, that would be great. 1. Write
|

Add optional MQTT support to the HA add-on
Adds an optional MQTT bridge to the Pi-Somfy Home Assistant add-on, alongside the existing web UI/scheduler.
mqtt_server,mqtt_port(default1883),mqtt_user,mqtt_password,mqtt_client_id(defaultsomfy-mqtt-bridge) — all optional, MQTT stays fully disabled unlessmqtt_serveris set.run.shwrites the[MQTT]config section and passes-mtooperateShutters.pyonly whenmqtt_serveris configured.Dockerfilenow installspaho-mqtt(previously skipped since-mwas never used).DOCS.mdto document the new options and MQTT auto-discovery behavior.No behavior change for existing installs that leave
mqtt_serverblank.