faanskit / ha-esolar

Custom Integration of SAJ eSOLAR

Home Page:https://github.com/faanskit/ha-checkwatt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Donate Donate

Home Assistant SAJ eSolar Custom Integration

This integration uses cloud polling from the SAJ eSolar portal using a reverse engineered private API. Thanks to SAJ eSolar for inspiration.

This integration today support SAJ R5 and SAJ H1. SAJ SEC has not yet been implemented mainly due to lack of access to a SEC system,

The focus on this integration is to reduce the amount of sensors published while at the same time maximize the information available and provide them as attributes.

As an example, the H1 Inverter Power sensor has 50 information elements (15 x 3 + 5) published as attributes. This is a bit against the nature of Home Assistant development, but given a system comprising two plants, one R5 and two H1 - the amount of sensors would easly be in the hundreds. Therefore, this integration aims to publish only what is relevant as sensors.

alt text

These attributes can be fetched by implementing a template sensor using jinja2. An example of that can be found in the advanced section below.

Installation

HACS

Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

Manual

  • Copy directory custom_components/saj_esolar_air to your <config dir>/custom_components directory.
  • Restart Home-Assistant.

Enable the integration

Go to Settings / Devices & Services / Integrations. Click + ADD INTERATION

alt text

Search for eSolar and click on it

alt text

Enter your SAJ eSolar username and password

alt text

If you have more than one site, select which of the sites that shall be installed

alt text

Following a succesful installation, a device per plant will be created

alt text

You can see that a number of devices and entites has been created at the SAJ eSolar integration

alt text

If you click on the devices, you can see this also in the Devices section

alt text

Your home screen will now have a number of new entities depending on your system. A R5 system will have two sensors (Status and Energy) and a H1 System will have five sensors (Status, Sell Energy, Buy, Energy, Charge Energy, Discharge Energy)

alt text

Configuration

If you need more sensor and more detailed attributes in the sensors, you can configure the integration as follows

Go to Settings / Devices & Services / SAL eSolar. Click CONFIGURE.

Select if you want additional inverter sensors and if you want Photovoltaics and Grid attributes. Take note that the Photovoltaics and Grid attributes will pull additional data from the SAJ servers.

alt text

After the configuration is done you need to restart the integration. Click ... and select Reload

alt text

The system will now reload and add two-tre new sensors per inverter (Energy Total, Power and for H1 system Battery SoC)

alt text

Final result

When the system is fully set-up it can look something like this

alt text

Advanced

Creating a template sensor based on sensor attributes.

The below example will fetch the battery direction from the inverter energy total sensor and publish that as a new sensor

template:
  - sensor:
      - name: "Battery Direction"
        unique_id: inverter_ass111111111111111_energy_total_battery_direction
        state: >
          {{state_attr('sensor.inverter_ass111111111111111_energy_total', 'Battery Direction')}}

Donations

I mainly did this project as a learning experience for myself and have no expectations from anyone.

If you like what have been done here and want to help I would recommend that you firstly look into supporting Home Assistant.

You can do this by purchasing some swag from their store or paying for a Nabu Casa subscription. None of this could happen without them.

After you have done that if you still feel this work has been valuable to you I welcome your support through BuyMeACoffee or Paypal.

Paypal