bohdan-s / SunGather

GNU General Public License v3.0
143 stars 58 forks source link

Question: What is 'Inverter Power State' / run_state? #30

Open andres-canello opened 2 years ago

andres-canello commented 2 years ago

Mine is OFF most of the time.

Btw, great job, looking forward to Home Assistant support via HACS. :)

benni336 commented 2 years ago

Depending on your inverter run state is not yet fully supported. i am working on making it work with hybrid ones and for them the einstanze currently is just some default value except for some cases.

Can’t say anything about the other inverters though.

Am 10.02.2022 um 06:41 schrieb Andres Canello @.***>:

 Mine is OFF most of the time.

Btw, great job, looking forward to Home Assistant support via HACS. :)

— Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you are subscribed to this thread.

andres-canello commented 2 years ago

Thanks, mine is a SG8K-D.

bohdan-s commented 2 years ago

If you could post the console/web output when you know the inverter is running I’ll look at the registers and see why it’s saying OFF.

andres-canello commented 2 years ago

Now it says ON, but it's for short periods of time. image

ON: +----------------------------------------------+ | Inverter Configuration Settings | +----------------------------------------------+ | Config | Value | +--------------------+-------------------------+ | host | 192.168.2.48 | | port | 502 | | timeout | 10 | | retries | 3 | | RetryOnEmpty | False | | slave | 1 | | model | SG8K-D | | level | 1 | | use_local_time | False | | smart_meter | True | | connection | sungrow | +----------------------------------------------+ +----------------------------------------------------------------------+ | Address | Register | Value | +---------+-------------------------------------+----------------------+ | ---- | device_type_code | SG8K-D | | ---- | run_state | ON | | 5003 | daily_power_yields | 42.3 kWh | | 5004 | total_power_yields | 631.0 KWh | | 5008 | internal_temperature | 52.7 °C | | 5019 | phase_a_voltage | 246.4 V | | 5031 | total_active_power | 560 W | | 5038 | work_state_1 | Run | | 5083 | meter_power | 150 W | | 5091 | load_power | 710 W | | 5093 | daily_export_energy | 20.2 kWh | | 5095 | total_export_energy | 296.0 kWh | | 5097 | daily_import_energy | 4.6 kWh | | 5099 | total_import_energy | 164.0 kWh | | 5101 | daily_direct_energy_consumption | 22.1 kWh | | 5103 | total_direct_energy_consumption | 335.0 kWh | | 5113 | daily_running_time | 1005 min | | 5006 | start_stop | Start | | ---- | export_to_grid | 0 W | | ---- | import_from_grid | 150 W | | ---- | timestamp | 2022-2-11 16:44:40 | +----------------------------------------------------------------------+ Logged 21 registers to Console

OFF: +----------------------------------------------+ | Inverter Configuration Settings | +----------------------------------------------+ | Config | Value | +--------------------+-------------------------+ | host | 192.168.2.48 | | port | 502 | | timeout | 10 | | retries | 3 | | RetryOnEmpty | False | | slave | 1 | | model | SG8K-D | | level | 1 | | use_local_time | False | | smart_meter | True | | connection | sungrow | +----------------------------------------------+ +----------------------------------------------------------------------+ | Address | Register | Value | +---------+-------------------------------------+----------------------+ | ---- | device_type_code | SG8K-D | | ---- | run_state | OFF | | 5003 | daily_power_yields | 42.3 kWh | | 5004 | total_power_yields | 631.0 KWh | | 5008 | internal_temperature | 52.1 °C | | 5019 | phase_a_voltage | 248.3 V | | 5031 | total_active_power | 751 W | | 5038 | work_state_1 | Derating Run | | 5083 | meter_power | -177 W | | 5091 | load_power | 573 W | | 5093 | daily_export_energy | 20.2 kWh | | 5095 | total_export_energy | 296.0 kWh | | 5097 | daily_import_energy | 4.6 kWh | | 5099 | total_import_energy | 164.0 kWh | | 5101 | daily_direct_energy_consumption | 22.1 kWh | | 5103 | total_direct_energy_consumption | 335.0 kWh | | 5113 | daily_running_time | 1020 min | | 5006 | start_stop | Start | | ---- | export_to_grid | 177 W | | ---- | import_from_grid | 0 W | | ---- | timestamp | 2022-2-11 16:48:32 | +----------------------------------------------------------------------+ Logged 21 registers to Console

