Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Huawei Energy Management Assistant (EMMA-A01 / A02) Support #498

Closed
2 tasks done
Roving-Ronin opened this issue Oct 9, 2023 · 145 comments
Closed
2 tasks done

Comments

@Roving-Ronin
Copy link
Contributor

Roving-Ronin commented Oct 9, 2023

Describe your feature request

As per the wall charger feature request, this 'issue' is intended as a location for people to be able to start gathering information and discussing how it works and how it may potentially be supported in the integration.

Given that the EMMA in future will be the preferred method of installation for Huawei Solar installations, with it :

  • providing the energy/consumption meter functionality (superceded the standalone DDSU/DTSU-666H meter);
  • connecting to the inverter(s) via RS485 to provide the aforementioned energy/consumption meter functionality;
  • providing network/internet connectivity for the inverter(s) and LUNA ESS connected via RS485, with its inbuilt WiFi+WAN ethernet ports;
  • connecting to the (forthcoming) SmartGuard-63A that is the replacement for the BackupBox device, that provides for a protected circuit in the event of a grid outage;
  • connecting to the (forthcoming) Huawei Smart Charger 7/21kW for EV charging, via either the LAN port (bad naming, it is only for charger <--> EMMA direct patching, with a single charger). See Issue: [Feature Request]: Wallbox Integration #491
  • Also adds smart / cloud capabilities such as being able to access weather information and make decisions, such as if it will be raining / overcast tomorrow, then charge the LUNA ESS off the cheapest grid power available before tomorrow.

Hopefully Huawei will be utilising the same modbus registers used on the DDSU/DTSU-666H meters, to provide themselves with maximum compatibility for existing installations upgrading, that will allow for 'out of the box' compatibility with WLCRS. However this needs to be confirmed when documentation is published detailing the modbus register definitions for EMMA.
As EMMA is adding additional functionality, it would be a good expectation that there may be additional modbus registers added to EMMA, that would then need to be reviewed and see if any are 'worthwhile' or of use to request being added to WLCRS.

To date documentation published on EMMA is:
EMMA-(A01, A02) User Manual.pdf v01 - Superceded
FusionSolar App Quick Guide (EMMA).pdf
Huawei - EMMA Quick Installation Guide.pdf

Proper usage

  • I confirm that this is not a bug report or support request
  • I confirm that this feature request is within the stated scope of the integration
@wlcrs wlcrs added the on-hold Don't close when stale label Oct 18, 2023
@Roving-Ronin
Copy link
Contributor Author

FYI Huawei have released an installation videa for the EMMA devices, and a new User Guide that includes updating network information.

Note: The EMMA is a device that manages energy in a home with a PV system. It can implement unified scheduling and management of home energy. The EMMA has two models:

EMMA-A01: Only PV and ESS features are supported. Plant-level power control functions, such as maximum self-consumption and grid-tied point control, are supported for unified scheduling of home energy and plant-level energy optimization, further improving the PV energy utilization

EMMA-A02: Features of PV, ESSs, smart chargers, and smart loads are supported. In addition to unified scheduling of home energy, the EMMA-A02 can connect to smart loads such as chargers, SG Ready heat pumps, and smart switches. Users can set the reservation time to charge vehicles and heat water in advance at the specified time. In addition, users can set the priority to use PV energy for devices as required to make the best use of PV energy.


EMMA Installation Video: https://support.huawei.com/enterprise/en/doc/EDOC1100338746?idAbsPath=7639526%7C258788303%7C258788491%7C258789989%7C23205712%7C256539983

