Can you please post an example?
Small update: Just added a few buttons in the HAOS UI so that I can reach them easily from my mobile phone, since Node-RED is a nightmare on small screens.
Hi there @enoch85, your setup looks great. I’m so new to HA (literally just installed on my Pi4 today) and have no idea where to start, it looks so complicated and involved. I don’t want to head down the wrong path from the start, so I’m wondering if you might be able to recommend an up to date workflow to setup a Gen24 with BYD battery.
Looking at the post at the top of this thread it talks about ‘modbus configuration and registers’, I have no idea which file in HA need these changes, I think some changes to configuration.yaml are required, but where does ‘derived template sensors’ go? Should Gen24 be float or int+SF?
There seems to be differing ways to integrate Fronius throughout the thread, like Modbus (which I’m familiar with), or Solar.API or SunSpec. Looks like some don’t allow you to control (write) to the inverter and so on. What is the preferred currently method?
Any help very much appreciated.
Thanks @mxcxpx
I’m trying to setup controls for Amber energy (https://www.amber.com.au/) [wholesale prices], which means I need to control when and how much is imported or exported by the system and currently Amber doesn’t support Fronius inverters so I have to do it myself. Or is there anyone doing this already?
This is what I set up but I have a sonnen battery and I don’t control anything through my Fronius inverter. I control the battery directly.
See here.
Control priorities, just disable export control to let modbus control the battery again.
Export Limits nothing to see here folks except the 0% export setting ofc.
Started typing this like 2 months ago but almost instantly realised it wouldn’t work in my specific case since I need to have my export limit on at all times. However for the rest of you that isn’t dumb enough to have a solar system capable of blowing your main fuses on a daily basis … but I re-read this thread and user @heyyitsal has already figured this out for you but you seem to have missed the point on it somewhat I’ll revisit this when I got this working properly in a week or three.
Hi @rcruikshank, thanks for the info. I have a BYD battery, which doesn’t appear to have any user accessible controls, its just a battery. Fronius does all the work, talking to it via Modbus RTU.
I did find an Amber Electric HA intergration, https://www.home-assistant.io/integrations/amberelectric/, should i install this too?
@friskens, my Fronius controlling priorities has 1: I/O, 2: Export & 3: Modbus, it looks like you can drag them to change the priorities and in your screen shot you have modbus in the middle, but you say ‘disable export control’, what do you mean by that?
All this slight stresses me out because we’re dealing with large amounts of stored energy, money and grid connected things. I fill if you make a mistake you could easily damage hardware or cost yourself money.
thanks
Yes this integration gives Home Assistant access to the amber API and sets up a number of sensors in HA that you can use to automate control over loads in your house.
I understand you’re new to HA so a bit of work to get used to this system.
In summary what I do is use that data from amber to control deferrable loads in the house. Things like pool pumps, hot water system, and charging your EV etc. To allow HA to control these things you need smart switches and OCPP EV charger (or Tesla car which can be controlled from HA with a HACS integration).
I also use the forecast data from amber and forecast PV data etc. to feed into EMHASS so it can come up with a plan to manage these loads and the charging/discharging of the battery. This can be represented with apex charts in HA like this:
The top one is the forecast supply and feed-in tariff from amber compared to the plan to charge and discharge the battery and turn on and off pool pump and car charger etc. Also the expected solar energy for tomorrow as predicted by solcast.com, expected energy consumption extrapolated from the last two days of household consumption and grid consumption forecast.
The bottom one is the battery SOC forecast which is what I’m currently using to charge and discharge the battery via the sonnen REST API. You would have to achieve the same control over your BYD battery via inverter MODBUS. I think there are plenty of people doing this but not sure.
If you read through my document you’ll see there’s a lot involved and most of what is there was figured out by people before me who are active in the EMHASS group. I only started looking into this in August last year.
EMHASS itself is a complicated tool that takes all these forecasts and uses different methods to come up with these plans. I pass the various forecast arrays to EMHASS every 60 seconds and it continuously recalculates the plan as the data changes to take advantage of the wholesale prices and the deferrable loads and battery capacity in my home.
If you go to the EMHASS group and ask if anybody has implemented in a Fronius+BYD environment there maybe somebody who has figured it out. There’s actually two groups, the latter being the main one I think:
- EMHASS add-on: An energy management optimization add-on for Home Assistant OS and supervised
- EMHASS: An Energy Management for Home Assistant
EMHASS itself can be fount here
Solar curtailment can be an important factor if you have a lot of PV so this forum here is where that is solved and that’s a different problem than what EMHASS solves.
I haven’t had to curtail PV yet so haven’t figured out how to do it via my Fronius inverter. I should read through this topic to figure it out.
Oh wow, that’s sounds like a fully configured house you have there, nice work. Thanks for all the info, I’ve started reading about EMHASS (I just installed it into HA)
On a different note, I am being presented with “No site provided” from Amber integration, people say its related to “an issue with your account (most likely a delay in processing)”.
Anyway, i wont hijack this thread with Amber integration. Thanks everyone.
When I import the NodeRed Flows, I have many missing NodeRed Palettes, especially related to the SolarAPI, can anyone tell me, which Palettes I need to install before importing the flows?
//EDIT
Okay it was only HomeAssistant, which was missing, cause I will not use HA, I try to make it as simple as possible with NR
Hi,
Thanks!
Yes, it was a bit of tinkering to get working, but now when it works as intended I haven’t touched it. So the one I posted here is basically still the same.
Have a read of my posts above - and have a read of my post - with slight customization you could get up and running within the hour I reckon.
I’m still tinkering with my flows but it’s mostly done. It works 99% of the time except when there are price spikes - where I just control the battery discharge/charge manually because it’s so volatile. The threshold I’ve set to max discharge (on normal days) doesn’t work on days that spike.
Thinking of using some sort of average/median/probabilities of the forecast to ensure the automation only discharges where it’s most likely the peaks of the spike (sounds like Smartshift?).
RE: EMHASS - I’ve got it set up and looks good but I may just use it for battery control. Which you could still use the NodeRed flows as above for for battery control based on what EMHASS outputs.
All this slight stresses me out because we’re dealing with large amounts of stored energy, money and grid connected things. I fill if you make a mistake you could easily damage hardware or cost yourself money.
I don’t think you’ll be able to get battery to do something it doesn’t want to do. There are min/max values to the commands you set, so you should be OK.
EXCEPT: By max discharging/charging multiple times a day, you may be reducing your battery life.
Or by flipping your inverter output power 100-0 - could reduce lifespan? Who knows.
Hey Al, just found your post and thanks for linking to my post about the Gen24 hopefully that helps a few people. The installer charged me $200 AUD to change the profile!
Does your config still work in HA 2024.2.5?
Also does the node red modbus use the core modbus intergration or its own?
I have found that modbus wont work unless you configure sensors. According to the core intergration dev this is a new change.
https://github.com/home-assistant/core/issues/112792
With 2024.3.1 (not released) you will get a clear warning, that at least one entity is needed.
first of all it does not make sense to have an integration without entities, since it cannot be viewed in HA, at least you should have entities that verify your writes.
It was never allowed and have caused different instability issues, to the point where it gives an exception, its luck you have not experienced problems before.
My inverters ramp fine so have never needed entites for the inverters as i can see the response in real time
The issue i have is if i add any sensor HA takes over 10 minutes to start.
(sensor is commented out due to issues with HA starting)
modbus:
- type: tcp
host: 192.168.1.143
port: 502
name: "MBFronius_Primo"
#retry_on_empty: true
#retries: 3
timeout: 14
- type: tcp
host: 192.168.1.231
port: 502
name: "MBFronius_Gen24"
#retry_on_empty: true
#retries: 3
timeout: 14
# sensors:
# - name: "Primo_WMaxLimPct_Primo"
# address: 40232
# scan_interval: 15
# unit_of_measurement: "%"
HA 2024.2.4 modbus works fine
2024.2.5 modbus requires and entity so it breaks my config
Looking into replicating your blog post using my existing scaling factor that i get from my powerwall home load sensor
@heyyitsal, thanks heaps for pointing me to your blog, awesome, I’ve started following.
I do have one small snag, I cant get my inverter to change its priorities, I can drag the options around but when I click save I just get spinning wheel.
Is there a trick to allow you to allow saving of this change?
Try a different browser/incognito mode/turn off adblocker?
No go, I have tried:
Google Chrome Version 122.0.6261.112 (Official Build) (64-bit)
Chrome incognito
Chromium via Raspberry Pi
Microsoft Edge Version 122.0.2365.80 (Official build) (64-bit)
Firefox (Ubuntu 20.04)
Apple Safari via iPhone
I disabled PiHole adblocker (although I don’t think that would be related), I’m not running browser based adblocking.
I also updated the Fronius firmware from 1.22 to 1.28 (after doing that I notice it now takes ages to respond to changes in the load , I’m thinking of rolling it back as it didn’t fix my save issue and I don’t like the laggyness)
Any other ideas?
Hey Al, just found your post and thanks for linking to my post about the Gen24 hopefully that helps a few people. The installer charged me $200 AUD to change the profile!
Thank you for your sacrifice
I use the node-red-contrib-modbus (node) - Node-RED - No need to write any YAML in config.
I’m on
and inverter comms still OK, although I am getting weird overall NodeRed communication issues with HA (flapping sensor status) every now and then but a restart of NodeRed ends up fixing it. Will need to dig deeper into it.
Overall the flows are working as they should, haven’t really looked into whether I can eke out any more out of it. Only thing now is battery dispatch management which EMHASS seems to be pretty good at and it seems pretty straight forward to integrate into the NodeRed battery control flow.
You know - I think I have had that issue before, I just can’t remember how I got over the spinning wheel.
I just had a try myself - I couldn’t change it also (over VPN), but the inverter is also "stopped’ so I’ll try again tomorrow when its back on.
[Edit] Okay it still doesn’t work via another browser or while it’s on. Can you try on the inverter itself? You can press the Enable WIFI button on the inverter and directly connect to the inverter.
Also firmware is older… I haven’t updated in a while…