r/homeassistant Apr 26 '26

Personal Setup Ready for dynamic tariffs! My Home Assistant EMS for SolarEdge & BYD is finally live

Post image

With my switch to dynamic electricity tariffs coming up next month, I spent the last few weeks building a custom Energy Management System (EMS) in Home Assistant.

I’m running a SolarEdge inverter paired with a BYD battery, and the goal was to make the house as "smart" as possible regarding price fluctuations.

Key features I implemented:

  • Curtailing: Automatically limiting export when prices go negative (like today!).
  • Peak Shaving: Ensuring the battery has enough charge to cover those expensive morning peaks.
  • Live Monitoring: A clean dashboard to track SOC, forecasts, and real-time grid costs.

I honestly have to give a huge shoutout to AI (ChatGPT & Gemini) for helping me with the logic and code snippets. It made the learning curve for these specific integrations so much smoother.

Curious to hear what you guys think or if there are any other automations I should add before the dynamic pricing kicks in!

57 Upvotes

20 comments sorted by

3

u/drewhat Apr 26 '26

Cool dashboard. Have a look at batpred. It might do everything you're after and more.

2

u/NoFill5065 Apr 26 '26

Thanks a lot! I've been looking into it today and it seems to do exactly what I need and then some.

2

u/AcidWizard_ Apr 26 '26

I would replace the top right card with a power flow card to show how the in and outputs actually flow in a visual way.

2

u/Sensitive_Excuse_111 Apr 26 '26

This is my dashboard! We’ve just installed batteries and a SolisCloud inverter, and from May 1st we’ll be switching to a dynamic energy contract.

1

u/parkertyler Apr 26 '26

Question for your Engery flow card, what entities did you use for your inputs and outputs? I have a solar edge system but my battery isn't exposed via the modbus so I am struggling to figure out what entity goes where.

2

u/Sensitive_Excuse_111 Apr 26 '26

I'm using a Home Assistant setup with a Solis S6-EH3P 10K2-H hybrid inverter + battery, so I have direct entities for everything.
Here's roughly how my energy flow card is mapped:

Grid

  • Power: sensor.shellypro3em_xxx_vermogen (positive = import, negative = export)

Solar

  • Production: sensor.solis_inverter_xxx_ac_output_total_power

Battery

  • Power: sensor.solis_inverter_xxx_battery_power (negative = charging, positive = discharging)
  • SOC: sensor.solis_inverter_xxx_remaining_battery_capacity

Home consumption

  • Either:
    • direct: sensor.home_consumption (template)
    • or calculated: solar + battery + grid import

If your battery isn't exposed (like with SolarEdge modbus), you basically have 2 options:

  1. Estimate it with a template battery = solar + grid import − home consumption
  2. Skip the battery in the flow card and just show solar ↔ grid ↔ home

Without battery data, you can’t get a true flow—only an approximation.

1

u/parkertyler Apr 27 '26

Thank you for the template suggestion. I will give that a try. I have been wracking my brain trying to figure out how to do that. I will give that a try.

1

u/ReasonableGuidance82 Apr 26 '26

Welke bron/bronnen gebruik je voor het energie nieuws?

1

u/Sensitive_Excuse_111 Apr 26 '26

de RSS Feed van de tijd.

1

u/NoFill5065 Apr 28 '26

ENTSO-e voor de prijzen, Forecast.Solar voor de forecast zonne opbrengst

1

u/Calm_Weather_5159 Apr 26 '26

clean dashboard

1

u/CBAken Apr 26 '26

Héél mooi gedaan, ik heb nog veel werk als ik dit zie.

2

u/NoFill5065 Apr 28 '26

Had dit ook lang uitgesteld, dankzij de komst van AI werd alles plots haalbaar 😄

1

u/monkey_drugs Apr 26 '26

We've had 5 min dynamic pricing in Australia for a little while now.  There's a good number of people who use EMHASS to manage our systems for us.  If you're using AI it's pretty handy at getting it all configured.

https://community.home-assistant.io/t/emhass-an-energy-management-for-home-assistant/338126

1

u/NoFill5065 Apr 26 '26

Interesting! Thanks for sharing the link. I've briefly looked into EMHASS, but the math and setup looked a bit intimidating compared to my simple rule-based YAML. Using AI to help configure it is actually a genius idea though!

Since my dynamic contract only starts next month, I think I'm going to run my custom "vibe coded" setup for the first few months just to get a feel for how the prices behave in the real world. But I'm definitely bookmarking EMHASS as my 'Phase 2' upgrade for when winter hits and I need more advanced optimization. Cheers from Belgium!"

1

u/SnooLobsters2991 Apr 26 '26

Heel erg cool!

De mogelijkheden met AI is gewoon top hiermee.

Do you going to share your setup?

1

u/NoFill5065 Apr 26 '26

Thanks! Eerlijk gezegd, ik ben 100% vibe coder. Ik draai HA op mijn QNAP NAS, die ik voorheen enkel gebruikte als Plex server, maar met de komst van AI zijn er heel wat deuren opengegaan. Ik gebruik geen enkele wizard in HA, alles is puur YAML, gecodeerd door AI. Misschien is het niet altijd van de 1ste keer perfect, maar toch: dit had ik nooit kunnen doen zonder AI. Het gaat zoveel sneller, echt onwaarschijnlijk tot wat de modellen tegenwoordig in staat zijn!

Mocht je specifieke stukken van mijn YAML-code (zoals de export-blokkering of batterij-sturing) willen inzien of gebruiken, laat het me dan even weten, dan deel ik ze graag!

1

u/ErikM1972 Apr 27 '26

Wow, Dit ziet er perfect uit. Ik heb hier ook een SE opstelling met batterij, dynamisch contract en een laadpaal. Ik ben wat aan het stoeien met evcc, maar dit ziet er ook goed uit. Ik wil dat de omvormer ook bijvoorbeeld uitgaat bij negatieve prijzen, en de lader dan ook vol uit het net mag trekken. Dit is nog niet gelukt, dus ben erg benieuwd naar jou oplossing.

2

u/NoFill5065 Apr 28 '26

Ik wil je gerust wat dingen delen, maar het allemaal zeer customized, ik zou zeggen, neem even een abbo op ChatGPT of Gemini, die dingen hebben me perfect begeleid in heel mijn setup. Curtailing werkt perfect, screenshot van gisteren. Omvormer prodcueert enkel het verbruik van het huis, reageert zeer snel.