Skip to the content.

Self-consumption Strategy Setup

For the self-consumption strategy a PID controler is used. This keeps grid input/output close to 0 W (the target grid consumption). This PID controler needs to be tuned to your home. When your done, it outperforms the vendor’s control algorithm in almost every scenario.

What is a PID Controller

A proportional–integral–derivative controller (PID controller or three-term controller) is a feedback-based control loop mechanism commonly used to manage machines and processes that require continuous control and automatic adjustment. See Wikipedia - Fundamental operation

PID Operation

Complete the getting started first.

Open Node-RED (in an extra browser tab):

In Home Assistant:

Click Full control and select self-consumption as a strategy.

Tip, observe the HA history graph containing:

PID Tuning

PID Presets (Simplified Tuning)

For easier setup, use the PID Presets dropdown in the Home Assistant dashboard. Choose from predefined configurations:

The system automatically applies the selected preset values on selection. After that, you can tune values to your liking.

IMPORTANT SAFETY Carefully monitor for system instabilaty and standby to tune down Kp, Ki, Kd values or disengage batteries when large oscillations persist.

Every system is different and your home requires unique settings. What’s marked as ‘Regular’ for one, can be unstable for others. Keep this in mind. This is also why this system can easily outperform Marstek software, as Marstek needs to put in a healthy safety margin to accomodate these differences between homes.

ADVISE Keep the max. charge/discharge settings low (< 800 W) until you have experience with how your system reacts to coffee machines, hair straighteners, old washing machines and other ‘horrifically noisy devices’.

PID Tuning (Advanced)

Use the Ziegler-Nichols method for a starting point.

  1. Set Kp to say 1.0, and be prepared to decrease it fast if needed.
  2. If the system oscillates in a steady state -> export the HA History graph to CSV.
    • increase Kp when not resonating
    • decrease Kp if the system runs off. (stay alert, not to damage your system)
  3. Determine the resonant frequency. E.g. by using HA-history-graph-csv-export-analysis
  4. Tu = 1 / <resonant frequency> and Ku = your current Kp during resonance
  5. Use the table of the Ziegler-Nichols method to get a baseline.
    • This baseline can be a bit aggressive.

Note: every system is different and your home is unique. Tune in small increments from here.

← Back to Home