Git Product home page Git Product logo

Comments (30)

wlcrs avatar wlcrs commented on June 15, 2024 1

I’ve worked out how to do the login on the inverter in the same way the FusionSolar app does. This enables write-support for some configuration options, all related to having a battery (maximum charge power, maximum discharge power, charging from the grid, …).

image

You can test it by using the code from the login-and-write branch. Note that it requires the installer account to have the default password 00000a for now.

I haven’t been able to test this new functionality for long-term stability yet. Please report any unexpected behavior to me.

from huawei_solar.

JacoboSanchez avatar JacoboSanchez commented on June 15, 2024 1

My setup is a bit uncommon. There are two different family houses (separated around 200 meters connected with ubiquiti Loco M5 antennas). So I have them managed with the same home assistant instance but they are two isolated installations.

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024 1

@denislooby . Yeah, I first implemented it as per the modbus register definitions, but in #25 this was changed to reflect the reality of what FusionSolar allows.

I'm closing this issue as this feature has been adequately tested by various people now

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

Hi @wlcrs

It's a very interesting feature. Not only discharge power, but also charge/discharge mode (maximum autoconsumption on sunny days, TOU in cloudy days or winter for charging in low price hours), definable TOU charge&discharge hours or battery capacity grid cutoff percentage based on energy generation forecast in order to establish a low charge level for sunny days or higher charge level for cloudy days.

Will write to EU Support also.

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

Done!

Good night,

I'm trying to use the modbus-interface to dynamically set several parameters of my LUNA2000 battery. In particular, I want to change charge level from the grid for TOU mode based in solar production forecast. For example, for sunny days I would start at first hour in the morning with 20% because my battery would charge from solar panels during the day, while for cloudy day I would start at first hour with 80% or 100% due to a fair amount of power is going to be generated. What I looking for is to avoid peak hours in terms of energy price from grid. Usually in Spain nights are really cheap and so I pretend to load battery at the night based in what I'm going to produce during day.
The Modbus Interface Definitions state that register 47077 is RW. However, when I try to write a value to this register, I get the error code 0x80, which means “No permission”?
My inverter SN: XXXXXXXXXXXXXXX
SW version: V200R001C00SPC117
Model: SUN2000-4KTL-L1
Battery SN: XXXXXXXXXXXXXXXXX
SW version: V100R002C00SPC106
Model: LUNA2000-10KWH

Thanks in advance.

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

Response from Huawei support:
image

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

They also sent me this document:
image

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

@wlcrs, do you have some code snippet in order to test with other modbus commands?
I'm trying to modify this:

image

And also this:
image

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

@wlcrs, do you have some code snippet in order to test with other modbus commands?
I'm trying to modify this:

image

And also this:

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

Wow... you are my hero!

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

Working but... also not writable. At least for "charge cutoff %"
image

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

I'm moving right now from emilv2 huawei_solar to your branch. I had to remove all fixes and workarounds in order to make Energy Stats working. Yours is pretty clean!

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

With this branch you could eventually eliminate the need of install SUN2000 commissioning app!

image

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024

I've fixed a few register-settings, and also added a "stop forcible charge" service. Can you do a 'git pull' and try again?

I've tested the services, and they seem to be working well now.

An observation: the forcible charge commands will not charge from grid if the solar panels are producing anything at all. Not surprising that the inverter can't do both at once. Instead, all production will be diverted into the battery until the target is reached.

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

It appears is working right now (no error). Will check later via SUN2000 to ensure values are also set up at inverter.
This is a really nice feature!

from huawei_solar.

JacoboSanchez avatar JacoboSanchez commented on June 15, 2024

I am posting here as it is somehow related with the topic. I am testing the write feature to figure out how to automate a battery load at night with lower prices and I am getting sometimes permission denied errors. My guess is that previously authentication is somehow lost and the inverter requires to authenticate again. Did anyone experienced this?

