Skip to content

Firestone82/SolaxAutomation

Repository files navigation

SolaxAutomation

Raspberry Pi automation for a Solax X3-Hybrid-G4 solar inverter — optimizes self-consumption using real-time weather forecasts and spot electricity prices.

Java Spring Boot Platform

About

SolaxAutomation runs on a Raspberry Pi 4B and controls a Solax X3-Hybrid-G4 inverter via Modbus TCP. It fetches hourly weather forecasts from Meteosource and spot electricity prices from spotovaelektrina.cz, then dynamically adjusts inverter behaviour to maximise solar self-consumption and minimise energy costs. Logs rotate daily with automatic compression.

Features

  • Dynamic inverter control via Modbus TCP
  • Weather-aware operation using Meteosource API forecasts
  • Price-driven scheduling via spotovaelektrina.cz spot prices
  • Battery charge/sell automation based on time-of-day and price thresholds
  • Configurable power export limits and reduced-output windows
  • Daily log rotation with compression

Requirements

Hardware

  • Raspberry Pi 4B running Raspbian
  • Solax X3-Hybrid-G4 inverter with Modbus TCP enabled
  • (Optional) RS485-to-Ethernet converter for systems without direct Modbus TCP

Software

  • Java 17+
  • Maven 3.x

API access

Setup

  1. Clone the repository:

    git clone https://github.com/Firestone82/SolaxAutomation.git
    cd SolaxAutomation
  2. Copy the example config and fill in your inverter address, Meteosource API key, and location coordinates:

    cp src/main/resources/application.yml.example application.yml
  3. Build the project:

    mvn clean package -DskipTests
  4. Run:

    java -jar target/solax-automation-*.jar
  5. (Optional) Install as a systemd service for automatic startup:

    Create /etc/systemd/system/solax-automation.service:

    [Unit]
    Description=Solax Automation
    After=network.target
    
    [Service]
    User=pi
    ExecStart=/usr/bin/java -jar /home/pi/SolaxAutomation/target/solax-automation-*.jar
    WorkingDirectory=/home/pi/SolaxAutomation
    Restart=on-failure
    
    [Install]
    WantedBy=multi-user.target

    Then enable and start it:

    sudo systemctl daemon-reload
    sudo systemctl enable --now solax-automation

Logs

Logs are written to both console and the logs/ directory. Log files rotate daily with automatic compression.

License

This project is provided as-is for personal use. No warranty is offered.

About

Raspberry Pi automation for a Solax X3-Hybrid inverter using weather forecasts and spot electricity prices

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors

Languages