Skip to content
View in the app

A better way to browse. Learn more.

Power Forum - Renewable Energy Discussion

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Sunsynk/Home Assistant change grid charge automatically according to weather

Featured Replies

Hi all. 

I have HA set up and linked to my Sunsynk inverter via a USB-RS485 adapter. 

What I want to do is quite simple, but setting it up isn't. 

I want HA to check whether the weather is sunny or cloudy/rainy and automatically set grid charge to on/off. 

Can anyone advise how to do this? 

9 hours ago, Richyrich said:

Hi all. 

I have HA set up and linked to my Sunsynk inverter via a USB-RS485 adapter. 

What I want to do is quite simple, but setting it up isn't. 

I want HA to check whether the weather is sunny or cloudy/rainy and automatically set grid charge to on/off. 

Can anyone advise how to do this? 

What is the ultimate goal, because depending on your system and the reason behind this need, could the timer settings along with percentages not get this done in the sunsynk menu?

I am asking this out loud to others, because maybe this could be possible.

 

Alternatively Scoobs, suggestion is going to work for your needs

1 hour ago, Garthox said:

I am asking this out loud to others, because maybe this could be possible.

On rainy days I monitor the daily battery charge in kWh, if by 12 I have not reached a certain minium amount I change my setting to become "priority Battery" that means, my inverter will run from the grid (till it reaches the time of use SOC) en every little bit of sunshine charges my battery. Those days I might only get to 70% battery but I am at least not charging from the grid. Every evening an automation changes my automation back to "priority load".

That way I am giving Eskom the least amount of business , and still I do not change a thing, everything happens automatically.

Combining the Time of Use with automations can improve the effectiveness of you solar and save you money in the long run.

1 hour ago, Garthox said:

What is the ultimate goal, because depending on your system and the reason behind this need, could the timer settings along with percentages not get this done in the sunsynk menu?

I am asking this out loud to others, because maybe this could be possible.

Alternatively Scoobs, suggestion is going to work for your needs

Hi @Garthox , I think that what @Richyrich wants to do it have different settings for different forecast levels.

So discharge the batteries to 20% SOC if there is good weather forecast for tomorrow. 

If there is overcast/low solar radiation weather forecast then only discharge to 40% SOC. 

The only thing you could do with just the inverter is set it for 40% and then loose use of that 20% (40% -20%) capacity when there is good weather. 

In my case 20% capacity works out at about 5kw/hr or >R10 a day that you can use that capacity, so there is definitely a use case for it

4 minutes ago, Sc00bs said:

Hi @Garthox , I think that what @Richyrich wants to do it have different settings for different forecast levels.

So discharge the batteries to 20% SOC if there is good weather forecast for tomorrow. 

If there is overcast/low solar radiation weather forecast then only discharge to 40% SOC. 

The only thing you could do with just the inverter is set it for 40% and then loose use of that 20% (40% -20%) capacity when there is good weather. 

In my case 20% capacity works out at about 5kw/hr or >R10 a day that you can use that capacity, so there is definitely a use case for it

That is a very good use case you have explained there, and I can definitely now see the benefit doing it in such a way.

 

More battery use and less eskom today, in anticipation for more solar recharge the next day. 🤓

1 minute ago, Sc00bs said:

@Garthox If you have a fair amount of batteries,  I think that adjusting your System Mode settings based on the Weather Forecast is actually probably more useful than adjusting for the load shedding level.  

Definitely going to do a video setting up an automation to do it in the next day or so. 

I agree, the more I'm thinking of this question raised by Richy, the better it is looking.

I'd be keen to watch that video @Sc00bs

  • 2 weeks later...
  • Author

Hi all, sorry for the delay in reply, for some reason I didn't get a notification anyone had replied 🙈

Thanks for all the replies.

A little about my set up - I am as off grid as possible currently. I use Eskom at a bare minimum, only between 03:00 and 08:00. I use solar during the day and battery from the time the sun goes down until the batteries reach 35%. I have 5460w of PV panels and 14KW battery.

So what I actually want to achieve is to be able to tick the GRID CHARGE box in the first picture, remotely(and automated). I see this isn't actually possible for some strange reason(I am possibly going to request this from SunSynk)

In picture 2, using the timer, the box to tick GRID only allows the load to be switched to GRID if the SOC reaches the defined %, therefore preserving the SOC. 
So the way I have my timers set up works perfectly when the weather is good. The inverter will automatically switch from using BATTERY to using GRID to power the load(not charge the batteries) if the SOC reaches 35% from 03:00 to 08:00. 
This is because the GRID CHARGE box is unticked. If I tick the GRID CHARGE box, it will then charge the batteries as well during the evening hours, which I don't want. 

Now if its a cloudy day, and Eskom is actually on, the inverter will keep using GRID to power the load if there is not enough PV power coming in. 
The batteries will however only be charged by the PV and not the grid. 

