solectrus / hosting

Step-by-stypes guides for installing and hosting Solectrus
9 stars 4 forks source link

Status Fehler Senec v3 Speicher #45

Closed igriepp closed 3 months ago

igriepp commented 3 months ago

Hallo, es steht alle 5 -10 Sekunden im Status "keine Verbindung" statt Laden oder PV+Entladen oder Peak Shaving ..... etc.

Ich habe den Abruf der Daten auf 1 Sec in der Config geändert und zum testen auch wieder auf 5 Sec eingestellt.

MfG Ilja Griepp

ledermann commented 3 months ago

Grundsätzlich ist es so, dass die Meldung "Keine Verbindung" erscheint, wenn der aktuelle Messwert in der InfluxDB älter als 2 * INFLUX_POLL_INTERVAL ist.

Ich vermute, du hast nur die Variable INFLUX_POLL_INTERVAL verändert. Diese legt fest, in welchem Intervall vom Dashboard Werte aus der InfluxDB gelesen werden. Ein häufigeres Abfragen bringt aber nur etwas, wenn die Werte auch oft genug dort hineingeschrieben werden. Dies ist bei dir vermutlich nicht der Fall.

Du solltest also die Variable SENEC_INTERVAL prüfen. Diese legt fest, in welchem Intervall der SENEC-Collector Werte vom SENEC-Speicher abruft und in die InfluxDB schreibt.

Bei einem SENEC V3 und lokalem Datenabruf (also SENEC_ADAPTER=local) würde ich beide Variablen auf 5 (Sekunden) setzen.

Falls dir das nicht hilft, poste bitte mal sowohl .env als auch docker-compose.yml, der Fehler sollte sich darin leicht entdecken lassen.

igriepp commented 3 months ago

