Skip to content

robertdiers/solar-monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

solar-monitor

  • Using GoodWe hybrid inverters, because they are able to work with negative house load - in my case energy from other inverters
  • Want to avoid cloud usage, the SolaX inverters are measured by cheap Shelly PM Mini G3
  • Connected heat pump to HV inverter/battery, as I want to make use of solar surplus as early as possible (https://github.com/robertdiers/goodwe_idmpump)

Setup:

  • GoodWe GW8K-ET inverter (HV)
  • BYD HVS storage
  • iDM Heat Pump AERO SLM 6-17 with "solar input" feature
  • multiple Solax Mini inverters (power metered by Shelly PM Mini G3)
  • GoodWe 5048D-ES inverter (48V)
  • 48V battery block with Daly BMS (3 blocks in parallel)
  • Tasmota device with temperature sensor (Sonoff TH16 + DS18B20)
  • Device to run the containers

arch

main Python scripts (startup and cron triggered):

  • init.py - initializes TimescaleDB tables as they are removed when device restarts
  • daly-subscribe.py - subscribes to DALY MQTT output and store to database (https://github.com/softwarecrash/DALY-BMS-to-MQTT)
  • shelly-subscribe.py - subscribes to Shelly MQTT output (SolaX inverters)
  • solar-monitor.py - collect metrics and store to database

additional Python modules

  • BYD.py - read actual values from BYD battery (TCP Socket)
  • Config.py - read config file and check for environment parameter overrides
  • Daly.py - subscribes to MQTT topic to read data
  • Goodwe.py - read actual values from Goodwe inverter (SEMS Portal API) - UNUSED
  • Goodwe_Local.py - read actual values from Goodwe inverter (python package)
  • IdmPump.py - read actual solar power from iDM heat pump (TCP Modbus)
  • Shelly.py - subscribes to MQTT topic to read data
  • Solax.py - read actual values from Solax inverter (Solax Portal API) - UNUSED
  • Tasmota.py - read Tasmota data (MQTT)
  • TimescaleDb.py - write to TimescaleDB

Docker Compose

please override config values using environment variables (see python/solar-monitor.ini)

services:
    solarmonitor:
        image: ghcr.io/robertdiers/solar-monitor:latest
        container_name: solarmonitor
        restart: always
        environment:
        - MQTT_BROKER=brokerip
        - MQTT_PASSWORD=brokerpassword
        - TIMESCALEDB_IP=databaseip
        - TIMESCALEDB_PASSWORD=databasepassword
        - BYD_IP=bydip
        - IDM_IP=idmip
        - GOODWE_IP_HV=goodweip_hv
        - GOODWE_IP_48=goodweip_48v

TimescaleDB (please define your own password)

Using tmpfs to store data in memory, disc doesn't have to store it:

services:
  timescaledb:
    image: docker.io/timescale/timescaledb:latest-pg14
    container_name: timescaledb
    restart: always
    ports:
      - 5432:5432
    environment:
      - POSTGRES_PASSWORD=yourpassword 
    tmpfs:
      - /var/lib/postgresql/data

Grafana

Dashboard JSON is placed in this repo:

services:
    grafana:
        image: docker.io/grafana/grafana:latest
        container_name: grafana
        restart: always
        ports:
        - 3000:3000
        volumes:
        - ${PWD}/grafanadata:/var/lib/grafana

Mosquitto (MQTT broker, please define your config and password file once)

https://be-jo.net/2024/01/mqtt-broker-mosquitto-als-docker-container-installieren/

mosquitto.conf

persistence false
log_dest stdout
password_file /mosquitto/config/mosquitto.passwd
allow_anonymous false
listener 1883

container:

services:
  mosquitto:
      image: docker.io/eclipse-mosquitto:latest
      container_name: mosquitto
      restart: always
      volumes:
        - folderwithyourconfigandpasswordfile:/mosquitto/config
      ports:
        - 1883:1883
        - 9001:9001

after running the container you can create your own user and password using this command - than restart the container:

mosquitto_passwd -c /mosquitto/config/mosquitto.passwd youruser

About

Read values from BYD, Daly, Goodwe, Tasmota and SolaX

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors