mkaiser / Sungrow-SHx-Inverter-Modbus-Home-Assistant

Sungrow SH Integration for Home Assistant for SH3K6, SH4K6, SH5K-20, SH5K-V13, SH3K6-30, SH4K6-30, SH5K-30, SH3.RS, SH3.6RS, SH4.0RS, SH5.0RS, SH6.0RS, SH5.0RT, SH6.0RT, SH8.0RT, SH10RT, SH5.0RT-20, SH6.0RT-20, SH8.0RT-20, SH10RT-20, SH5.0RT-V112, SH6.0RT-V112, SH8.0RT-V112, SH10RT-V112, SH5.0RT-V122, SH6.0RT-V122, SH8.0RT-V122, SH10RT-V122, SH4.6R
345 stars 92 forks source link

entity not available: sensor.sg_battery_charge_nom and sg_battery_level_nom #88

Closed dl1ekm closed 1 year ago

dl1ekm commented 1 year ago

In the new "default" dashboard these fields are shown as errors in the first page.

From my view the problem is that these are relicts from earlier versions. The correct entity (sensor.battery_charge_nominal) are already in the dashboard.

mkaiser commented 1 year ago

sorry, I missed this issue. Will take care of it, soon! :)

Thank you for reporting!

mkaiser commented 1 year ago

Finally i had the time to fix this:

I suppose many users (since end of march) have this issue now. :/

Folloe EXATLY these steps to fix this (takes < 5min)

0) Update to current versions (modbus_sungrow.yaml) and dashboard(s) from the git

1) modbus_sungrow.yaml: Comment the two sensors "Battery level (nominal)" and "Battery charge (nominal)"

2) check config & restart HA

3) GoTo "Developers --> States" and type "nominal" into the field "entity filters" (screenshot) image

4) In my case, I had 4 entities matching "nominal". We want to (termporarily delete all of them to add them again with the correct unique_id. Repeat for each one (Screenshot): -- (1) Click on the information logo -- (2) Click on the gears (not shown) -- (3) Delete and confirm image

Now all sensor history connecting unique_id and sensor name are gone

5) Revert commenting the two sensors in yaml

6) check config & restart HA

mkaiser commented 1 year ago

@All:

Can you give me some feedback, if this fix is working and if the instructions are "human understandable"? ;)

mastameista commented 1 year ago

@mkaiser - thx a lot for this fix but also for this really great integration. I am a proud owner of a solar plant since one week. :)

Feedback

Instructions: yes, they are easily understandable

Results in my case

Besides some Powerwalker sensors containing "nominal" in their name I only had two of your sensors listed in DevTools:

image

I deleted those and after restarting HA, "Battery charge (nominal)" is "unavailable" image

I've checked in /config/.storage/core.entity_registry

before and after the update -> no change

  {
    "aliases": [],
    "area_id": null,
    "capabilities": {
      "state_class": "measurement"
    },
    "config_entry_id": null,
    "device_class": null,
    "device_id": null,
    "disabled_by": null,
    "entity_category": null,
    "entity_id": "sensor.battery_level_nominal",
    "hidden_by": null,
    "icon": null,
    "id": "14ded1e923e219d3b814699e87b1e596",
    "has_entity_name": false,
    "name": null,
    "options": {
      "conversation": {
        "should_expose": false
      }
    },
    "original_device_class": "battery",
    "original_icon": null,
    "original_name": "Battery level (nominal)",
    "platform": "template",
    "supported_features": 0,
    "translation_key": null,
    "unique_id": "sg_battery_level_nom",
    "unit_of_measurement": "%"
  },
  {
    "aliases": [],
    "area_id": null,
    "capabilities": null,
    "config_entry_id": null,
    "device_class": null,
    "device_id": null,
    "disabled_by": null,
    "entity_category": null,
    "entity_id": "sensor.battery_charge_nominal",
    "hidden_by": null,
    "icon": null,
    "id": "3e5f3410186001d4f3cbdbf402b939d7",
    "has_entity_name": false,
    "name": null,
    "options": {
      "conversation": {
        "should_expose": false
      }
    },
    "original_device_class": "energy",
    "original_icon": null,
    "original_name": "Battery charge (nominal)",
    "platform": "template",
    "supported_features": 0,
    "translation_key": null,
    "unique_id": "sg_battery_charge_nom",
    "unit_of_measurement": "kWh"
  }