Hallo Georg,leider haben in der .env Datei die beiden Anpassungen keine Besserung mit sich gebracht. MfGIlja Griepp -------- Ursprüngliche Nachricht --------Von: Georg Ledermann @.> Datum: 09.05.24 17:17 (GMT+01:00) An: solectrus/hosting @.> Cc: igriepp @.>, Author @.> Betreff: Re: [solectrus/hosting] Status Fehler Senec v3 Speicher (Issue #45) Grundsätzlich ist es so, dass die Meldung "Keine Verbindung" erscheint, wenn der aktuelle Messwert in der InfluxDB älter als 2 * INFLUX_POLL_INTERVAL ist. Ich vermute, du hast nur die Variable INFLUX_POLL_INTERVAL verändert. Diese legt fest, in welchem Intervall vom Dashboard Werte aus der InfluxDB gelesen werden. Ein häufigeres Abfragen bringt aber nur etwas, wenn die Werte auch oft genug dort hineingeschrieben werden. Dies ist bei dir vermutlich nicht der Fall. Du solltest also die Variable SENEC_INTERVAL prüfen. Diese legt fest, in welchem Intervall der SENEC-Collector Werte vom SENEC-Speicher abruft und in die InfluxDB schreibt. Bei einem SENEC V3 und lokalem Datenabruf (also SENEC_ADAPTER=local) würde ich beide Variablen auf 5 (Sekunden) setzen. Falls dir das nicht hilft, poste bitte mal sowohl .env als auch docker-compose.yml, der Fehler sollte sich darin leicht entdecken lassen.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

ledermann commented 3 months ago

Möglicherweise fehlen in der docker-compose.yml Verweise auf die ENV-Variablen. Außerdem muss natürlich bei jeder Änderung an den ENV-Variablen ein Neustart der Container mit "docker compose -d" erfolgen.

Es wäre gut, wenn du beide Dateien hier mal posten könntest. Das geht übrigens nicht per E-Mail, sondern nur direkt auf GitHub.

igriepp commented 3 months ago

Hallo Georg,

leider bekomme ich den Inhalt der beiden Dateienn nicht kopiert.

In der docker-compoye.yml sind die beiden Variablen vorhanden.

Anbei ein kleines Video vom Problem

MfG

Ilja Griepp

Von: Georg Ledermann @.> Gesendet: Freitag, 10. Mai 2024 15:13 An: solectrus/hosting @.> Cc: igriepp @.>; Author @.> Betreff: Re: [solectrus/hosting] Status Fehler Senec v3 Speicher (Issue #45)

Möglicherweise fehlen in der docker-compose.yml Verweise auf die ENV-Variablen. Es wäre gut, wenn du beide Dateien hier mal posten könntest. Das geht übrigens nicht per E-Mail, sondern nur direkt auf GitHub.

— Reply to this email directly, view it on GitHub https://github.com/solectrus/hosting/issues/45#issuecomment-2104586636 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A55DYCH4OW4KGJDHCQD26ITZBTBT7AVCNFSM6AAAAABHO7NVDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBUGU4DMNRTGY . You are receiving this because you authored the thread. https://github.com/notifications/beacon/A55DYCHQW4JUJSMXF626AKLZBTBT7A5CNFSM6AAAAABHO7NVDGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT5OFYYY.gif Message ID: @. @.> >

ledermann commented 3 months ago

Der Inhalt der beiden Dateien sollte sich leicht über die Zwischenablage transportieren lassen. Mach mal cat .env und cat docker-compose.yml und kopiere das Ergebnis hier ein.

Ansonsten noch: Wenn du per E-Mail antwortest, werden Anhänge leider ignoriert. Somit sehe ich dein Video nicht. Bitte interagiere direkt auf GitHub, dann lassen sich auch Anhänge unterbringen.

igriepp commented 3 months ago
##################################################################
# Dashboard application (the main part)
#
# Domain name or IP address of your host
APP_HOST=192.168.178.35
#
# SSL redirect: Use "true" if you want to auto-redirect to https, but ensure that you have a valid SSL certificate
# and a reverse proxy in front of the app!
# In all other cases, the option must be "false"!
FORCE_SSL=false
#
# Secret token to secure cookies, 128 chars long hexadecimal encoded string (don't use this example, make some random changes!)
# Currently there are no cookies in Soletrus, but this may change in the future
SECRET_KEY_BASE=f60debe97dcb73280a2cc83668fd60e8d0e8e48269036a7bce980ee53cfb312e377989a750b8c945a5f69b041289ecb4e2d9e40641b81257c65ac2d43e3c837f
#
# Date of commissioning of your photovoltaic system
INSTALLATION_DATE=2022-01-27
#
# Password for the PostgreSQL database, used by the app to comunicate internally with the database
# Caution: Do not change this after the first run, otherwise the app will no longer be able to connect to the database!
POSTGRES_PASSWORD=my-secret-db-password
#
# Password to login as administrator, required to manage settings like historical prices
ADMIN_PASSWORD=2024!
#
# Optional: Allow iframe embedding
# FRAME_ANCESTORS=https://my-other-home-automation-software.com
#
# Start web server Puma in single mode (recommended to reduce memory usage)
WEB_CONCURRENCY=0
#

##################################################################
# Influx database settings
#
# Influx host (to access from SOLECTRUS dashboard and collectors)
INFLUX_HOST=influxdb
INFLUX_SCHEMA=http
INFLUX_PORT=8086
#
# Credentials for the Influx database, don't change after the first run!
INFLUX_ORG=solectrus
INFLUX_USERNAME=admin
INFLUX_PASSWORD=ExAmPl3PA55W0rD
INFLUX_ADMIN_TOKEN=my-super-secret-admin-token
#
# Set these names before first run, they can't be changed later!
INFLUX_BUCKET=solectrus
INFLUX_MEASUREMENT_PV=SENEC
INFLUX_MEASUREMENT_FORECAST=Forecast
#
# To keep things simple, we use ONE token (INFLUX_ADMIN_TOKEN) for both writing and reading.
# For better security, you can use two separate tokens, created via the InfluxDB frontend.
INFLUX_TOKEN_WRITE=my-super-secret-admin-token
INFLUX_TOKEN_READ=my-super-secret-admin-token
#
# Volume path for storing the Influx data
INFLUX_VOLUME_PATH=/volume1/docker/solectrus/influxdb
#
# Interval in seconds for polling the InfluxDB
INFLUX_POLL_INTERVAL=5

##################################################################
# REDIS settings
#
REDIS_VOLUME_PATH=/volume1/docker/solectrus/redis

##################################################################
# PostgreSQL database settings
#
DB_VOLUME_PATH=/volume1/docker/solectrus/postgresql

##################################################################
# SENEC Collector

### When you have a SENEC.Home V2 or V3

SENEC_ADAPTER=local

# Change the SENEC_HOST to the IP address of your SENEC system
SENEC_HOST=192.168.178.60

SENEC_SCHEMA=https
SENEC_INTERVAL=5
SENEC_LANGUAGE=de

### When you have a SENEC.Home 4

# SENEC_ADAPTER=cloud

# Credentials for mein-senec.de
# SENEC_USERNAME=me@example.com
# SENEC_PASSWORD=my-secret-password

# System ID of your SENEC system, not reqired if you have just one system
# SENEC_SYSTEM_ID=123456

# Interval in seconds for polling the SENEC cloud, minimum 30 seconds
# SENEC_INTERVAL=60

##################################################################
# Solar forecasting with https://forecast.solar
# API docs: https://doc.forecast.solar/doku.php?id=api:estimate
#
# Latitude of the plant location
FORECAST_LATITUDE=50.12345
#
# Longitude of the plant location
FORECAST_LONGITUDE=6.12345
#
# Plane declination: 0 (horizontal) - 90 (vertical)
FORECAST_DECLINATION=30
#
# Plane azimuth: -180 ... 180 (-180 = north, -90 = east, 0 = south, 90 = west, 180 = north)
FORECAST_AZIMUTH=20
#
# Installed modules power in kilowatt peak (kWp)
FORECAST_KWP=8.4
#
# Optional damping factors (http://doc.forecast.solar/damping)
# FORECAST_DAMPING_MORNING=0.5
# FORECAST_DAMPING_EVENING=0
#
# Optional configuration for multiple planes
#
# Number of planes
# FORECAST_CONFIGURATIONS=2
#
# Starting from 0, add params different from the values defined above
# FORECAST_0_AZIMUTH=90
# FORECAST_0_KWP=5.32
# FORECAST_1_AZIMUTH=-90
# FORECAST_1_KWP=7.84
#
# Available params are:
# - FORECAST_x_LATITUDE
# - FORECAST_x_LONGITUDE
# - FORECAST_x_DECLINATION
# - FORECAST_x_AZIMUTH
# - FORECAST_x_KWP
# - FORECAST_x_DAMPING_MORNING
# - FORECAST_x_DAMPING_EVENING
#
# Update interval in seconds, 900s = 15 minutes, the public (and free) API allows a minimum of 900 seconds
# BEWARE: Each plane counts as one request, so if you have multiple planes, you need to multiply the interval!
FORECAST_INTERVAL=900
#
# Optional API key for registered users of forecast.solar (https://doc.forecast.solar/account_models)
# FORECAST_SOLAR_APIKEY=abc123
igriepp commented 3 months ago
version: '3.7'

services:
  app:
    image: ghcr.io/solectrus/solectrus:latest
    labels:
      - 'com.centurylinklabs.watchtower.scope=solectrus'
    depends_on:
      db:
        condition: service_healthy
      influxdb:
        condition: service_healthy
      redis:
        condition: service_healthy
    links:
      - db
      - influxdb
      - redis
    ports:
      - 3000:3000
    environment:
      - APP_HOST
      - FORCE_SSL
      - SECRET_KEY_BASE
      - INSTALLATION_DATE
      - ADMIN_PASSWORD
      - FRAME_ANCESTORS
      - DB_HOST=db
      - DB_PASSWORD=${POSTGRES_PASSWORD}
      - DB_USER=postgres
      - REDIS_URL=redis://redis:6379/1
      - INFLUX_HOST
      - INFLUX_TOKEN=${INFLUX_TOKEN_READ}
      - INFLUX_ORG
      - INFLUX_BUCKET
      - INFLUX_MEASUREMENT_PV
      - INFLUX_MEASUREMENT_FORECAST
      - INFLUX_POLL_INTERVAL
      - WEB_CONCURRENCY
    healthcheck:
      test: ['CMD-SHELL', 'nc -z 127.0.0.1 3000 || exit 1']
    restart: always
    logging:
      options:
        max-size: '10m'
        max-file: '3'

  influxdb:
    image: influxdb:2.7-alpine
    labels:
      - 'com.centurylinklabs.watchtower.scope=solectrus'
    volumes:
      - ${INFLUX_VOLUME_PATH}:/var/lib/influxdb2
    environment:
     - DOCKER_INFLUXDB_INIT_MODE=setup
      - DOCKER_INFLUXDB_INIT_USERNAME=${INFLUX_USERNAME}
      - DOCKER_INFLUXDB_INIT_PASSWORD=${INFLUX_PASSWORD}
      - DOCKER_INFLUXDB_INIT_ORG=${INFLUX_ORG}
      - DOCKER_INFLUXDB_INIT_BUCKET=${INFLUX_BUCKET}
      - DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=${INFLUX_ADMIN_TOKEN}
    command: influxd run --bolt-path /var/lib/influxdb2/influxd.bolt --engine-path /var/lib/influxdb2/engine --store disk
    # Optional: Allow InfluxDB to be accessed from the outside.
    # ports:
    #   - 8086:8086
    restart: always
    healthcheck:
      test: ['CMD', 'influx', 'ping']
      interval: 1s
      timeout: 10s
      retries: 5
      start_period: 30s
    logging:
      options:
        max-size: '10m'
        max-file: '3'

  db:
    # Don't change major version if you have an existing database!
    # If you have started with an older major version (like 15), you need to migrate your database.
    # This is not worth the effort, so don't do it.
    image: postgres:16-alpine
    labels:
      - 'com.centurylinklabs.watchtower.scope=solectrus'
    environment:
      - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
    volumes:
      - ${DB_VOLUME_PATH}:/var/lib/postgresql/data
    restart: always
    healthcheck:
      test: ['CMD-SHELL', 'pg_isready -U postgres']
      interval: 10s
      timeout: 20s
      retries: 5
      start_period: 60s
    logging:
      options:
        max-size: '10m'
        max-file: '3'

  redis:
    image: redis:7-alpine
    labels:
      - 'com.centurylinklabs.watchtower.scope=solectrus'
    volumes:
      - ${REDIS_VOLUME_PATH}:/data
    restart: always
    healthcheck:
      test: ['CMD', 'redis-cli', 'ping']
      interval: 10s
      timeout: 20s
      retries: 5
      start_period: 60s
    logging:
      options:
        max-size: '10m'
        max-file: '3'

  senec-collector:
    image: ghcr.io/solectrus/senec-collector:latest
    labels:
      - 'com.centurylinklabs.watchtower.scope=solectrus'
    depends_on:
      influxdb:
        condition: service_healthy
    links:
      - influxdb
    environment:
      - SENEC_HOST
      - SENEC_SCHEMA
      - SENEC_INTERVAL
      - SENEC_LANGUAGE
      - INFLUX_HOST
      - INFLUX_SCHEMA
      - INFLUX_PORT
      - INFLUX_TOKEN=${INFLUX_TOKEN_WRITE}
      - INFLUX_ORG
      - INFLUX_BUCKET
      - INFLUX_MEASUREMENT=${INFLUX_MEASUREMENT_PV}
      - INFLUX_POLL_INTERVAL
    restart: always
    logging:
      options:
        max-size: '10m'
        max-file: '3'

  forecast-collector:
    image: ghcr.io/solectrus/forecast-collector:latest
    labels:
      - 'com.centurylinklabs.watchtower.scope=solectrus'
    depends_on:
      influxdb:
        condition: service_healthy
    links:
      - influxdb
    environment:
      - INFLUX_HOST
      - INFLUX_TOKEN=${INFLUX_TOKEN_WRITE}
      - INFLUX_ORG
      - INFLUX_BUCKET
      - INFLUX_MEASUREMENT=${INFLUX_MEASUREMENT_FORECAST}
      - FORECAST_LATITUDE
      - FORECAST_LONGITUDE
      - FORECAST_DECLINATION
      - FORECAST_AZIMUTH
      - FORECAST_KWP
      - FORECAST_CONFIGURATIONS
      - FORECAST_0_LATITUDE
      - FORECAST_0_LONGITUDE
      - FORECAST_0_DECLINATION
      - FORECAST_0_AZIMUTH
      - FORECAST_0_KWP
      - FORECAST_0_DAMPING_MORNING
      - FORECAST_0_DAMPING_EVENING
      - FORECAST_1_LATITUDE
      - FORECAST_1_LONGITUDE
      - FORECAST_1_DECLINATION
      - FORECAST_1_AZIMUTH
      - FORECAST_1_KWP
      - FORECAST_1_DAMPING_MORNING
      - FORECAST_1_DAMPING_EVENING
      - FORECAST_2_LATITUDE
      - FORECAST_2_LONGITUDE
      - FORECAST_2_DECLINATION
      - FORECAST_2_AZIMUTH
      - FORECAST_2_KWP
      - FORECAST_2_DAMPING_MORNING
      - FORECAST_2_DAMPING_EVENING
      - FORECAST_3_LATITUDE
      - FORECAST_3_LONGITUDE
      - FORECAST_3_DECLINATION
      - FORECAST_3_AZIMUTH
      - FORECAST_3_KWP
      - FORECAST_3_DAMPING_MORNING
      - FORECAST_3_DAMPING_EVENING
      - FORECAST_INTERVAL
      - FORECAST_SOLAR_APIKEY
    restart: always
    logging:
      options:
        max-size: '10m'
        max-file: '3'

  watchtower:
    image: containrrr/watchtower
    labels:
      - 'com.centurylinklabs.watchtower.scope=solectrus'
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: --scope solectrus --cleanup
    restart: always
    logging:
      options:
        max-size: '10m'
        max-file: '3'
igriepp commented 3 months ago

Hallo Georg,, hier habe ich das Video hinterlegt

https://github.com/solectrus/hosting/assets/125451272/25175c0d-9fb2-4f99-85ae-8defb7c3619a

ledermann commented 3 months ago

Scheint soweit korrekt zu sein, beide relevanten Variablen SENEC_INTERVAL und INFLUX_POLL_INTERVAL stehen auf 5. Bist du sicher, dass du nach einer Änderung an .env oder docker-compose.yml auch wirklich die Container neu erstellt hast, mit docker compose up -d? Ein Reboot reicht da nicht.

Mit folgendem Befehl kannst du prüfen, welche Variablen wirklich im SENEC-Collector aktiv sind:

docker compose exec senec-collector env

Findet sich da wirklich SENEC_INTERVAL=5?

Ansonsten noch eine Idee: Stelle mal INFLUX_POLL_INTERVAL auf 10, mache dann docker-compose up -d und prüfe die Auswirkungen. Die Aktualisierung im UI sollte dann nur alle 10 Sekunden stattfinden und es sollte niemals "Keine Verbindung" angezeigt werden (weil 10 > 5).

igriepp commented 3 months ago

Hallo Georg,

mir war leider nicht bewusst,das man bei jeder Änderung den Befehl „Docker compose up-d“ ausführen muss.

Ich hate den Befehl jetzt nochmal ausgeführt, und es hat jetzt funktioniert.

Sorry für die Umstände.

Vielen Dank und einen schönen Abend.

MFG

Ilja Griepp

Von: Georg Ledermann @.> Gesendet: Sonntag, 12. Mai 2024 21:54 An: solectrus/hosting @.> Cc: igriepp @.>; Author @.> Betreff: Re: [solectrus/hosting] Status Fehler Senec v3 Speicher (Issue #45)

Scheint soweit korrekt zu sein, beide relevanten Variablen SENEC_INTERVAL und INFLUX_POLL_INTERVAL stehen auf 5. Bist du sicher, dass du nach einer Änderung an .env oder docker-compose.yml auch wirklich die Container neu erstellt hast, mit docker compose up -d? Ein Reboot reicht da nicht.

Mit folgendem Befehl kannst du prüfen, welche Variablen wirklich im SENEC-Collector aktiv sind:

docker compose exec senec-collector env

Findet sich da wirklich SENEC_INTERVAL=5?

Ansonsten noch eine Idee: Stelle mal INFLUX_POLL_INTERVAL auf 10, mache dann docker-compose up -d und prüfe die Auswirkungen. Die Aktualisierung im UI sollte dann nur alle 10 Sekunden stattfinden und es sollte niemals "Keine Verbindung" angezeigt werden (weil 10 > 5).

— Reply to this email directly, view it on GitHub https://github.com/solectrus/hosting/issues/45#issuecomment-2106357397 , or unsubscribe https://github.com/notifications/unsubscribe-auth/A55DYCAWK2MMB67G4B4WMPDZB7CD7AVCNFSM6AAAAABHO7NVDGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBWGM2TOMZZG4 . You are receiving this because you authored the thread. https://github.com/notifications/beacon/A55DYCGMBNMN55FGJAXIJY3ZB7CD7A5CNFSM6AAAAABHO7NVDGWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT5RR3JK.gif Message ID: @. @.> >