Growatt Inverter Mode Switch

hi mjdyson

I am ready to test anything if you have something ready :smiley:

thanks again for your good work, been using this since January flawlessly :smiley:

Hey, sorry for lack of response. Been another busy period where I’ve not been able to get into my homelab as much.

I’ve not had much success in testing anything when I did try, as the severs haven’t been responding at the times I’ve been testing. Not sure if it’s being blocked or if it’s just the way it is.

If I can take a look this weekend, I’ll see i can share some code.

Aside, it sounds like @muppet3000 is making good progress with the the grott implementation. Has anyone looked that way?

1 Like

Seeing explosive negative prices atm in denmark and europe this weekend… an exportlimit could be very handy… hope you have time for the project… using it everyday for battery charge/discharge. Thanks for a great project.

Hello @affer do you know if you’re using the main branch, or the testing branch? I think my outbound traffic is being blocked by my firewall (and/or pihole), so need to look into that today first.

P.s. I’ve managed to get it to read the values from the server. Run out of time for this morning, so will come back to it later. Sorry things have been quiet around here… life is busier than normal :sweat_smile:

1 Like

If you Flash your shine or use an esp32 to communicate with the inverter you can easily add this as a switch in home assistant - I have been using this to plan charging, discharging etc. Biggest advantage: fully local and very quick response times.

ESPHome modbus Growatt ShineWiFi-S

remember life is important - please use all the timw you need on family :slight_smile:

i am using testing multi device plants Testing Multi Device Plants · mjdyson/ad-growatt Wiki · GitHub

i have another inverter using this esp32 - i can read values from the inverter, but i can not figure out how to send commands to it, do you have a link explaining this ?

@affer - take a look at the testing branch. Just pushed an update for you.

The controls i’ve built are…

Thanks mjdyson!

i tried changing the two files… when i use ad-growatt/growatt_app.py at b1e1dc4f66d0ff40c2787df5095f0de930710fe4 · mjdyson/ad-growatt · GitHub file, i break my ability read settings from my selected inverter (using multi inverter possibility) and i can not put changed settings to the server either.

i can though - get serial numbers on inverters in my plant

if i change back to original growatt_app.py file all is working again.
(ive added export limit to the ‘get values from server’ windows.

hope u can point me where i may do something wrong, thanks for your time

Evening.

Did you also change the other config.yaml file?
Also did you restart HA with the new files, specifically after the config.yaml file?

Good job on making a backup. Should’ve reminded you about that too

yes both changed.

growatt_app.py and config.yaml - always backing up the original working file :slight_smile:
restarted, and i tried to compare the files with original. my coding skills is not that good :-/

config.yaml is working for both new and old growatt_app.py.

Happy to help. I’ve just sent you a DM with what I do to get it working. Hopefully put you on the right track. I’ll try to respond as quickly as I can :slight_smile:

Hi Mark,

Building on your excellent ad-growatt, I have improved it to be able to control Export limit and Grid first + a few other improvements, that I think makes automations easier. It’s branched out here:

Bascially everything is now in one Lovelace card with functions to Get and Save all parameters on the card.

Hi @martinm ,

Thanks for your guide, it helped me eventually getting everything to work and also great thanks to @mjdyson, @KasperEdw, @muppet3000 for providing the code foundation.

My Growatt HA integration is finally where I want it to be, as it can:

  • Charge the battery when cheap power in the night and low forecasted production tomorrow.
  • Stop export when prices drop below a certain price point
  • Export from battery when price is high and forecasted production is high

To get it stable I rely 100% on Grott for data collection, as it will not trigger blocking on the servers and make the ad-growatt module very stable, when it’s only used for changing configuration.

Everything is controlled via this Lovelace card

The branched out ad-growatt module can be found here:

The steps to set up is:

  1. If you have the old Growatt integration installed, remove it, as it might trigger the server block on Growatt servers. For monitoring, use Grott. This step is optional but will improve stability greatly.

  2. Install AppDaemon from Add-ons in HA

  3. Copy files from ad-growatt on Github to your config directory (/config on my HA Yellow, will use this path going foroward, but it might be different on your installation)

  4. Modify /config/configuration.yaml to include

homeassistant:
packages: !include_dir_named packages

  1. Modify /config/secrets to include:

growatt_username: X
growatt_password: X
growatt_device: X

Replacing X’s with login, password and Device Serial Number (found on main page of Growatt Server: Login Page)

  1. Restart HA, or just reload HA configuration and restart AppDaemon

  2. Create a Lovelace card with

type: entities
entities:
  - entity: input_boolean.adgw_export_limit_on
  - type: divider
  - entity: input_select.adgw_battery_charge_max_soc
  - entity: input_boolean.adgw_ac_charge_on
  - entity: input_datetime.adgw_battery_first_time_slot_1_start
  - entity: input_datetime.adgw_battery_first_time_slot_1_end
  - entity: input_boolean.adgw_battery_first_time_slot_1_enabled
  - type: divider
  - entity: input_select.adgw_grid_discharge_stopped_soc
  - entity: input_datetime.adgw_grid_first_time_slot_1_start
  - entity: input_datetime.adgw_grid_first_time_slot_1_end
  - entity: input_boolean.adgw_grid_first_time_slot_1_enabled
  - type: divider
  - entity: input_button.adgw_get_charge_settings_button
  - entity: input_button.adgw_set_charge_settings_button
  - entity: sensor.template_adgw_api_state
title: Inverter settings
show_header_toggle: false
  1. Enjoy controlling your Growatt inverter directly from HA !!
1 Like

Fantastic work Kasper! I’m glad that my code was able to help.
I’m also really glad that someone else might be able to offer some support to the people on here. I really struggle to find the time. :slight_smile:

1 Like

Just been working through this, thanks Mark and Kasper!!

Got your branch working just fine. At the moment my use case is just to control charging the battery from the grid overnight (I have a cheap import rate between 02:00 and 05:00). I’ve set a button to enable charging if I want to do it manually. I also have an automation running at 23:30 - it checks if the forecast generation for tomorrow is under 10kWh and also if there is someone at home. If both are true it sets the battery for charge. I then have a fixed automation every day at 06:00 which disables the overnight charge.

Hi,

I am trying to make this work… and all works except one entity:

@KasperHolchKragelund what can be the reason for this?!

Also, if I understand correctly, once other modes disabled, it revers back to load first mode?
p.s. I cannot also load setting for the server, looks like… or nothing I change are seen on the Growatt server

Hi,

@snu-snu-snu I just tried this and I have the same error as you, have you found a solution?

@Snux , could you please share your automation details, I might be configuring something similar.

I also hope that Solar Assistant would be implementing these commands soon and we can skip the Growatt cloud and control directly thru the RS485.

This might be a bug in the example. Hopefully this fixes it for you.

There are 2 buttons in the config.yaml file - see the image above. Adjust the lovelace card to use these names instead (and remove the one not working)