Reluctant to maintain an instance of Home Assistant to just access data for use in Rule Machine and dashboards, I'm pleased to share a local Hubitat driver for Sigenergy energy systems using Modbus TCP. Note that this is used only to retrieve data and not undertake control of the system by writing to registers.
The driver communicates directly with the Sigenergy controller over your local network and does not require cloud services, Home Assistant, MQTT or third-party middleware.
Features
Local Modbus TCP communication
Native Hubitat driver
Numeric attributes for Rule Machine and Dashboards
Configurable polling interval
Individual measurement selection
Automatic socket reconnection
Multi-slave Modbus support
Poll statistics and communication diagnostics
Apache 2.0 licensed
Supported Measurements
Battery State of Charge
Grid Power
Plant Power
Solar Power
Battery Power
Third Party PV Power
Total Load Power
EMS Mode
Grid Status
Plant Running State
Battery State of Health
Battery Temperature
Daily Import / Export Energy
Battery Charge / Discharge Energy
Available Charge / Discharge Energy
Tested Configuration
This driver has been developed and tested with:
Hubitat Elevation
Sigenergy 5kw single phase Energy Controller / Gateway
Sigenergy Modbus Protocol V2.9
I am unable to offer support for other Sigenergy hardware and firmware versions, but those with better expertise in Groovy are welcome to use this as a starting point for further development!
Installation
Download the driver from GitHub.
Import or paste it into Drivers Code.
Create a virtual device using Sigenergy Plant Driver.
Configure the IP address, Modbus port and battery slave ID.
Select the measurements you wish to monitor.
Save Preferences.
Detailed installation and configuration guides are included in the repository.
Documentation includes an installation and configuration guide
Known Limitations
Read-only driver (no Modbus write functions).
Requires Modbus TCP to be enabled on the Sigenergy system.
Only verified registers are currently implemented.
Future Plans
Possible future enhancements (by others!) include:
Additional registers
Support for additional Sigenergy hardware
Optional child devices
Energy dashboard examples
Hubitat Package Manager (HPM) support
Feedback
Bug reports, feature requests and testing feedback are very welcome, but, sorry, I am not in a position to provide technical support beyond that provided.
Few minor tweaks made today to suit my (single phase!) purpose. Have added documentation to allow users to add their own Sigenergy registers if required, and a more detailed description of the driver to allow further development for the brave!!
Just a quick update on further updates to the Sigenergy Hubitat driver.
The project has now been refactored to a Parent/Child architecture. The Parent Driver manages all Modbus TCP communications, while individual measurements are exposed as standard Hubitat child devices (Power, Battery and Measurement), making them much more useful with Hubitat Home, Dashboards and Rule Machine.
A fair amount of work has also gone into improving the code structure and documentation. The project now includes installation, configuration, troubleshooting and register reference guides, along with documentation for anyone wanting to add additional Modbus registers.
The updates have been posted to the Github repository:
If you want to detect the on/off grid status, there’s attributes in the parent device that give direct information on plant status, including on/off grid, EMS status, battery temperature, etc. However, these are not enabled by default and must be selected in the Preference pane of the Plant Parent device.
If you are simply trying to detect if your system is on or off grid, in the Preferences pane of the Sigenergy Plant Parent device, activate “Grid Connection Status” (the plant measurements are arranged in alphbetical order!). Then in the Command pane press refresh and attributes:
On Off Grid Status
0
On Off Grid Status Text
should appear in the current states.
You can then create a “Custom attributes” trigger using either one of these attributes along the lines of:
Hi Mclass
Thank you for the reply.
I didn’t know about the Custom attributes in Rule Machine.
I have it sorted out now, thank you again for your help and for providing this awesome driver