wills106 / homeassistant-solax-modbus

SolaX Power Modbus custom_component for Home Assistant (Supports some Ginlong Solis, Growatt, Sofar Solar, TIGO TSI & Qcells Q.Volt Hyb)
311 stars 95 forks source link

Improvement online offline #791

Open iobrokerneu opened 6 months ago

iobrokerneu commented 6 months ago

Describe the bug

Hello, is there a way to create an entity that reports whether the inverter is online or offline? In iobroker there is this "entity" and it is called "status"

I usw growatt mod 5000TL3-xh with ark hv battery.

Thanks Sascha

Integration Version

2024.01.1

Homeassistant core version

2024.2.1

Inverter brand

Growatt

Plugin used

plugin_growatt.py

Serial prefix

JDM0DB

Connection Method

USR TCP232 - 410S

Detailed Error Log

No response

Additional context

No response

iobrokerneu commented 1 month ago

Hello, are there any updates regarding the suggestion for improvement? Regards, Sascha

wills106 commented 1 month ago

"Run Mode" provides the status of the Inverter, or do you mean when it's connected to the Internet?

iobrokerneu commented 1 month ago

Hi, the inverter goes "offline" once a day for about 1-2 minutes. During this time, it essentially checks itself, and I can monitor this through iobroker to see if it's online or offline.

Unfortunately, I can't find this "run mode." Is there a screenshot of it?

Thanks and regards, Sascha

wills106 commented 1 month ago

I hadn't added in the status for your new Inverter. I'll push an update out later today.

iobrokerneu commented 1 month ago

Thx

wills106 commented 1 month ago

Just pushed 2024.08.3 out

iobrokerneu commented 1 month ago

Hi, I just installed the new version. Unfortunately, no data is being displayed anymore. All data is no longer available.

wills106 commented 1 month ago

What's displayed in the error logs?

iobrokerneu commented 1 month ago

sorry, where exactly can I find that?

wills106 commented 1 month ago

https://homeassistant-solax-modbus.readthedocs.io/en/latest/faq/

iobrokerneu commented 1 month ago

Logger: homeassistant.components.sensor Quelle: helpers/entity_platform.py:764 Integration: Sensor (Dokumentation, Probleme) Erstmals aufgetreten: 13:37:58 (1 Vorkommnisse) Zuletzt protokolliert: 13:37:58

Platform solax_modbus does not generate unique IDs. ID GrowattModbus_battery_voltage is already used by sensor.growattmodbus_battery_voltage - ignoring sensor.GrowattModbus_battery_voltage

2024-08-04 13:37:33.793 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration solax_modbus which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

iobrokerneu commented 1 month ago

is that sufficient?

wills106 commented 1 month ago

Just released 2024.08.4

iobrokerneu commented 1 month ago

unfortunately it still doesn't work. this only shows up in the log when I search for solax

2024-08-04 14:12:56.717 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration solax_modbus which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

iobrokerneu commented 1 month ago

growatt

iobrokerneu commented 1 month ago

Hi.

Was an error possibly found?

wills106 commented 1 month ago

It's not showing any errors. Have you tried power cycling the USR? Or has the IP address changed if using DHCP?

iobrokerneu commented 1 month ago

This will be displayed after restarting home assistant solax.txt

wills106 commented 1 month ago

Have you tried deleting the Inverter from the Integration and adding it back in? There has been quite a few changes since 2024.01.1

iobrokerneu commented 1 month ago

After I did that, there is only 1 device left. Previously there were 3 devices and the entities have also become fewer. but still no data is displayed.

iobrokerneu commented 1 month ago

image

iobrokerneu commented 1 month ago

image

iobrokerneu commented 3 weeks ago

Hello.

Are there any new updates? I deleted the device, installed the new update, and re-added the device. Unfortunately, I no longer have any data after that. Greeting

iobrokerneu commented 2 weeks ago

@wills106

Good morning, I just installed version 2024.08.12. Unfortunately, no data is still displayed. Greetings Sasha

iobrokerneu commented 2 weeks ago

@wills106

Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: custom_components.solax_modbus.config_flow Quelle: custom_components/solax_modbus/config_flow.py:163 Integration: SolaX Inverter Modbus (Dokumentation, Probleme) Erstmals aufgetreten: 09:23:58 (1 Vorkommnisse) Zuletzt protokolliert: 09:23:58

instance name SolaX already defined or default name for non-default inverter

iobrokerneu commented 2 weeks ago

@wills106

2024-08-25 09:20:46.598 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration solax_modbus which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant 2024-08-25 09:23:58.866 WARNING (MainThread) [custom_components.solax_modbus.config_flow] instance name SolaX already defined or default name for non-default inverter

wills106 commented 2 weeks ago

It looks like your either adding the same Inverter in again, or adding a second Inverter without changing the default name on the second Inverter?

iobrokerneu commented 2 weeks ago

@wills106

I removed the inverter and then added the same inverter again. I did that because no data was displayed after the update and I thought it would work again afterwards. unfortunately not.

iobrokerneu commented 2 weeks ago

@wills106

I tried everything. no data after update. Data deleted and re-added, no data. a new one added no data.

iobrokerneu commented 2 weeks ago

@wills106

hi, I have just installed the update 2024.08.13 and now the data is displayed again. Thanks

but unfortunately the status has been removed, whether the changer is online or offline. greetings Sascha

TonyMathiesen commented 2 weeks ago

