This project provides an integration between Sofar inverters over RS485 and MQTT using Python
It allows you to read and write data to Sofar inverters using a prebuilt Docker image (preferred) or Python script .
- Implemented MQTT auto discovery for home assistant - no more manual config!
- Added a new refresh option for each register allowing some registers to be read more regularly (fresher) than other that are less important (i.e serial number)
- Added registers for serial number, software version, hardware version.
- The script now retains a local dict of data which is updated after reading registers for this iteration (based on refresh)
- After an iteration the entire dict (JSON) is sent to a new topic sofar/state_all'
- Added a new option for LEGACY_PUBLISH to continue to send messages individually in addition to sofar/state_all.
- Introduce Signal handling to ensure graceful exit
This software is currently compatible with:
- Sofar ME3000
- Sofar HYD 3~6 EP
Note: It has only been tested on EP inverters.
There is no reason it cannot work with other Sofar inverters, the code and data have been seperately deliberately to support this you just need to provide the correct registers, see the following files:
Please do feel free to contribute changes and improvements.
NOTE: The slightly weird behaviour of desired power when in Self use
, it is probably best to only change it when you are in Passive mode
.
The gateway supports Home Assistant MQTT discovery. It publishes configuration information automatically, the inverter will appears as an new MQTT device. No more manual configuration in Home Assistant!
Based on a script originally created by Matt Nichols in 2021. Thank you to Andre Wagner to his example write python code. Thank you everyone on the Sofar Solar Inverter - Remote Control & Smart Home Integration Facebook group.
You can ping me directly on here or the awesome Sofar Solar Inverter - Remote Control & Smart Home Integration Facebook group