Skip to content

Commit

Permalink
First codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdelprete committed Feb 21, 2024
1 parent 7f5dd10 commit eb6d103
Show file tree
Hide file tree
Showing 38 changed files with 458 additions and 1,062 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: I need support
url: https://github.com/nathanmarlor/alexdelprete/ha-abb-powerone-pvi-sunspec/discussions/new?category=support
url: https://github.com/alexdelprete/ha-sinapsi-alfa/discussions/new?category=support
about: Questions? Problems? Get help here
- name: Feature request
url: https://github.com/nathanmarlor/alexdelprete/ha-abb-powerone-pvi-sunspec/discussions/new?category=ideas
url: https://github.com/alexdelprete/ha-sinapsi-alfa/discussions/new?category=ideas
about: Share ideas for new features
- name: Anything else
url: https://github.com/nathanmarlor/alexdelprete/ha-abb-powerone-pvi-sunspec/discussions/new?category=general
url: https://github.com/alexdelprete/ha-sinapsi-alfa/discussions/new?category=general
about: If it's something else or you're not sure, open a discussion
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ jobs:
shell: "bash"
run: |
yq -i -o json '.version="${{ github.event.release.tag_name }}"' \
"${{ github.workspace }}/custom_components/abb_powerone_pvi_sunspec/manifest.json"
"${{ github.workspace }}/custom_components/sinapsi_alfa/manifest.json"
- name: "ZIP the integration directory"
shell: "bash"
run: |
cd "${{ github.workspace }}/custom_components/abb_powerone_pvi_sunspec"
zip abb_powerone_pvi_sunspec.zip -r ./
cd "${{ github.workspace }}/custom_components/sinapsi_alfa"
zip sinapsi_alfa.zip -r ./
- name: "Upload the ZIP file to the release"
uses: softprops/[email protected]
with:
files: ${{ github.workspace }}/custom_components/abb_powerone_pvi_sunspec/abb_powerone_pvi_sunspec.zip
files: ${{ github.workspace }}/custom_components/sinapsi_alfa/sinapsi_alfa.zip
58 changes: 27 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,33 @@
# HA Custom Component for Sinapsi Alfa energy monitoring device
# HA Custom Component for 4-noks Elios4you energy monitoring device

[![GitHub Release][releases-shield]][releases]
[![BuyMeCoffee][buymecoffee-shield]][buymecoffee]
[![Community Forum][forum-shield]][forum]

_This project is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by ABB or FIMER_
_This project is not endorsed by, directly affiliated with, maintained, authorized, or sponsored by 4-noks / Astrel Group_

# Introduction