Regarding the missing run mode (register 3000) which currently stops the integration (assumes sleep mode) for Growatt MOD. I believe that is due to the overlapping registers for the MOD inverters, as holding register address 3000 is 8-bit and input register address 3000 is 16-bit devided into high and low bit for state and run mode. I only removed the GEN3 to get the plugin working again.

I'm not sure how to modify the plugin to support the state and run mode for GEN3. But I will gladly support with testing/debugging if needed.

Holding reg (8-bit): image

Input reg (16-bit high/low): image

wills106 commented 2 weeks ago

Just had another look at it, I have forgotten to add the input_register part

# TL-X TL-XH
    GrowattModbusSensorEntityDescription(
        name = "Inverter State",
        key = "inverter_state",
        register = 3000,
        unit = REGISTER_U8H,
        scale = { 0: "Waiting", 3: "Fault", 4: "Flash", 5: "PV Bat Online", 6: "Bat Online", },
        allowedtypes = GEN3 | GEN4,
    ),
    GrowattModbusSensorEntityDescription(
        name = "Run Mode",
        key = "run_mode",
        register = 3000,
        unit = REGISTER_U8L,
        scale = { 0: "Standby", 1: "Normal", 3: "Fault", 4: "Flash", },
        allowedtypes = GEN3 | GEN4,
    ),

Should be:

# TL-X TL-XH
    GrowattModbusSensorEntityDescription(
        name = "Inverter State",
        key = "inverter_state",
        register = 3000,
        register_type = REG_INPUT,
        unit = REGISTER_U8H,
        scale = { 0: "Waiting", 3: "Fault", 4: "Flash", 5: "PV Bat Online", 6: "Bat Online", },
        allowedtypes = GEN3 | GEN4,
    ),
    GrowattModbusSensorEntityDescription(
        name = "Run Mode",
        key = "run_mode",
        register = 3000,
        register_type = REG_INPUT,
        unit = REGISTER_U8L,
        scale = { 0: "Standby", 1: "Normal", 3: "Fault", 4: "Flash", },
        allowedtypes = GEN3 | GEN4,
    ),
wills106 commented 2 weeks ago

I haven't pushed it out as a release yet but 2024.08.14 of https://github.com/wills106/homeassistant-solax-modbus/blob/main/custom_components/solax_modbus/plugin_growatt.py includes the above changes, if someone want's to test it?

TonyMathiesen commented 2 weeks ago

I'm currently testing it, as there are some conflicts with incorrect "GEN3" on some other sensor. After cleaning that it fails with reading this group of input registers, however 1-124 is 8bit registers and 3000-3249 are 16bit. Any suggestion on what to add to seperate the two reading groups?

image

TonyMathiesen commented 2 weeks ago

Arh believe I found the issue.. Have to completely change all the input 1-124 input registers from GEN2 and switch to 3000-3249 GEN4 structure.

Holding register range: 0-124 + 3000-3124 Input register range: 3000-3124 + 3125-3249

Let me test if that helps sorts out the registers for the MOD TL-XH inverters.

TonyMathiesen commented 2 weeks ago

It seems we cannot avoid using mixture of two ranges 0-124 and 3000-3249 in order to cover the functionality. @wills106 Is there any way to tell the plugin to split the input block in two groups?

wills106 commented 2 weeks ago

1-124 is 8bit registers and 3000-3249 are 16bit

I think the majority of the 1-124 registers are a mixture of 16 and 32bit ones.

Some of the 3,000 range are 8bit and also 16 & 32bit.

Is there any way to tell the plugin to split the input block in two groups?

It's meant to split them into 100 count register blocks.

https://github.com/wills106/homeassistant-solax-modbus/blob/97cf9df93b7d3e1a5bc86784cde54479b465d545/custom_components/solax_modbus/plugin_growatt.py#L4974

Something must be broken on the Growatt plugin?

wills106 commented 2 weeks ago

You can also force a newblock, change:

https://github.com/wills106/homeassistant-solax-modbus/blob/97cf9df93b7d3e1a5bc86784cde54479b465d545/custom_components/solax_modbus/plugin_growatt.py#L3334-L3342

to

    GrowattModbusSensorEntityDescription(
        name = "Inverter State",
        key = "inverter_state",
        newblock = True,
        register = 3000,
        register_type = REG_INPUT,
        unit = REGISTER_U8H,
        scale = { 0: "Waiting", 3: "Fault", 4: "Flash", 5: "PV Bat Online", 6: "Bat Online", },
        allowedtypes = GEN3 | GEN4,
    ),
TonyMathiesen commented 2 weeks ago

Found that the plugin_growatt.py is missing the "auto_block_ignore_readerror = True" in the plugin_instance, which is why it stops for all the registers and not only the block group.

Adding the newblock did not do any difference. Despite the plugin splitting up the other groups. image

Added some debug logger info to see what is going on. And it seems for some reason the spliting is not working for register 3000 as it is "dict" which according to the logic is then skipping the splitting. image Splitting logic: image

@wills106 Any clues to why that is and if this can explain why? 😊

wills106 commented 1 week ago

I have released 2024.08.14 with the change, I'll leave the issue open until confirmed it works.

TonyMathiesen commented 1 week ago

2024.08.14 will not close this with "Inverter State" and "Run Mode" (register 3000), as it is currenly commented out. Adding the newblock is not working when added to the plugin_growatt.py for some reason. https://github.com/wills106/homeassistant-solax-modbus/issues/791#issuecomment-2322114347

iobrokerneu commented 1 week ago

@wills106

hi, I have installed version 2024.09.1 ​​and generally everything works.

but unfortunately the entities where I can see whether the inverter is online or offline are still missing. Greetings Sascha