[EMMA-(A01, A02) User Manual - 2023-10-31 - v02.pdf](https://github.com/wlcrs/huawei_solar/files/13445816/EMMA-.A01.A02.User.Manual.-.2023-10-31.-.v02.pdf) from https://support.huawei.com/enterprise/en/doc/EDOC1100325377/9a24721e/networking

Comments:

Updated network diagrams appear to confirm that the EMMA will replace the sDongle as the (default?) method to provide connectivity for inverters/site to FusionSolar, whilst the DDSU/DTSU-666 meters will also be superceded with the EMMA providing this functionality also (option to use inbuilt CT's <63A or connect external CT's for >63A systems).

There is only reference to modbus-tcp in relation to certificates and authenticating with 'peer NMS' and FusionSolar.

image

image

Looking at the RS485 details, it has an RS485 A and B, with A going to the inverter/cascade and B for '3rd party devices'.
Previously on the SmartLogger devices this meant the DDSU/DTSU-666 meter, however this functionality is now inbuilt to EMMA,
To date EMMA documentation has zero reference to connecting to a SmartLogger device (IMHO looks like EMMA will be pitched at home users and IF anyone needs a SL that is for more commercial installations where a DDSU/DTSU is not used/needed).
Pending more information about EMMA and its modbus-tcp specifics, given metion of it and prior support in the sDongle it must have it, but as a fallback there is the question of could RS485-B be used as method to connect and Elfin modbus-tcp appliance if needed as a 'last resort'?

image

@torwag
Copy link

torwag commented Jan 19, 2024

Hi,
just to understand, I did nowhere see a configuration with cascaded inverters. Did Huawei mention anywhere how this EMMA would work in that case. To me it looks like a combination of a smart meter (DTSU666-H) with the smart logger (SmartLogger 3000 which seems to be intended for larger PV systems) or Smart Module (Smart Module 1000).
Honestly, Huawei is terrible in naming devices so that it doesn't confuse the heck out of people...
SmartMeter, SmartLogger, SmartModule, SmartDongle and now EMMA....

@Roving-Ronin
Copy link
Contributor Author

@torwag the EMMA appliance is a replacement option for the DDSU/DTSU-666H, USB sDongle etc so from an inverters persepctive is doesn't matter is its 1 or 3 inverters in a cascade. Instead of wiring in the DDSU/DTSU-666H in future you'll connect the EMMA via that RS485 port.

Also read the prior posts carefully and you'll notice at the bottom of 'Figure 2-2' it mentions:

"Inverters connect to the EMMA over RS485. A maximum of three inverters can be connected in parallel"

Worth noting also is that since that post, Huawei / Shelly have also announced that EMMA can integrate with some of their devices, see:

image

@MarkusKAuatria
Copy link

Hello
EMMA is now available in Europe

When do you want to start the integration?
Thank you
Mark

@Roving-Ronin
Copy link
Contributor Author

@MarkusKAuatria

Do you have an EMMA installed already and are offering to install the current WLCRS integration version and see if it 'mostly' works already (assuming it uses the same modbus registers as the DDSU/DTSU-666H for the power meter data)? Post that your able to provide WLCRS with remote access to your setup to allow him to develop and test, for any new modbus registers that are required?

@MarkusKAuatria
Copy link

MarkusKAuatria commented Mar 16, 2024

Hello
I have already installed EMMA-A02.
YES, I can give you remote access from my HASSIO test system.
I would like to send you the login details on a private channel
(Email, Telegram,...)
I'm looking forward to a good collaboration

Konfiguration
->EMMA-A02

--> SUN2000-10KTL-M1 (Modbus 1)
---> 1. LUNA2000-15-S0 (15kw)
---> 2. LUNA2000-15-S0 (15kw)

--> SUN2000-5KTL-M1 (Modbus 2)
---> 14x SUN2000-450W-P

https://ske-solar.com/wp-content/uploads/2024/02/QuickGuide_Three-Phase_PVESSEMMA-Networking_V03_2024-01-31_EN.pdf

Attention
Emma is connected via pin 2/3 and not via PIN 5/7 like the DTSU

@Roving-Ronin
Copy link
Contributor Author

@MarkusKAuatria
Have you tried installing the integration yet, any luck ? If so, what information do you see, or are their any logs ?

"Emma is connected via pin 2/3 and not via PIN 5/7 like the DTSU"

PIN 5 ias 'shielding ground' (shared with LUNA also) with PIN7 (485A2) and PIN9 (RS485B2) being used to connect to the DTSU-666H. Are you sure that EMMA is correctly wired though with it using PIN 2 (RS485B1-1 'Differential -') and PIN 3 (RS485A1-2 'Differential +'), apart from these being from different pairs, the Huawei documentation shows it as PIN 1 (+) and PIN 3 (-) , that is also the A1/B1 pair previously used to cascade (i.e. out from 1&3 from higher up modbus device, that then goes into 2&4 from lower device in the cascade)? See diagram posted earlier/above, from the EMMA manual.

Note: This would mean that EMMA now would become the Modbus Master, with the 'primary' inverter now becoming a modbus slave to it.
This requires confirming the modbus ID# of EMMA and the inverters, as installation may now change to be using ID# of EMMA, then Primary inverter and lastly seconary inverter.
i.e. if originally inverters installed with Primary inverter is ID#1, Secondary is ID#2 and when EMMA was installed it just assumed ID#3. Then installing the integration would now mean needing to use ID 3,1,2 (whereas previously the sDongle didn't have an ID and you just entered it as 1,2).

Hoping that Huawei used the same modbus registers that the DDSU/DTSU-666H meter uses, meaning the Smart Meter part of EMMA will work with WLCRS. I haven't see any updated information as to Modbus Registers for EMMA, and IF it adds any new ones to 'share' whatever additional data has / provides access to.

@wlcrs
Copy link
Owner

wlcrs commented Mar 18, 2024

@MarkusKAuatria
Do you have an account on https://community.home-assistant.io/ ? I can send you my contact details via private message over there.

Can you also download the latest (and current only) file from https://support.huawei.com/enterprise/en/fusionsolar/smarthems-pid-256539983/software/ and upload it here? For SUN2000 software downloads, the ZIP-files with the firmware updates also include PDF's with documentation on how the available modbus registers look like. As I do not own such a device, I do not have access to those downloads.

@MarkusKAuatria
Copy link

@wlcrs
My https://community.home-assistant.io/ account ist the same as the GITHUB account (I changed it now)

@Roving-Ronin
Sorry it is 7 and 9
The Modbus Adress from EMMA is 0 so it is 0,1,2
image

@torwag
Copy link

torwag commented Mar 19, 2024

Just out of curiosity, what would be the benefit of the EMMA for home assistant integration? As I understood, the "smart" features would be why we connect it to home assistant in the first place.
If the connection would be easier, that would be a win, I'm just in the middle of setting up a dedicated Rpi-based home assistant server (as remote unit to the main server). Dealing with (in my case) three wifi dongles for three inverters, is a bit a hassle right now, as HaOS doesn't come with the wifi kernel modules yet. As usual I was stupid selecting the "wrong" wifi sticks 😉

@Roving-Ronin
Copy link
Contributor Author

Roving-Ronin commented Mar 19, 2024

@torwag EMMA combines the modbus access and network connectivity (WiFi and Ethernet) previously provided by the sDongle, the DDSU/DTSU-666H smart meter functions into one unit, whilst then also adding support and connectivity for the Huawei EV charger(s), Load Shedding/Control (via select Shelly devices) and abilty to access cloud data (e.g. forecasts) and your usage trends to provide some 'intelligence' to a Huawei installation.

Yes WLCRS + HA users will still be taking this a step further and pulling in their own data and making automations etc, but the main thing is EMMA appears to be 'the' preferred solution for adding network connectivity, and smart/consumption meter to Huawei installs going forward (vs multiple seperate items). Huawei is also pushing this by the fact that the new Backup Box (aka the SmartGuard) includes an EMMA built into it. From a business perspective for Huawei it also means they are moving from having to buy another vendors consumption meter and work with it, to now producing and selling their own meter (and extra functionality) that they control the IP for, meaning better profits potentially but also potentially reducing their support costs (from issues arising from DDSU/DTSU-666H).

BTW trying to remember, was your setup the one with 3 inverters, with each essentially going to seperate users/apartments? Otherwise, why don't you just cascase them all together (bit of Cat5e cable), the only need 1 sDongle connection for the lot and 1 DDSU/DTSU-666H meter?
Are you linking the 'remote' HA to the main server? Have you looked at: https://github.com/custom-components/remote_homeassistant


@MarkusKAuatria
Where you able to get a hold of the file that Thijs (WLCRS) was after, containing the modbus definitions?
Did you have any luck trying to install WLCRS integration and entering ID# 0,1,2 ? (would be nice if that works, confirming the EMMA is just passing through the inverter / optimiser / battery modbus registers like the existing connection methods do, even though you'd have to presume EMMA has some additional ones for itself, let alone the Smart EV charger ones).

@wlcrs
Copy link
Owner

wlcrs commented Mar 19, 2024

I've received access details from Markus. The EMMA device does not have any open TCP ports at the moment, so he will need to check if he can access a setting to fix this (which seems to be available according to a screenshot from the manual ).

Alternatively, the EMMA-device also exposes a serial Modbus RTU interface on 2 pins (cfr. bottom screenshot of #498 (comment)). So that is another scenario that we can explore if necessary.

@fkhofmann
Copy link

Hello, now that there should be more EMMAs in the field, have you received any new information about possible ways to access EMMA? :)

I hope Huawei won't keep it closed to third-party apps for querying their devices.

@wlcrs
Copy link
Owner

wlcrs commented Jun 5, 2024

The EMMA device I had access to via Markus does not answer to any queries: not via TCP, not via RTU (serial). We haven't been able to obtain instructions on how we can locally connect to a solar installation with EMMA from Huawei.

I would urge everybody considering to order a Huawei Solar installation with EMMA device to first contact Huawei to verify if a local Modbus-connection is supported. If possible, please obtain a manual on how to achieve this and share it with me here.

@fkhofmann
Copy link

Oh, that's too bad, that is certainly not an optimal situation. I have also tried to get information on the topic as a potential future Huawei customer. Huawei's technical support didn't provide any information because I am not a customer (couldn't provide a device serial no) and referred me to a distributor. The distributor also didn't want to tell me anything because I am an end user.

