Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mp911de/sg-ready-pi

SG Ready Pi Controller
https://github.com/mp911de/sg-ready-pi

Last synced: 11 days ago
JSON representation

SG Ready Pi Controller

Awesome Lists containing this project

README

        

= SG Ready Pi Controller

This application is an SG Ready Controller to determine available power vs. power consumption and derive a SG- Ready State.
This is done by reading from a power generator such as PV inverter including batteries and comparing egress/ingress to a power meter reading.

https://www.waermepumpe.de/normen-technik/sg-ready/[SG Ready] is a standard to indicate the following states to an electrical heat pump:

* Normal State (No indication, `0:0`)
* Lock (Reduce power consumption, `1:0`)
* Available Power/Low Tariff (Increase Temperature, Indicate that consuming power now would be favorable, `0:1`)
* Switch on Heating/Excess Power (Switch on the heater to consume excess power, `1:1`)

The underlying idea is that hot water tanks are effectively batteries.
Heating water up with excess power combined with good insulation acts as energy buffer and so, the water tank doesn't require heating for quite a while.
This concept only works when heating water beyond the regular temperature as the excess heat takes longer to cool off.
Ideally, the next water heating cycle falls into a time when solar power is available so that you don't need the heater during night hours.

== Hardware

This project is designed to run on RaspberryPi to benefit from a low-power consuming compute platform.

=== SG Ready Control Signal Handlers

SG Ready signal indication uses external relays to close two independent circuits.
It is similar to using GPIO and pulling an input pin to GND, however, you should expect a potential-free signal source from the heater.

Currently supported:

* https://www.waveshare.com/wiki/RPi_Relay_Board[Waveshare RPi Relay Board]

image:https://www.waveshare.com/w/A6Y79bcq/Kdy80nYY.php?f=Rpi-relay-board-1.jpg&width=600[Waveshare RPi Relay Board,200]

=== Power Meters

Currently supported:

* SMA Sunny Home Manager 2.0 over Speedwire (Multicast)

=== Inverters

Currently supported:

* SMA Tripower over Modbus TCP (more models could be potentially supported)

=== Weather Forecast-based optimization

To optimize energy consumption, this project calculates sunset times and obtains a https://open-meteo.com[weather forecast] for your position (see `sg.weather.longitude`/`sg.weather.latitude` properties).
Based on `sg.weather.desired-excess-duration` (how long SG Ready 1:1 should be active), forecast-based optimization determines the time in which we can consume solar power (less than 60% cloud coverage, duration of `sg.weather.not-before-sunset` before sunset) and enables excess power signalling in the time window to move power consumption to a time as late as possible.

==== Weather Implications

We're only interested in cloudiness.
If there's rain, then there's also clouds.
The current threshold is at 60% calculated for low and mid-level clouds.
Cloudiness below that threshold is considered as sunny time meaning there's sufficient energy available.
While some systems might provide sufficient energy at higher cloudiness, that's a good starting point.

==== Sunset

When there's sun, then likely, we can generate energy from it.
Clearly, the more the sun sets, the less excess energy we can generate from it.
Therefore, we have a configurable duration (`sg.weather.not-before-sunset`) that limits how much time before sunset we can obtain a reasonable amount of solar power to avoid draining the battery.

== Foundation

This project is built with:

* Maven
* https://github.com/spring-projects/spring-boot[Spring Boot 🍃]
* https://github.com/Pi4J/pi4j-v2[Pi4J]
* https://github.com/lujop/smasolarlib[smasolarlib] by https://github.com/lujop[lujop].
* https://github.com/klausbrunner/solarpositioning[solarpositioning] by https://github.com/klausbrunner[Klaus Brunner].
The code is inlined into this repo as there is no artifact available from Maven Central.

== Building from Source

If you want to try out the latest and greatest, the project can be easily built with the https://github.com/takari/maven-wrapper[maven wrapper].
You also need JDK 17.

[source,bash]
----
$ ./mvnw clean install
----

If you want to build with the regular `mvn` command, you will need https://maven.apache.org/run-maven/index.html[Maven v3.9.0 or above].

== License

Spring Boot is Open Source software released under the https://www.apache.org/licenses/LICENSE-2.0.html[Apache 2.0 license].