HA Custom Component to integrate data from ABB/Power-One/FIMER PV mono-phase and three-phase inverters that support SunSpec Modbus Models M1/M103/M160, natively or through the VSN300/VSN700 wifi logger card. The VSN300/VSN700 cards provide a SunSpec to Aurora protocol adapter so that all modbus commands are translated to the proprietary Aurora protocol.
HA Custom Component to integrate data from [4-noks Elios4you](https://www.4-noks.com/product-categories/solar-photovoltaic-en/elios4you-en/?lang=en) products.
Tested personally on my [Elios4you Pro](https://www.4-noks.com/shop/elios4you-en/elios4you-pro/?lang=en) to monitor tha main 3-phase 6kw line, plus my 7.5kW photovoltaic system.

The component has been originally developed by @binsentsu for SolarEdge inverters, I adapted it, adding some features, rewriting all the registers' mapping, for my Power-One Aurora PVI-10.0-OUTD 3-phase inverter to which I added a VSN300 card. It has also been tested with an ABB TRIO-8.5-TL-OUTD-S through a VSN300 and REACT2-3.6-TL through a VSN700 datalogger.
![image](https://github.com/alexdelprete/ha-4noks-elios4you/assets/7027842/70bb7791-8d01-4fc2-bef6-9a9110558c0b)

Register address map has been implemented following the vendor's specification documentation, available in the [doc](https://github.com/alexdelprete/ha-abb-powerone-pvi-sunspec/tree/master/doc) folder.
Elio4you is a great product, it provides very reliable measurements, but it has no documented local API to get the energy data. Luckily, 3y ago I found [this great article](https://www.hackster.io/daveVertu/reverse-engineering-elios4you-photovoltaic-monitoring-device-458aa0) by Davide Vertuani, that reversed-engineered how the official mobile app communicated with the device to fetch data, and found out it's a tcp connection on port 5001, through which the app sent specific commands to which the device replies with data. That was a great find by Davide, and I initially used Node-RED to create a quick integration like Davide suggested in the article: I completed a full integration in 1 day and was rock solid, Node-RED is fantastic. :)

![image](https://github.com/alexdelprete/ha-4noks-elios4you/assets/7027842/46eb022f-1da0-48eb-ad70-46832bfa2f4e)

One month ago I decided to port the Node-RED integration to an HA Custom Component, because in the last 2 years I developed my first HA component to monitor ABB/FIMER inverters, and now I'm quite knowledgable on custom component developement (learned a lot thanks to the dev community and studying some excellent integrations).

So finally here we are with the first official version of the HA custom integration for Elios4you devices. :)

### Features

- Installation/Configuration through Config Flow UI
- Separate sensor per register
- Configurable TCP modbus port, also at runtime (no restart needed)
- Configurable modbus slave address, also at runtime (no restart needed)
- Configurable register map base address, also at runtime (no restart needed)
- Configurable polling interval, also at runtime (no restart needed)
- Supports SunSpec models M1, M103, M160
- Sensor entities for all data provided by the device (I don't even know what some of the ones in the diagnostic category specifically represent)
- Switch entity to control the device internal relay
- Configuration options: Name, hostname, tcp port, polling period
- Reconfigure options (except device name) also at runtime: no restart needed.

# Installation through HACS

Expand All @@ -33,38 +37,30 @@ This integration is available in [HACS][hacs] official repository. Click this bu

1. Either click the button above, or navigate to HACS in Home Assistant and:
- 'Explore & Download Repositories'
- Search for 'ABB Power-One PVI SunSpec'
- Search for '4-noks Elios4You'
- Download
2. Restart Home Assistant
3. Go to Settings > Devices and Services > Add Integration
4. Search for and select 'ABB Power-One PVI SunSpec' (if the integration is not found, do a hard-refresh (ctrl+F5) in the browser)
4. Search for and select '4-noks Elios4You' (if the integration is not found, do a hard-refresh (ctrl+F5) in the browser)
5. Proceed with the configuration

# Manual Installation

Download the source code archive from the release page. Unpack the archive and copy the contents of custom_components folder to your home-assistant config/custom_components folder. Restart Home Assistant, and then the integration can be added and configured through the native integration setup UI. If you don't see it in the native integrations list, press ctrl-F5 to refresh the browser while you're on that page and retry.

# Enabling Modbus TCP on the inverter

Enable Modbus TCP client on the VSN300, take note of the Unit ID (aka Slave ID) of the inverter (depends on the model, default on some models is 2 on others is 247) and during the configuration of the component, use the appropriate Slave address. Another important parameter is the registers map base address, default is 40000 but it may vary. All these parameters can be reconfigured after installation, clicking CONFIGURE on the integration.

# Configuration

Configuration is done via config flow right after adding the integration. After the first configuration you can change parameters (except custom name and ip/hostname) at runtime through the integration page configuration, without the need to restart HA (this works since v2.5.0).

![](https://user-images.githubusercontent.com/7027842/214734702-bf899013-5e28-47b5-87a7-827e49ca465b.gif)
Configuration is done via config flow right after adding the integration. After the first configuration you can change parameters (except device name) at runtime through the integration page configuration, without the need to restart HA.

- **custom name**: custom name for the inverter, that will be used as prefix for sensors created by the component
- **custom name**: custom name for the device, that will be used as prefix for sensors created by the component
- **ip/hostname**: IP/hostname of the inverter - this is used as unique_id, if you change it and reinstall you will lose historical data, that's why I advice to use hostname, so you can change IP without losing historical data
- **tcp port**: TCP port of the datalogger
- **slave id**: the unit id of the inverter in the chain: default is 254, if using VS300/VS700 it's usually 2
- **register map base address**: the base address from where the register map starts, usually it's 40000, but for ABB VSN300/VSN700 dataloggers it's 0
- **tcp port**: TCP port of the device. tcp/5001 is the only known working port, but I preferred to leave it configurable
- **polling period**: frequency, in seconds, to read the registers and update the sensors

<img style="border: 5px solid #767676;border-radius: 10px;max-width: 350px;width: 40%;box-sizing: border-box;" src="https://github.com/alexdelprete/ha-abb-powerone-pvi-sunspec/blob/master/gfxfiles/config.png?raw=true" alt="Config">
<img style="border: 5px solid #767676;border-radius: 10px;max-width: 500px;width: 50%;box-sizing: border-box;" src="https://github.com/alexdelprete/ha-4noks-elios4you/assets/7027842/cbe045c6-8753-4c52-9d50-97de983d18b0" alt="Config">

# Sensor screenshot
<img style="border: 5px solid #767676;border-radius: 10px;max-width: 350px;width: 40%;box-sizing: border-box;" src="https://github.com/alexdelprete/ha-abb-powerone-pvi-sunspec/blob/master/gfxfiles/demo.png?raw=true" alt="Config">
# Sensor view
<img style="border: 5px solid #767676;border-radius: 10px;max-width: 500px;width: 75%;box-sizing: border-box;" src="https://raw.githubusercontent.com/alexdelprete/ha-4noks-elios4you/master/gfxfiles/elios4you_sensors.gif" alt="Config">

# Coffee

Expand All @@ -77,8 +73,8 @@ _If you like this integration, I'll gladly accept some quality coffee, but pleas
[buymecoffee]: https://www.buymeacoffee.com/alexdelprete
[buymecoffee-shield]: https://img.shields.io/badge/buy%20me%20a%20coffee-donate-white?style=for-the-badge
[hacs]: https://hacs.xyz
[my-hacs]: https://my.home-assistant.io/redirect/hacs_repository/?owner=alexdelprete&repository=ha-abb-powerone-pvi-sunspec&category=integration
[my-hacs]: https://my.home-assistant.io/redirect/hacs_repository/?owner=alexdelprete&repository=ha-4noks-elios4you&category=integration
[forum-shield]: https://img.shields.io/badge/community-forum-darkred?style=for-the-badge
[forum]: https://community.home-assistant.io/t/custom-component-abb-power-one-fimer-pv-inverters-sunspec-modbus-tcp/316363?u=alexdelprete
[releases-shield]: https://img.shields.io/github/v/release/alexdelprete/ha-abb-powerone-pvi-sunspec?style=for-the-badge&color=darkgreen
[releases]: https://github.com/alexdelprete/ha-abb-powerone-pvi-sunspec/releases
[forum]: https://community.home-assistant.io/t/custom-component-4-noks-elios4you-data-integration/692883?u=alexdelprete
[releases-shield]: https://img.shields.io/github/v/release/alexdelprete/ha-4noks-elios4you?style=for-the-badge&color=darkgreen
[releases]: https://github.com/alexdelprete/ha-4noks-elios4you/releases
8 changes: 4 additions & 4 deletions custom_components/sinapsi_alfa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""ABB Power-One PVI SunSpec Integration.
"""Sinapsi Alfa Integration.
https://github.com/alexdelprete/ha-abb-powerone-pvi-sunspec
https://github.com/alexdelprete/ha-sinapsi-alfa
"""

import asyncio
Expand All @@ -20,7 +20,7 @@
STARTUP_MESSAGE,
UPDATE_LISTENER,
)
from .coordinator import ABBPowerOneFimerCoordinator
from .coordinator import SinapsiAlfaCoordinator

_LOGGER = logging.getLogger(__name__)

Expand All @@ -42,7 +42,7 @@ async def async_setup_entry(hass: HomeAssistant, config_entry: ConfigEntry):
_LOGGER.info(STARTUP_MESSAGE)

_LOGGER.debug(f"Setup config_entry for {DOMAIN}")
coordinator = ABBPowerOneFimerCoordinator(hass, config_entry)
coordinator = SinapsiAlfaCoordinator(hass, config_entry)
# If the refresh fails, async_config_entry_first_refresh() will
# raise ConfigEntryNotReady and setup will try again later
# ref.: https://developers.home-assistant.io/docs/integration_setup_failures
Expand Down
Loading

0 comments on commit eb6d103

Please sign in to comment.