I guess a Huawei device owner would have to open a service request.

@MarkusKAuatria
Copy link

MarkusKAuatria commented Jun 5, 2024

Hallo
These were the last two feedbacks from HUAWEI Support

  • (Freitag, 5. April 2024 15:08) Unfortunately, we do not have any guideline about how access works exactly and how the individual services can be accessed (Modbus TCP, MQTT, web,...) especially for EMMA-A02.

  • (Friday, 5 April 2024 14:30) Please be advised that we created related SR NO. xxxxxxx and we will come back with a resolution as soon as possible. Kindly ask you to choose the option “Reply All” when communicating with our engineers in order to track your response easily.

@tmenguy
Copy link

tmenguy commented Jun 5, 2024 via email

@Roving-Ronin
Copy link
Contributor Author

@tmenguy the issue is adding support for EMMA, especially given in future installations it replaces the sDongle, DDSU/DTSU-666H consumption meter and becomes the primary means for communication for the plant (that also has 2 x M1 3p inverters).

@tmenguy
Copy link

tmenguy commented Jun 6, 2024

Yes, and I was looking at adding an EMMA to my existing installation (with the new backup box ... but it is not 3phases for now it seems). But correct me if I'm wrong: it will replace the meter and Sdongle all at once, but the inverter wifi will stay no? so perhaps there is a way to still connect through it?
(Or perhaps I'm completely dumb here and it is the Sdongle that was creating all the modbus connection and the inverter wifi was only a way to access the Sdongle capabilities, and the inverter is only a pass through. But if not it means at least the inverter inner meter and commands could still be available through the wifi no? )

@Roving-Ronin
Copy link
Contributor Author

@tmenguy The EMMA-A02 is available to support 3p, with AC voltage options of:
1P2W: 100 ~ 240 V, 50 / 60 Hz
3P3W: 346 ~ 415 V, 50 / 60 Hz
3P4W: 346 ~ 415 V, 50 / 60 Hz

The SmartGuard documentation has started mentioning a 'SmartGuard-63A-T0' with T0 = Three-phase Whole Home Backup system. See:

User Manual: https://support.huawei.com/enterprise/en/doc/EDOC1100366781?idPath=258788303%7C258788489%7C258789981%7C21102413%7C255740899

Networking Quick Guide: https://support.huawei.com/enterprise/en/doc/EDOC1100366779?idPath=258788303|258788483|258789967|21102414|21571652

Be aware though, that whilst it mentions 'whole home backup' have a look at the wiring diagram:
image

You'll note that it refers to 'Backup Load' and 'Non Backup Load', then have a look at the new 5k-12k MAP0 inverter series manual, with some handy networking diagrams on page 17-18:
https://support.huawei.com/enterprise/en/doc/EDOC1100366802?idPath=258788305|254827209|258792409|22755755

image

From this it appears the SmartGuard-63A-T0 will allow connecting the grid feed into it and then attaching the (bulk of the) house to its protected output up to 63A, so its now inline between your previous grid feed and the switchboard. You could then attach your 3p HVAC/Ducted Aircon unit to the unprotected circuit. Idea appears to be that you are protected this way and then can add an Automatic Transfer Switch (ATS) in to allow cutting over from a grid/mains feed to having a generator kick in, so your LUNA ESS + SmartGuard 'protects' the house for the 20ms until the generator kicks in automatically.

Note that is with the MAP0 inverters and typically it costs a few extra $ for a 3p with a automatic start. If you have the $ for a 3p generator and already have a M1 inverter(s), you could just have an ATS / Manual Transfer Switch (that don't cost much) installed and rely upon the LUNA covering you for a few minutes and walking outside and manually starting the generator.

@ismiregal17
Copy link

Hello, the new backup box Smartguard can also only supply 1 phase. The 3-phase designation refers to the inverter. There will be a real 3-phase backup box from Huawei in the future, but it will not be able to work together with the inverters currently on the market. There will be a new inverter for this backup box. The reason is that the current inverters are not unbalanced load capable.

@tmenguy
Copy link

tmenguy commented Jun 8, 2024

@Roving-Ronin thanks a lot for the, as always very detailed answer, I've seen only the S0 and not the T0 smartGuard, but loosing HA connection may be a no brainer to me if we don't find a way to connect to EMMA.
and well what you say @ismiregal17 is even worse then .... it means no true 3p backup for any of our current inverters (even my brand new MB0) ...something I completely missed, and well not happy at all (well I will survive probably :) )

@Roving-Ronin
Copy link
Contributor Author

@ismiregal17
"The reason is that the current inverters are not unbalanced load capable."

Good point, overlooked that....

@dragosmd
Copy link

Hi all,
I've just installed Huawei SmartGuard-63A-S0 with EMMA-A02 and updated it the latest version that allowed me to open 502 port.
I've tried everything connecting to it via Modbus but no luck.
Anything that I could do to help this move on?

I'm still pulling data though the Inverter AP

@dernicc
Copy link

dernicc commented Aug 1, 2024

I updated my EMMA-A02 to the latest version and now I got the following screen for adding a third party management system..

Screenshot_20240801_061457_FusionSolar

Does anyone has any info or manual regarding the communication with third party management systems?

@wlcrs
Copy link
Owner

wlcrs commented Aug 3, 2024

I've implemented initial support for EMMA devices, but as I do not own this device, I was not able to properly test this. I don't want to do a release before I have confirmation that it works.

To test:

0/ make sure that the firmware version of your EMMA is V100R024C00SPC100 or higher.
1/ turn off TLS encryption for Modbus TCP:

image

2/ download the repository ZIP file: https://github.com/wlcrs/huawei_solar/archive/refs/heads/main.zip
3/ extract the ZIP archive and rename the folder to huawei-solar
4/ put it in the config/custom_components folder of your Home Assistant.
5/ follow instructions from README: https://github.com/wlcrs/huawei_solar?tab=readme-ov-file#installation

If the documentation is correct, the EMMA will always be device 0. You need to lookup and add the slave ids of your inverters yourself, as they were chosen by your installer.

If I didn't make any error (which is highly unlikely), the integration should properly initialize.

If it fails, then please post the relevant parts of the full logs with the errors (buttons on the bottom of the Logs page).

If you don't see anything in the logs, then add the following to your configuration.yaml and try again:

logger:
  logs:
    pymodbus: debug 
    huawei_solar: debug
    homeassistant.components.huawei_solar: debug

@ismiregal17
Copy link

@wlcrs I have tried it but unfortunately it does not work.

This error was caused by a custom integration

Logger: custom_components.huawei-solar.config_flow
Quelle: custom_components/huawei-solar/config_flow.py:410
Integration: huawei-solar
Erstmals aufgetreten: 19:03:43 (Incidents 5): Last logged 19:04:30

Unexpected exception while connecting via ModbusTCP
Traceback (most recent call last):
File "/config/custom_components/huawei-solar/config_flow.py", line 410, in async_step_setup_network
info = await validate_network_setup(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/huawei-solar/config_flow.py", line 104, in validate_network_setup
bridge = await HuaweiSolarBridge.create(
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HuaweiSolarBridge.create() got an unexpected keyword argument 'host'

@dragosmd
Copy link

dragosmd commented Aug 3, 2024

Going to verify the tls. L.E. Checked and SSL is off.

Firmware is ok
config # nc -vz 192.168.1.11 502
192.168.1.11 (192.168.1.11:502) open

I've deleted the invertor set to 192.168.200.1 I can't even add that one same error with port 6607. So its not related to emma.
1.5.0.a1 has 94 entities found vs 88 I had previously. Can't seem to find yet the difference. But I can't add EMMA on any ID 0,1,2, even 123 slave as Invertor is being mentioned in Fusion Solar Web.

2024-08-03 21:23:31.734 DEBUG (MainThread) [pymodbus.logging] handle: [b'\xff\xff', b'\xfb\xc0']
2024-08-03 21:23:31.734 DEBUG (MainThread) [pymodbus.logging] handle: [b'\x00\x00', b'\x03\xc5']
2024-08-03 21:23:31.734 DEBUG (MainThread) [pymodbus.logging] handle: [b'\x00\x00', b'\x03+']
2024-08-03 21:23:31.785 DEBUG (MainThread) [pymodbus.logging] Adding transaction 30
2024-08-03 21:23:31.785 DEBUG (MainThread) [pymodbus.logging] Resetting frame - Current Frame in buffer -
2024-08-03 21:23:31.785 DEBUG (MainThread) [pymodbus.logging] send: 0x0 0x1e 0x0 0x0 0x0 0x6 0x0 0x3 0x93 0x80 0x0 0x1c
2024-08-03 21:23:31.805 DEBUG (MainThread) [pymodbus.logging] recv: 0x0 0x1e 0x0 0x0 0x0 0x3b 0x0 0x3 0x38 0x3 0xc 0x0 0x0 0x0 0x2 0x11 0x8c 0xff 0xea 0xff 0xff 0xfb 0xe8 0x0 0x0 0x27 0x10 0x0 0x0 0x27 0x10 0x0 0x0 0x23 0x28 0x0 0x0 0x23 0x28 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x3 0x80 0xe0 0x0 0x3 0x77 0x4e 0x0 0x0 0x3 0xc5 0x0 0x0 0x3 0x2b old_data: addr=None
2024-08-03 21:23:31.805 DEBUG (MainThread) [pymodbus.logging] Processing: 0x0 0x1e 0x0 0x0 0x0 0x3b 0x0 0x3 0x38 0x3 0xc 0x0 0x0 0x0 0x2 0x11 0x8c 0xff 0xea 0xff 0xff 0xfb 0xe8 0x0 0x0 0x27 0x10 0x0 0x0 0x27 0x10 0x0 0x0 0x23 0x28 0x0 0x0 0x23 0x28 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x3 0x80 0xe0 0x0 0x3 0x77 0x4e 0x0 0x0 0x3 0xc5 0x0 0x0 0x3 0x2b
2024-08-03 21:23:31.805 DEBUG (MainThread) [pymodbus.logging] Factory Response[ReadHoldingRegistersResponse': 3]
2024-08-03 21:23:31.805 DEBUG (MainThread) [pymodbus.logging] Getting transaction 30
2024-08-03 21:23:31.805 DEBUG (MainThread) [pymodbus.logging] Very short frame (NO MBAP): wait for more data
2024-08-03 21:23:31.805 DEBUG (MainThread) [pymodbus.logging] [780, 0, 2, 4492, 65514, 65535, 64488, 0, 10000, 0, 10000, 0, 9000, 0, 9000, 0, 0, 0, 0, 0, 3, 32992, 3, 30542, 0, 965, 0, 811]
2024-08-03 21:23:31.806 DEBUG (MainThread) [pymodbus.logging] handle: [b'\xff\xff', b'\xfb\xe8']
2024-08-03 21:23:31.806 DEBUG (MainThread) [pymodbus.logging] handle: [b'\x00\x03', b'\x80\xe0']
2024-08-03 21:23:31.806 DEBUG (MainThread) [pymodbus.logging] handle: [b'\x00\x03', b'wN']
2024-08-03 21:23:31.806 DEBUG (MainThread) [pymodbus.logging] handle: [b'\x00\x00', b'\x03\xc5']
2024-08-03 21:23:31.806 DEBUG (MainThread) [pymodbus.logging] handle: [b'\x00\x00', b'\x03+']
2024-08-03 21:23:32.491 ERROR (MainThread) [custom_components.huawei_solar.config_flow] Unexpected exception while connecting via ModbusTCP
Traceback (most recent call last):
File "/config/custom_components/huawei_solar/config_flow.py", line 410, in async_step_setup_network
info = await validate_network_setup(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/huawei_solar/config_flow.py", line 104, in validate_network_setup
bridge = await HuaweiSolarBridge.create(
^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: HuaweiSolarBridge.create() got an unexpected keyword argument 'host'
2024-08-03 21:23:32.818 ERROR (MainThread) [custom_components.huawei_solar.config_flow] Unexpected exception while connecting via ModbusTCP
Traceback (most recent call last):
File "/config/custom_components/huawei_solar/config_flow.py", line 410, in async_step_setup_network
info = await validate_network_setup(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/huawei_solar/config_flow.py", line 104, in validate_network_setup
bridge = await HuaweiSolarBridge.create(
^^^^^^^^^^^^^^^^^^^^^^^^^

@tmenguy
Copy link

tmenguy commented Oct 26, 2024

Hi,

I’m not a EMMA user … and this number (SUN2000-15K-MB001076371-006 this is my Device name it seems) is not my serial number …

BR
Thomas

@andheller123
Copy link

andheller123 commented Oct 26, 2024 via email

@fkhofmann
Copy link

I've also tried your code on the tempalate dev page.

My setup:
Inverter: SUN2000-10KTL-M1
Battery: LUNA2000 S1 7
EMMA

Output Inverter (with regex):
SUN2000-10KTL-M1

without regex I've got also a number behind the model description (01074311-0).
It's Huawei's model number for the device:

01074311-006: SUN2000-10KTL-M1
01076370-006: SUN2000-15K-MB0
01076371-006: SUN2000-17K-MB0

Output Battery:
LUNA2000

@fammoebis
Copy link

fammoebis commented Dec 18, 2024

I managed to integrate EMMA Data to Home Assistant via Modbus by help of that modbus map:
https://www.photovoltaikforum.com/core/attachment/479611-smarthems-v100r024c00-modbus-interface-definitions-pdf/

Preconditions:

Please refer below YAML code to be added in the configuration.yaml

modbus: 
- name: FusionSolar
  type: tcp
  host: 111.111.111.111  # IP-Adress of EMMA
  port: 502
  sensors:

  #Battery
  - name: FS-SOC
    slave: 0
    address: 30368
    unit_of_measurement: "%"
    scale: 0.01
    precision: 2
    data_type: uint16
    unique_id: FS-SOC

  - name: FS-BatteryPower
    slave: 0
    address: 30360
    device_class: power
    unit_of_measurement: kW
    state_class: total
    scale: 0.001
    precision: 3
    data_type: int32
    unique_id: FS-BatteryPower

  - name: FS-BatteryTotalChargedEnergy
    slave: 0
    address: 30308
    device_class: energy
    unit_of_measurement: kWh
    state_class: total_increasing
    scale: 0.01
    precision: 2
    data_type: uint64
    unique_id: FS-BatteryTotalChargedEnergy

  - name: FS-BatteryTotalDischargedEnergy
    slave: 0
    address: 30314
    device_class: energy
    unit_of_measurement: kWh
    state_class: total_increasing
    scale: 0.01
    precision: 2
    data_type: uint64
    unique_id: FS-BatteryTotalDischargedEnergy

  #PV
  - name: FS-PvPower
    slave: 0
    address: 30354
    device_class: power
    unit_of_measurement: kW
    state_class: total
    scale: 0.001
    precision: 3
    data_type: uint32
    unique_id: FS-PvPower

  - name: FS-PvTotalEnergy
    slave: 0
    address: 30348
    device_class: energy
    unit_of_measurement: kWh
    state_class: total_increasing
    scale: 0.01
    precision: 2
    data_type: uint64
    unique_id: FS-PvTotalEnergy

This works for using the data in the Energy dashboard as well having a live power flow visualization as long as a real integration is missing.

Hope this is helpful for the one or the other.

@Roving-Ronin
Copy link
Contributor Author

@fammoebis sorry but what you have above is saying to install the basic modbus integration, NOT the WLCRS Huawei Integration (that uses modbus to query the same registers), and seperately poll EMMA? This would have this data outside of the Huawei Integration then.

I am still awaiting to see (if) EMMA launched in my country, but I believe the WCLRS Huawei Integration added this functionality with the latest release...?

Looking at the Huawei-Lib and comparing, for example your SoC that uses register 30368, I can see this is included for EMMA already - https://github.com/wlcrs/huawei-solar-lib/blob/22e7caac1e5483507bea92a4447d79fd7d2708ad/src/huawei_solar/registers.py#L1391

Looking at the other registeres they are also included in the EMMA registers also: https://github.com/wlcrs/huawei-solar-lib/blob/22e7caac1e5483507bea92a4447d79fd7d2708ad/src/huawei_solar/registers.py#L1364

@fammoebis
Copy link

@Roving-Ronin

ok, was not aware that the WCLRS Huawei integration should already support EMMA. At least as I tried it it didn't.

So was considering the Modbus way as a work around and quick fix until the WCLRS Huawei Integration is working. Will check the WCLRS Huawei integration again.

@fammoebis
Copy link

fammoebis commented Dec 19, 2024

Just checked it, still not working for me :(

I will continue with the Modbus workaround for now and look forward to a fully functional WCLRS Huawei integration.

image

@dragosmd
Copy link

dragosmd commented Dec 19, 2024 via email

@Roving-Ronin
Copy link
Contributor Author

@dragosmd it appears to be 'update 101'.

Would be a good idea if users with an EMMA might be able to keep a track of firmware updates and start adding it into the Wiki of compatible hardware / software.

https://github.com/wlcrs/huawei_solar/wiki/Confirmed-firmware-versions

Thanks.

@dragosmd
Copy link

dragosmd commented Dec 19, 2024 via email

@mithri
Copy link

mithri commented Dec 26, 2024

it works for me (with 100 and 102 of the EMMA FW). I had to disable the manual modbus integration, then got a connection.
Thank you very much.

@tscherf
Copy link

tscherf commented Dec 30, 2024

@wlcrs @dragosmd Does this integration also supports battery AC charging?

@DanCarstea
Copy link

DanCarstea commented Feb 1, 2025

Image

@dragosmd Salut. Ma tot chinui de 2 zile sa integrez emma in HA. Am avut inainte un sistem cu dongle si mergea perfect. Saptamana aceasta am schimbat pe smartguard cu emma. Poti sa ma ajuti si pe mine sa il integrez. Imi da eroare din cand incerc sa ma conectez ca nu poate comunica cu invertorul....

@dragosmd
Copy link

dragosmd commented Feb 1, 2025 via email

@XalaTheShepard
Copy link

@dragosmd , I have my EMMA wired to my network.
However, I was unable to connect it to my HA installation.
The latest update of Huawei Solar should be able to find automatically the installation, but alas it could not find my EMMA.
I am running HA Core 2025.1.4 .
Is this an issue related to my HA Core version or am I missing something?

Kind regards,

Robin

@dragosmd
Copy link

dragosmd commented Feb 1, 2025 via email

@XalaTheShepard
Copy link

@dragosmd , do you have any tutorial available how I can configure the Modbus and server for Huawei Solar? Can this be done in the Fusionsolar app? Many thanks in advance. Kind regards, Robin

@dragosmd
Copy link

dragosmd commented Feb 1, 2025 via email

@XalaTheShepard
Copy link

@dragosmd : the first comment I was able to do, but I see nowhere the settings for step 2 and 3

Image

@dragosmd
Copy link

dragosmd commented Feb 1, 2025 via email

@XalaTheShepard
Copy link

XalaTheShepard commented Feb 1, 2025

@dragosmd , many thanks for the video. May I ask which app you are using on your phone to enter the settings of EMMA Pro? I am missing that part. Many thanks in advance. Kind regards, Robin

@wlcrs wlcrs removed the on-hold Don't close when stale label Feb 1, 2025
@dragosmd
Copy link

dragosmd commented Feb 1, 2025 via email

@XalaTheShepard
Copy link

XalaTheShepard commented Feb 1, 2025

@dragosmd : that explains why I can't see these settings. I most likely have to ask my installer.

Many thanks for the information.

Kind regards, Robin

@DanCarstea
Copy link

Salut,
Ai nevoie de versiune de software noua de emma.
Prima versiune accepta modbus doar pe cablu.
Ulterior a fost implementat pe wifi la firmware mai nou.

Dupa toate acestea ai nevoie in Emma sa activezi modbus tcp, fara sal si la
ip este nevoie sa introduci ip-ul de la HA.

Emma merge doar pe 1.5.0.

Sent from Gmail Mobile

On Sat, Feb 1, 2025 at 15:10 DanCarstea @.***> wrote:
@tmycgn https://github.com/tmycgn

You need the proper release version. Do over the thread and see.

IMG_4683.png (view on web)
https://github.com/user-attachments/assets/d1991b89-d2bc-4034-90bc-977f4c1c51e8

@dragosmd https://github.com/dragosmd Salut. Ma tot chinui de 2 zile sa
integrez emma in HA. Am avut inainte un sistem cu dongle si mergea perfect.
Saptamana aceasta am schimbat pe smartguard cu emma. Poti sa ma ajuti si pe
mine sa il integrez. Imi da eroare din cand incerc sa ma conectez ca nu
poate comunica cu invertorul....


Reply to this email directly, view it on GitHub
<#498 (comment)>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AM3I5AFFPBCCGZDD23SM7M32NTBTNAVCNFSM6AAAAAA5YF3WB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRYHE2DMMRVGQ
.
You are receiving this because you were mentioned.Message ID:
@.***>

Si emma si invertoarele au ultimele firmware-uri. Ipul la ha este baga la meniul modbus sineste activat si tls dezactivat. Conexiunea este facuta pe LAN nu wifi. HA este la zi. Am incercat slavul de la 0 la 5 si nimic. Poti sa mi zici mai clar ce ai facut cu inveterul cu tplink-ul ? Ai un messanger sau ceva sa comunicam direct?

@dragosmd
Copy link

dragosmd commented Feb 1, 2025 via email

@DanCarstea
Copy link

Vezi
#498 (comment)

Verifica sa ai neaparat setarile ca in video, versiunea in HA 1.5.0 minim,
ultima este 1.5.3 iar in video acel IP trebuie sa fie ip-ul serverului de HA

Sent from Gmail Mobile

Am 1.5.3 si setarile sunt ca in filmulet. In emma este pus ipul de la serverul de ha....

@DanCarstea
Copy link

DanCarstea commented Feb 2, 2025

Vezi
#498 (comment)

Verifica sa ai neaparat setarile ca in video, versiunea in HA 1.5.0 minim,
ultima este 1.5.3 iar in video acel IP trebuie sa fie ip-ul serverului de HA

Sent from Gmail Mobile

It finnaly worked. I have to remove the huawei solar from hacs and reinstall it. Probably breacuse i had previouse dongle version install something was left in the registry. So if you are in my situation...remove huawei solar from hacs and reinstall it. After that i put the ip of emma 502 port and left it on auto and everything was discovered: 2 inverters, emma, 2 essu. The car charger wasnt discovered. Ty @dragosmd

@Roving-Ronin
Copy link
Contributor Author

Huawei EV charger won't be detected, as don't think anyone has managed to get the list of Modbus registers (their numbers and settings) to be able to see about communicating with it and adding support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests