pawelka / sofarsolar_esp_rs485_logger

57 stars 21 forks source link

SofarSolar ESP RS485 logger to MQTT

Background

From the shelf logger is only works with SolarMan cloud, but I wanted to have full local integration with Home Assistant, because of poor internet connection. Additionally refresh interval from orginal logger (I managed to integrate with Home Assistant too, see HA Add-One project) is not synchronized with energy meter sensor which checks consumption and production from/to grid. The result was weird, because power wheel shows that house produced energy.

I asked SofarSolar for documentation of RS485 communication, but no lack. I managed to read register based on old SofarSolar documentation for other inverters models other than KTL-X (my inverter) and reversed engineered data based on information sent to SolarMan cloud.

At the end I finished with two working loggers in parallel ;-)

Other projects

Here is a list of other project that you may be intrested:

Supported inverters

For sure SofarSolar KTL-X 8.8 and other powers from KTL-X. There is a chance that other brands from the same familly with work, so if someone check please let me know.

Tested supported devices:

Parts needed to build own local logger

I bought everything from China directly. Total cost is around $5, so much cheaper than orignal logger and more freedom with integration.

Schematic

Firmware choice

My first approach was to write custom firmware, because I couldn't find any other solution, but overtime I realized that there can by some other solutions which can integrate with modbus like Tasmota or ESPHome. With Tasmota and ESPHome the same goal can be achived. In this project you can find all solutions that I tried:

I prefer ESPHome script, because of seamless integration with ESPHome including correct support for icon and device class.

Custom software is ok only for my use, because it's dedicated to my setup and my hardware, so I see some issues and it's hard to maintain this solution, comparing to Tasmota and ESPHome supports where there is huge community to support it.

Tasmota SMI script is not fully tested, but I'm leaving script maybe someone wants to use it for some other integrations for example Domoticz (my goal was HomeAssistant integration)

Images

Prototype

Final solution