I want to set up an automation so that if SOLCAST detects that it will be cloudy today, the grid charge box must be ticked, and then unticked at 18:00. 

So which ever way the batteries are charged, they will be at 100% SOC by 18:00.

So essentially, GRID CHARGE must only be ticked on cloudy days. I hope this makes sense, I feel like I may have rambled a bit :)

 

1.png

1691336323249-min.jpg

Edited by Richyrich

21 minutes ago, Richyrich said:

Hi all, sorry for the delay in reply, for some reason I didn't get a notification anyone had replied 🙈

Thanks for all the replies.

A little about my set up - I am as off grid as possible currently. I use Eskom at a bare minimum, only between 03:00 and 08:00. I use solar during the day and battery from the time the sun goes down until the batteries reach 35%. I have 5460w of PV panels and 14KW battery.

So what I actually want to achieve is to be able to tick the GRID CHARGE box in the first picture, remotely(and automated). I see this isn't actually possible for some strange reason(I am possibly going to request this from SunSynk)

In picture 2, using the timer, the box to tick GRID only allows the load to be switched to GRID if the SOC reaches the defined %, therefore preserving the SOC. 
So the way I have my timers set up works perfectly when the weather is good. The inverter will automatically switch from using BATTERY to using GRID to power the load(not charge the batteries) if the SOC reaches 35% from 03:00 to 08:00. 
This is because the GRID CHARGE box is unticked. If I tick the GRID CHARGE box, it will then charge the batteries as well during the evening hours, which I don't want. 

Now if its a cloudy day, and Eskom is actually on, the inverter will keep using GRID to power the load if there is not enough PV power coming in. 
The batteries will however only be charged by the PV and not the grid. 

I want to set up an automation so that if SOLCAST detects that it will be cloudy today, the grid charge box must be ticked, and then unticked at 18:00. 

So which ever way the batteries are charged, they will be at 100% SOC by 18:00.

So essentially, GRID CHARGE must only be ticked on cloudy days. I hope this makes sense, I feel like I may have rambled a bit :)

 

1.png

1691336323249-min.jpg

Hi

That’s very possible with this:

 


 

and Home Assistant. 

1 hour ago, Richyrich said:

So essentially, GRID CHARGE must only be ticked on cloudy days. I hope this makes sense, I feel like I may have rambled a bit :)

If you have Home Assistant, try this: 

 

  • Author
On 2023/08/06 at 6:11 PM, johanp said:

Hi

That’s very possible with this:

 


 

and Home Assistant. 

Thank you. I'm pretty sure what he has there is essentially the same as what I have with the RS485 to USB converter though. 

but I saw on his video, as per the attached pic, that it has the option to enable grid charge. 

I am sure the USB to RS485 can also do it, I just don't have the correct sensor name

@Sc00bs Maybe you know?

Screenshot 2023-08-07 214047.png

Edited by Richyrich

12 minutes ago, Richyrich said:

Thank you. I'm pretty sure what he has there is essentially the same as what I have with the RS485 to USB converter though. 

but I saw on his video, as per the attached pic, that it has the option to enable grid charge. 

I am sure the USB to RS485 can also do it, I just don't have the correct sensor name

@Sc00bs Maybe you know?

Screenshot 2023-08-07 214047.png

Similar hardware maybe, but he did mention on his thread that he’s written his own firmware for it. 

9 hours ago, Richyrich said:

Thank you. I'm pretty sure what he has there is essentially the same as what I have with the RS485 to USB converter though. 

but I saw on his video, as per the attached pic, that it has the option to enable grid charge. 

I am sure the USB to RS485 can also do it, I just don't have the correct sensor name

@Sc00bs Maybe you know?

Screenshot 2023-08-07 214047.png

Hi @Richyrich

The integrations which enable you to change the inverter settings are (as far as I am aware):

- ESP32 & RS485

- USB - RS485 using the KellerZa integration

- @iiznh 's ESP32 & RS485 with custom firmware 

At the moment you can't write settings with the Sunsynk or Solarman integrations out the box but I think you can do it with the Sunsynk integration using the extra NodeRed flow. 

 

 

9 minutes ago, Sc00bs said:

Hi @Richyrich

The integrations which enable you to change the inverter settings are (as far as I am aware):

- ESP32 & RS485

- USB - RS485 using the KellerZa integration

- @iiznh 's ESP32 & RS485 with custom firmware 

At the moment you can't write settings with the Sunsynk or Solarman integrations out the box but I think you can do it with the Sunsynk integration using the extra NodeRed flow. 

 

 

Yep, I'm using @iiznh's dongle. For R700 it was a no brainer and basically plug & play.

IMG_6672.thumb.jpeg.1182b53e00b3cd1d7bcbd610f14e276a.jpeg

9 hours ago, Sc00bs said:

Hi @Richyrich

The integrations which enable you to change the inverter settings are (as far as I am aware):

- ESP32 & RS485

- USB - RS485 using the KellerZa integration

