--- id: pysma version: "1.1.6" license: MIT license_treatment: permissive maintenance: active --- # pysma — Library to interface an SMA Solar devices License: permissive · Maintenance: active · Downloads: 75.4K/mo ## What it is and what it does pysma is a Python library that communicates with SMA solar inverters through their WebConnect HTTP interface. It abstracts the WebConnect protocol to let you query real-time power output, cumulative energy, and device status without writing raw HTTP requests. The library is async-first, using aiohttp for non-blocking network calls, and integrates directly with Home Assistant's SMA sensor component for home automation workflows. The library reads inverter data over HTTP/HTTPS (with optional SSL verification control) and parses responses using jmespath. It's designed for monitoring setups where you have browser access to your SMA device's web interface and want programmatic access to the same data. Note that Modbus is not supported—only WebConnect. Use it for: - Monitor real-time solar power generation in Home Assistant dashboards. - Log inverter output to a time-series database for long-term energy analysis. - Trigger automations based on solar production thresholds. - Read energy meter data from SMA devices for consumption tracking. - Build custom monitoring scripts for solar systems. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Connects to SMA solar inverters via their WebConnect interface to read real-time and historical energy data for monitoring and integration with home automation systems. Yes, if you own an SMA inverter with WebConnect access and need programmatic monitoring. The library is actively maintained, has no known vulnerabilities, low install friction, and integrates well with Home Assistant. Not suitable if your inverter uses Modbus or lacks WebConnect, or if you require Python versions below 3.12. ## Install pip install pysma uv add pysma poetry add pysma ## Installing pysma Before you install: Low friction installation with only two lightweight runtime dependencies (aiohttp and jmespath). Actively maintained with recent commits; supports modern Python versions. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both personal and commercial projects. Quickstart: pip install pysma import asyncio from pysma import SMAConnection async def main(): async with SMAConnection(host='inverter.local') as conn: data = await conn.get_values() print(data) asyncio.run(main()) Requires Python 3.12 or later; SMA inverter must be accessible via WebConnect on the local network. Verify before relying: - Whether the library supports all SMA inverter models or only specific versions. - Performance characteristics when polling multiple inverters or high-frequency data collection. - Exact data fields and metrics available through the WebConnect interface. - Whether daily usage metrics are directly available or require external workarounds. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 75.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags SMA inverter monitoring, solar energy data API, SMA WebConnect library, solar inverter telemetry, home automation solar integration, solar-energy, home-automation, async-io [View on SkillFed](https://skillfed.io/packages/pysma) · [View on PyPI](https://pypi.org/project/pysma/)