-> I've still an entity called "sensor.battery_charge_nominal" in the registry. In your .yaml file such an entity doesn't exist anymore.

Any idea how to fix this?

FYI: I prepared this integration in May and updated it last week on Monday (copy/paste modbus_sungrow.yaml and dashboard.yaml).

mkaiser commented 1 year ago

hi, thanks for the feedback! :)

FYI: I prepared this integration in May and updated it last week on Monday (copy/paste modbus_sungrow.yaml and dashboard.yaml)

last Friday I made the fixes, so after you upgraded: Can you upgrade to the newest git-revisions?

I've still an entity called "sensor.battery_charge_nominal" in the registry. In your .yaml file such an entity doesn't exist anymore.

This seems to be correct: https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/blob/c163aa638d2c65565d4a199ce19ba563139377be/modbus_sungrow.yaml#L2188C1-L2188C1

  - name: "Battery charge (nominal)"
    unique_id: sg_battery_charge_nom

HA will use "battery_charge_nominal" as internal name

mastameista commented 1 year ago

last Friday I made the fixes, so after you upgraded: Can you upgrade to the newest git-revisions?

Sry, of course I did upgrade before implementing the change :)

I've just repeated all steps again and now both sensors are working.

image

image

Don't know why exactly but I assume the first copy/paste from github to my modbus_sungrow.yaml failed somehow. I found some differences in modbus_sungrow.yaml before trying a second time.

So sorry for the inconvenience! -> I now can confirm that your fix works like a charm!

PS: I have a Sungrow SBR128 battery and sensor.battery_capacity always shows 0. But this is another topic and I don't want to hijack this thread ;)

mkaiser commented 1 year ago

PS: I have a Sungrow SBR128 battery and sensor.battery_capacity always shows 0. But this is another topic and I don't want to hijack this thread ;)

I am allowed to hijack ;) Your installation is quiet new, so I assume that these values have not been set, yet. Try setting the battery capacity via isolarcloud (maybe app). AFAIK the is no "Auto negotiation" between battery and inverter regarding the capacity

mastameista commented 1 year ago

Great :)

As my Solarteur is new in Sungrow business, I've setup the cloud initially. Under "Plant Configuration > Plan" the battery capacity is automatically read.

image

Clicking on "Settings", no changes are possible: image

But in "Advanced Settings - Hybrid Inverter - Advanced Settings - Battery Parameters" the Parameter "Battery Capacity(kWh) is 0.

image

Due to my little knowhow I didn't change this parameter yet. Maybe it would fix this issue. And because I will be away from home for the next 2 months.

Boklov commented 1 year ago

Hello Very good stuff. I am using this a lot. But i wounder if it is also possible to add the Feed-in limatiation trough modbus and Homeassistant

In solarcloud you can do it lie this Advansed Otions => Powercontrol =>12 Feed in limitation (Enable/closed) => if enabled 12.1 Feed-in limation value in kw (0.0 - to max) 12.2 Feed-in limitation ratio (0-100%)

This can bee usefull when prises fore the exported energy are below 0 and you dont what to export anything.

mkaiser commented 1 year ago

already threre :)

see "export power limit"

image

Boklov commented 1 year ago

Hello

Ok thanks. I totally missed that option.

Thanks fore a very good work.

Den ons 19 juli 2023 00:38mkaiser @.***> skrev:

already threre :)

see "export power limit"

[image: image] https://user-images.githubusercontent.com/29856783/254408751-ea18dff7-b6d1-4a05-b59f-35dc3b5fc427.png

— Reply to this email directly, view it on GitHub https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/issues/88#issuecomment-1641029210, or unsubscribe https://github.com/notifications/unsubscribe-auth/A55DGNO5BLGMD3PCXNTR3W3XQ364ZANCNFSM6AAAAAAWPVW3JA . You are receiving this because you commented.Message ID: <mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/issues/88/1641029210@ github.com>

