This custom integration for Home Assistant monitors any device that speaks SunSpec over Modbus, most commonly a solar inverter or an energy meter. The SunSpec website lists certified devices and manufacturers.
It wraps pysunspec2, the SunSpec Alliance's Python library:
- pysunspec2 talks Modbus TCP, or Modbus RTU over a serial port, to the device, finds the SunSpec models the device has, and decodes their registers with the SunSpec model definitions it ships with: point names, units, scale factors, and the names of states and flags.
- The integration adds the Home Assistant side: setup and options in the UI, reading each selected model at its interval, a device per model, and a sensor for each measurement, state and flag the device reports, with Home Assistant units, device classes and state classes. Its energy sensors work with the energy dashboard out of the box.
Setup finds the device's models and selects the most common ones; Configure chooses exactly which models to read, and how often.
| Platform | Description |
|---|---|
sensor |
A sensor for each value the device reports. |
It reads any device that implements the SunSpec models, whatever the brand, with the definitions that come with pysunspec2. New and corrected models come with new pysunspec2 versions; each release of this integration uses the pysunspec2 version pinned in its manifest.json.
- In Settings -> Marketplace, search for "SunSpec" and open it, or use the button above
- Select "Install"
- The SunSpec setup opens when the installation is done. If you close it, go to Settings -> Devices & services, click "Add integration" and search for "SunSpec"
- Using the tool of choice open the directory (folder) for your HA configuration (where you find
configuration.yaml). - If you do not have a
custom_componentsdirectory (folder) there, you need to create it. - In the
custom_componentsdirectory (folder) create a new folder calledsunspec. - Download all the files from the
custom_components/sunspec/directory (folder) in this repository. - Place the files you downloaded in the new directory (folder) you created.
- Restart Home Assistant
- In Settings -> Devices & services, click "Add integration" and search for "SunSpec"
Using your HA configuration directory (folder) as a starting point you should now also have this:
custom_components/sunspec/translations/en.json
custom_components/sunspec/__init__.py
custom_components/sunspec/api.py
custom_components/sunspec/config_flow.py
custom_components/sunspec/const.py
custom_components/sunspec/entity.py
custom_components/sunspec/manifest.json
custom_components/sunspec/recorder.py
custom_components/sunspec/sensor.py
If you want to contribute to this please read the Contribution guidelines
This project was generated from @oncleben31's Home Assistant Custom Component Cookiecutter template.
Code template was mainly taken from @Ludeeus's integration_blueprint template
