Skip to content

About

Home Assistant customcomponent for SunSpec modbus devices

Topics

Resources

Contributing

Stars

90 stars

Watchers

10 watching

Forks

Repository files navigation

SunSpec logo

GitHub Release GitHub Activity License

pre-commit Ruff

Marketplace Project Maintenance Project Maintenance BuyMeCoffee

Discord Community Forum

How it works

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.

Marketplace Installation

Open your Home Assistant instance and open the SunSpec repository in the Marketplace.

  1. In Settings -> Marketplace, search for "SunSpec" and open it, or use the button above
  2. Select "Install"
  3. 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"

Manual Installation

  1. Using the tool of choice open the directory (folder) for your HA configuration (where you find configuration.yaml).
  2. If you do not have a custom_components directory (folder) there, you need to create it.
  3. In the custom_components directory (folder) create a new folder called sunspec.
  4. Download all the files from the custom_components/sunspec/ directory (folder) in this repository.
  5. Place the files you downloaded in the new directory (folder) you created.
  6. Restart Home Assistant
  7. 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

Configuration is done in the UI

Contributions are welcome!

If you want to contribute to this please read the Contribution guidelines

Credits

This project was generated from @oncleben31's Home Assistant Custom Component Cookiecutter template.

Code template was mainly taken from @Ludeeus's integration_blueprint template


About

Home Assistant customcomponent for SunSpec modbus devices

Topics

Resources

Contributing

Stars

90 stars

Watchers

10 watching

Forks

Releases

Packages

Used by

Contributors

Languages