btota commented 1 year ago

@mkaiser input_select.set_sg_start_stop_mode in modbus_sungrow.yaml doesn´t exist anymore right?

btota commented 1 year ago

Great :)

As my Solarteur is new in Sungrow business, I've setup the cloud initially. Under "Plant Configuration > Plan" the battery capacity is automatically read.

image

Clicking on "Settings", no changes are possible: image

But in "Advanced Settings - Hybrid Inverter - Advanced Settings - Battery Parameters" the Parameter "Battery Capacity(kWh) is 0.

image

Due to my little knowhow I didn't change this parameter yet. Maybe it would fix this issue. And because I will be away from home for the next 2 months.

@mastameista I can affirm your suggestion. It works fine now, battery capacity is shown up the right way - important: you need to login in as fitter in isolarcloud.eu to get to advanced settings as @mastameista showed in his thread.

mkaiser commented 1 year ago

@mkaiser input_select.set_sg_start_stop_mode in modbus_sungrow.yaml doesn´t exist anymore right?

renamed for more clarity to:

input_select: set_sg_inverter_run_mode: name: Inverter mode options:

  • "Enabled"
  • "Shutdown"
btota commented 1 year ago

then you need to update your dashboard.yaml I think :).

https://github.com/mkaiser/Sungrow-SHx-Inverter-Modbus-Home-Assistant/blob/a2d86070027deb3d89e8d28600dc4c79a1efcc68/dashboards/_DefaultDashboard_mkaiser/dashboard.yaml#L212

mkaiser commented 1 year ago

ooops, forgot to change that - thank you :)

mheloy commented 1 year ago

Great :)

As my Solarteur is new in Sungrow business, I've setup the cloud initially. Under "Plant Configuration > Plan" the battery capacity is automatically read.

image

Clicking on "Settings", no changes are possible: image

But in "Advanced Settings - Hybrid Inverter - Advanced Settings - Battery Parameters" the Parameter "Battery Capacity(kWh) is 0.

image

Due to my little knowhow I didn't change this parameter yet. Maybe it would fix this issue. And because I will be away from home for the next 2 months.

How did you get this Battery Parameters from ISolar Cloud.. I don't have this option in mine but I have battery SBR096

btota commented 1 year ago

As I said: "important: you need to login in as fitter in isolarcloud.eu to get to advanced settings"

from germany? then use this guidethread, howto describes how to get an fitteraccount (in case you do not have one) --> https://www.photovoltaikforum.com/thread/158136-sungrow-sammelthread-produktmanagement/?postID=2495656#post2495656

dvogt23 commented 1 year ago

works great, thanks for update 💯 @mkaiser

mastameista commented 1 year ago

Great :) As my Solarteur is new in Sungrow business, I've setup the cloud initially. Under "Plant Configuration > Plan" the battery capacity is automatically read. image Clicking on "Settings", no changes are possible: image But in "Advanced Settings - Hybrid Inverter - Advanced Settings - Battery Parameters" the Parameter "Battery Capacity(kWh) is 0. image Due to my little knowhow I didn't change this parameter yet. Maybe it would fix this issue. And because I will be away from home for the next 2 months.

@mastameista I can affirm your suggestion. It works fine now, battery capacity is shown up the right way - important: you need to login in as fitter in isolarcloud.eu to get to advanced settings as @mastameista showed in his thread.

@btota thanks for your verification. Will also add this parameter :)

leo4417 commented 1 year ago

Unfortunately, nothing changes for me even with the current yaml and multiple procedures as in the instructions - still "unavailable". What else can I do?

mkaiser commented 1 year ago

Unfortunately, nothing changes for me even with the current yaml and multiple procedures as in the instructions - still "unavailable". What else can I do?

Please open a new issue (this is already closed) and show us, what entities are shown in your installation, when you go to "Developer Tools" and filter entities for "battery_charge"

image