jollyjinx/sma2mqtt ? reverse-engineered prompt
Reverse engineered prompt
Build me a small Swift command line app that runs on my home network and automatically finds SMA solar devices like inverters and Sunny Home Manager, reads their live data, and publishes clean values to an MQTT broker so Home Assistant or Node RED can use them.
It should join the SMA multicast group, discover devices on the LAN, try to pull device info over HTTP when possible, and still keep working with UDP or bundled fallback data if that fails. I want the values normalized into sensible MQTT topics under one base topic, with sensible defaults for publish timing so it does not spam the broker but still sends a heartbeat for unchanged values.
Please make it easy to run from source and in Docker, with command line options for the broker, base topic, device password, multicast settings, and optional JSON output for debugging. If you need current setup details, check the docs online.
Are you gonna build this?
make sure you review the code using coderabbit