FYI: I am still using the network interface on SP109 firmware (not SDongle and not connected to the built-in access point)

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

I've tested this feature with these firmware versions:

SPC114 -> Modbus connection to inverter IP in my wifi network (port 502), and modbus connection to inverter IP in inverter wifi network (SUN2000-XXXXXXX), port 502.
SPC117 -> Modbus connection to inverter IP in inverter wifi network (SUN2000-XXXXXXX), port 6607
SPC119 -> Modbus connection to inverter IP in inverter wifi network (SUN2000-XXXXXXX)., port 6607

Feel free to upgrade to SPC114 but not go further. In general, SPC114 is the best one due to no wifi network issues and modbus opened in regular wifi (SPC117 and SPC119 has "once a day" disconnection in my wifi network and I have to enter via FusionSolar commissioning app in order to reconnect wifi).

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024

Can you increase your logging (cfr. bottom of the FAQ in the README), wait till the issue occurs, and post (a link to) your home-assistant.log in a new issue?

As I do frequent restarts of my own HA-instance (because I need to test small fixes here and there), I haven't been able to test long-running sessions myself.

I want to know if the underlying logic is sound before I add retry-mechanisms to login again.

from huawei_solar.

inigoml avatar inigoml commented on June 15, 2024

I want to know if the underlying logic is sound before I add retry-mechanisms to login again.

Regarding retry, due to frequent loss of connectivity with inverter (at least for those models with internal wifi, not sure with FE dongle), sometimes automations do not work due to reconnection is read-only. I don't know why. Only way to fix this is restarting HomeAssistant.

from huawei_solar.

JacoboSanchez avatar JacoboSanchez commented on June 15, 2024

Can you increase your logging (cfr. bottom of the FAQ in the README), wait till the issue occurs, and post (a link to) your home-assistant.log in a new issue?

As I do frequent restarts of my own HA-instance (because I need to test small fixes here and there), I haven't been able to test long-running sessions myself.

I want to know if the underlying logic is sound before I add retry-mechanisms to login again.

I have activated the log (pymodbus included) so I will create another Issue when reproduced, thanks.

from huawei_solar.

JacoboSanchez avatar JacoboSanchez commented on June 15, 2024

Well it refuses to fail now... maybe I must wait until tomorrow. In the future I plan to install a modbus rtu-tcp bridge to be able to connect without using Huawei's modbus tcp implementation. This way I should have write permissions without login... At that point I will test if that works.
I already have one inverter using the bridge (Elfin EW11) but it has no battery so I have no write options to test

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024

The integration should already support this scenario. When you connect over your rtu-tcp bridge, and check the "Advanced: enable parameter configuration" checkbox, it should skip the screen in which it asks for the installer username/password.

I would greatly appreciate it if you let me know if that works as expected or not.

You could already test it with your current setup. Checking that checkbox will just try to write the timezone-register. It should not produce any errors. It will not produce any configurable entities of course.

from huawei_solar.

JacoboSanchez avatar JacoboSanchez commented on June 15, 2024

image
image
And... maybe this is the proof?
image

I am not sure, as I have other inverter connected can not be sure what lines are from that one

from huawei_solar.

wlcrs avatar wlcrs commented on June 15, 2024

The pymodbus logs are from a heartbeat of your other inverter. But it's very good news that using your rtu-tcp bridge worked so smoothly!

Are your inverters not connected to each other via the RS485_2 interface? You should be able to read from both of them by connecting to the "master" inverter and mentioning all slave ids (comma separated) in the first config screen.

from huawei_solar.

denislooby avatar denislooby commented on June 15, 2024

It's interesting that the docs say the range for the Grid Charge Cutoff SOC is 30-70 but using fusion solar and the installer account directly connected I can use higher cutoff than that.
I wonder if it varies by inverter or battery, LG vs Luna, it's a Luna in my case.

from huawei_solar.

Related Issues (20)

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.