Code Monkey home page Code Monkey logo

ha-esolar's Introduction

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

ha-esolar's People

Contributors

faanskit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ha-esolar's Issues

Add support for SEC module

This integration does not support SAJ SEC module.
Seeking support from someone that has a SAJ SEC module to support inte the implementation of the same

Backlog items

(1) Inverter level sensor for battery percentage - DONE
Currently battery % is for the complete plant and not possible to track per battery in a multi inverter/battery system.
Assumption is that this will become a new sensor, but an attribute to the battery power sensor should be considered as well

(2) kitList/mastermcufw missing as attribute - DONE
Should be an attribute on the inverter Energy sensor.
Correction; slavemcufw is not used. Instead, use mastermcufw and displayfw.

(3) Inverter Type unknown - DONE
For kitList.type, anything but 0 (on-grid) is reported as unknown. Battery systems reports type = 2

Plant list

                  <span class="title_name">Plant Type</span><!-- 电站类型 -->
                  <div class="select_set">
                    <select name="type">
                        <option value="" selected="selected">All</option>
				    	<option value="0">Grid</option>
				    	<option value="1">Storage</option>
                                       <option value="3">AC Coupling</option>

Inverter list

	                      <select name="deviceType" id="deviceType">
	                          <option value="">All</option>
	                          <option value="0">On-grid</option>
	                          <option value="1">Storage</option>
	                          <option value="2">AC Coupling</option>

(4) Device status can be: - DONE
Review what values that device status reports against:

	                            <select name="deviceStatus" id="deviceStatus" onchange="findDevicePageList();">
	                                <option value="" selected="selected">Status</option>
	                                <option value="1">Normal</option>
	                                <option value="2">Alarm</option>
	                                <option value="3">Off-line</option>
	                                <option value="4">Stock</option>
	                                <option value="5">History</option>

(5) Add protective code if protocol from SAJ changes - DONE
Possible future refactoring to not be transparent with the SAJ protocol to the sensors

(6) Add logging output - DONE
Minimalistic logging currently. Add both exceptions, errors and debug logging.

(7) Update README.md - DONE
Document how the system works

(8) Make available in HACS - DONE
Learn how to deploy for HACS

Time configuration CET

HI all.
I installed the integration and for me works fine, but the attribute Inverter Today Energy: reset every day at 7 pm.
I didn't find the way to set up the right time.
Have you got any suggestion ?
Thank you

Authentication broken for SAJ API

Hi, trying to add my B2-HV system to HA but getting invalid credentials when trying to add the intergration. Is there a problem with the integration with the new API or is it me?

Screenshot 2024-01-01 at 4 08 28 pm

Feature request - have the battery percentage on the inverter level

Hello,
Now we have the overal battery percentage of all the inverters on the plant level.
Would it be possible to also have the battery percentage on the interver level as well because the value on the plant level is an average of all the inverter battery percentages.
Just having that as attribute on the interverter power sensor would be good.

Retrying setup: 'peakPower'

Discussed in #5

Originally posted by absorbo March 16, 2023
Hello, first of all, thank you for the effort at creating this HACS integration.
Today, I tried to install it and followed the ReadMe. Instead of the choice of installation, it just says "Configuration successfully created".
The integration constantly tries to: Retrying setup: 'peakPower' and I get no devices or entities.

Please advise.
Thank you for the support.

Battery charging and discharging

It would be great to be able to charge and discharge the battery and control it through home assistant (with an automation for example). Is this something you would consider looking into?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.