- @iiznh 's ESP32 & RS485 with custom firmware 

At the moment you can't write settings with the Sunsynk or Solarman integrations out the box but I think you can do it with the Sunsynk integration using the extra NodeRed flow. 

 

 

Just adding Solar Assistant <> HomeAssistant integration allows this as well (through mqtt)

3 hours ago, mzezman said:

Just adding Solar Assistant <> HomeAssistant integration allows this as well (through mqtt)

Could you please post an example integration you are using to adjust inverter values/settings. Be interested to see the level of detail required.

I wrote a Bluetooth DALY BMS to MQTT integration, and I quickly discovered that working with MQTT works for the basic case like a switch but quickly becomes troublesome for anything with properties and settings

Using something like "scenes" with the video above will not be achievable through MQTT. Well technically you could define a number, add onChange triggers that would send MQTT messages, but that seems like a lot of work to change a value in the first place.

"Technically possible" does not mean everyone would want to build their smart home like that

16 hours ago, iiznh said:

Could you please post an example integration you are using to adjust inverter values/settings. Be interested to see the level of detail required.

I wrote a Bluetooth DALY BMS to MQTT integration, and I quickly discovered that working with MQTT works for the basic case like a switch but quickly becomes troublesome for anything with properties and settings

Using something like "scenes" with the video above will not be achievable through MQTT. Well technically you could define a number, add onChange triggers that would send MQTT messages, but that seems like a lot of work to change a value in the first place.

"Technically possible" does not mean everyone would want to build their smart home like that

So the good thing about the Solar Assistant integration is it obfuscates the mqtt - so all I get are a set of sensors that i can toggle or values i can change / set

image.png.e3536d500a2d66b055f4bc183ae0bf61.png

 

Then based on this its a simple automation to change a value. In this automation i charge the geyser from the grid for the early morning showers based on a set of conditions and then i set the house to run off inverter again once this is done 

alias: Geyser morning charge
description: ""
trigger:
  - platform: time
    at: "04:10:00"
  - platform: time_pattern
    enabled: true
    minutes: "5"
  - platform: template
    value_template: >-
      {{
      timedelta(minutes=(state_attr("sensor.load_shedding_area_tshwane_3_garsfonteinext3",
      "starts_in"))) == timedelta(minutes<65) }}
    enabled: true
condition:
  - condition: time
    after: "04:15:00"
    before: "07:15:00"
    weekday:
      - sun
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
    enabled: true
  - condition: and
    conditions:
      - condition: state
        entity_id: binary_sensor.grid_available
        state: "on"
      - condition: or
        conditions:
          - type: is_battery_level
            condition: device
            device_id: 117ead9d1883967
            entity_id: sensor.battery_state_of_charge
            domain: sensor
            above: 30
  - condition: or
    conditions:
      - condition: template
        value_template: >-
          {{
          timedelta(minutes=(state_attr("sensor.load_shedding_area_tshwane_3_garsfonteinext3",
          "starts_in"))) == timedelta(minutes<65) }}
      - condition: time
        after: "04:15:00"
        before: "07:00:00"
        weekday:
          - sun
          - mon
          - tue
          - wed
          - thu
          - fri
          - sat
    enabled: false
action:
  - device_id: 117ead9d1883967
    domain: number
    entity_id: number.max_grid_charge_current
    type: set_value
    value: 2
  - type: turn_off
    device_id: 117ead9d1883967
    entity_id: switch.use_timer
    domain: switch
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - type: turn_on
    device_id: f58645638cce28e4
    entity_id: switch.geyser_switch_1
    domain: switch
  - delay:
      hours: 2
      minutes: 15
      seconds: 0
      milliseconds: 0
  - type: turn_off
    device_id: f58645638cce28e4
    entity_id: switch.geyser_switch_1
    domain: switch
  - delay:
      hours: 0
      minutes: 5
      seconds: 0
      milliseconds: 0
  - type: turn_on
    device_id: 117ead9d1883967
    entity_id: switch.use_timer
    domain: switch
  - delay:
      hours: 0
      minutes: 0
      seconds: 15
      milliseconds: 0
  - device_id: 117ead9d1883967
    domain: number
    entity_id: number.max_grid_charge_current
    type: set_value
    value: 120
  - device_id: 117ead9d1883967
    domain: number
    entity_id: number.max_charge_current
    type: set_value
    value: 120
mode: single

 

4 hours ago, mzezman said:

So the good thing about the Solar Assistant integration is it obfuscates the mqtt - so all I get are a set of sensors that i can toggle or values i can change / set

Thank you for posting the snippet, clearly there is a way to define numbers/switches/sensors etc via MQTT then. Having native Home Assistant types helps to make the integration a lot better. When I built my first MQTT integration  (Daly BMS Bluetooth -> MQTT) I was not aware of the types so it made the integration a pain to work with

Clearly I need to revisit the howto of HA MQTT

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.