bohdan-s commented 2 years ago

Hmm, will need to learn what “Derating Run” means. Lol It seems the inverter is running but at a limited capacity. I’ll push a patch to flag that as ON since it is running.

andres-canello commented 2 years ago

For what I've read it decreases production if it hits 250v in a period of time. Initially I thought it was related to temp but it's not.


From: bohdan-s @.> Sent: Friday, February 11, 2022 5:33:20 PM To: bohdan-s/SunGather @.> Cc: Andres Canello @.>; Author @.> Subject: Re: [bohdan-s/SunGather] Question: What is 'Inverter Power State' / run_state? (Issue #30)

Hmm, will need to learn what “Derating Run” means. Lol It seems the inverter is running but at a limited capacity. I’ll push a patch to flag that as ON since it is running.

— Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fbohdan-s%2FSunGather%2Fissues%2F30%23issuecomment-1035944760&data=04%7C01%7Candres.canello%40microsoft.com%7Cd195ed95d17d4b6fa35808d9ed30c73a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637801616071957830%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=MrymR33zI2oMppve12HTdS5juMMeVQekXsZy2Ia6raM%3D&reserved=0, or unsubscribehttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAJMBY6W6TPE6R6MCE4UROC3U2S3UBANCNFSM5N7UKPTA&data=04%7C01%7Candres.canello%40microsoft.com%7Cd195ed95d17d4b6fa35808d9ed30c73a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637801616071957830%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=jBzdUywpxC4SPNNtbEfv50gyL8c4QXRyj1t4IK%2FW4fE%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Candres.canello%40microsoft.com%7Cd195ed95d17d4b6fa35808d9ed30c73a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637801616071957830%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=mMHiXYHfThiCAz2K%2BCK82d206VvHgImHoiZPhHxuP%2BA%3D&reserved=0 or Androidhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Candres.canello%40microsoft.com%7Cd195ed95d17d4b6fa35808d9ed30c73a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637801616071957830%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=pTj3%2BxFQEmSmGh0DXAPxSUMTAd9OovKoGlYa3xJ%2FhIU%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.***>

bohdan-s commented 2 years ago

Hi, I have fixed this in 0.3.4, please test and let me know if it still shows OFF values when it shouldn't

andres-canello commented 2 years ago

Yep, that worked great. Thanks mate. Where is HACS support in your priority list? :) beer you way it it helps as an incentive

bohdan-s commented 2 years ago

HACS is my main focus :) There are some limitations with how it works (like having a script constantly running).

rark-ha commented 2 years ago

Hmm, will need to learn what “Derating Run” means. Lol It seems the inverter is running but at a limited capacity. I’ll push a patch to flag that as ON since it is running.

"Derating Run" is when the solar is producing more than can be consumed or exported. For example, my grid only lets me export 5KW so if I produce 8KW and can't consume 3KW it derates.

You used to publish the work_state_1 as an attribute on one of the HA sensors. I had a template sensor setup to pull the work state, and use it to trigger automations (e.g. when Derating, I would turn on the pool pump and other battery chargers to try and use the free power). Can we get the attribute back, or create a new additional sensor that reports the actual state instead of the binary sensor?

lucahammer commented 2 years ago

@rark-ha You can add/edit sensors in the config.yaml yourself. I added it like this:

  # Publish Registers to MQTT / Home Assistant
  - name: mqtt
    …
    ha_sensors:
      …
      - name: "Work State"
        register: work_state_1

Because all sensors get an unit_of_measurement at the moment, Home Assistant doesn't handle it as a discrete value. I am nut sure if your automation needs that. Pull request #48 fixes it.

Back to this issue: My run_state often is incorrectly OFF as well, but I haven't figured out the pattern yet. I will keep an eye on it and report back, once I know more. (SG20RT)

rark-ha commented 2 years ago
  # Publish Registers to MQTT / Home Assistant
  - name: mqtt
    …
    ha_sensors:
      …
      - name: "Work State"
        register: work_state_1

Because all sensors get an unit_of_measurement at the moment, Home Assistant doesn't handle it as a discrete value. I am nut sure if your automation needs that. Pull request #48 fixes it.

Thank you! I've created the MQTT sensor and now have it linked into the automations (they monitor the state change so the UoM issue doesn't affect it).