solectrus / senec-collector

Collect SENEC battery data and push it to InfluxDB. Ready to deploy to a Raspberry Pi.
MIT License
10 stars 3 forks source link

Inkompatibilität mit Firmware 8828/0828 #414

Closed dellwo17 closed 3 months ago

dellwo17 commented 3 months ago

Description (in German or English)

Updating to 15-version and the erro occurs. Trying with a complete new installation, but the same.

What version of SOLECTRUS are you using?

v0.15.0

What machine are you running SOLECTRUS on?

rasperry pi

If applicable (e.g. in case of error 500), please provide logs

senec-collector-1  | Getting state names (language: de) from SENEC by parsing source code...
senec-collector-1  | Error getting data from SENEC at https://192.168.178.55: undefined method `[]' for nil

Please provide your docker-compose.yml or compose.yml file

services:
  dashboard:
    image: ghcr.io/solectrus/solectrus:latest
    depends_on:
      postgresql:
        condition: service_healthy
      influxdb:
        condition: service_healthy
      redis:
        condition: service_healthy
    links:
      - postgresql
      - influxdb
      - redis
    ports:
      - 3000:3000
    environment:
      - TZ
      - APP_HOST
      - FORCE_SSL
      - SECRET_KEY_BASE
      - WEB_CONCURRENCY
      - INSTALLATION_DATE
      - ADMIN_PASSWORD
      - FRAME_ANCESTORS
      - DB_HOST=postgresql
      - 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_POLL_INTERVAL
      - INFLUX_SENSOR_INVERTER_POWER
      - INFLUX_SENSOR_HOUSE_POWER
      - INFLUX_SENSOR_GRID_IMPORT_POWER
      - INFLUX_SENSOR_GRID_EXPORT_POWER
      - INFLUX_SENSOR_BATTERY_CHARGING_POWER
      - INFLUX_SENSOR_BATTERY_DISCHARGING_POWER
      - INFLUX_SENSOR_BATTERY_SOC
      - INFLUX_SENSOR_WALLBOX_POWER
      - INFLUX_SENSOR_CASE_TEMP
      - INFLUX_SENSOR_INVERTER_POWER_FORECAST
      - INFLUX_SENSOR_SYSTEM_STATUS
      - INFLUX_SENSOR_SYSTEM_STATUS_OK
      - INFLUX_SENSOR_GRID_EXPORT_LIMIT
      - INFLUX_SENSOR_HEATPUMP_POWER
      - INFLUX_EXCLUDE_FROM_HOUSE_POWER
    healthcheck:
      test:
        - CMD-SHELL
        - nc -z 127.0.0.1 3000 || exit 1
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 10s
    restart: unless-stopped
    logging:
      options:
        max-size: 10m
        max-file: '3'
    labels:
      - com.centurylinklabs.watchtower.scope=solectrus
  influxdb:
    image: influxdb:2.7-alpine
    volumes:
      - ${INFLUX_VOLUME_PATH}:/var/lib/influxdb2
    environment:
      - TZ
      - 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
    restart: unless-stopped
    healthcheck:
      test:
        - CMD
        - influx
        - ping
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 30s
    logging:
      options:
        max-size: 10m
        max-file: '3'
    labels:
      - com.centurylinklabs.watchtower.scope=solectrus
  postgresql:
    image: postgres:16-alpine
    environment:
      - TZ
      - POSTGRES_PASSWORD
    volumes:
      - ${DB_VOLUME_PATH}:/var/lib/postgresql/data
    restart: unless-stopped
    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'
    labels:
      - com.centurylinklabs.watchtower.scope=solectrus
  redis:
    image: redis:7-alpine
    environment:
      - TZ
    volumes:
      - ${REDIS_VOLUME_PATH}:/data
    restart: unless-stopped
    healthcheck:
      test:
        - CMD
        - redis-cli
        - ping
      interval: 10s
      timeout: 20s
      retries: 5
      start_period: 60s
    logging:
      options:
        max-size: 10m
        max-file: '3'
    labels:
      - com.centurylinklabs.watchtower.scope=solectrus
  senec-collector:
    image: ghcr.io/solectrus/senec-collector:latest
    environment:
      - TZ
      - SENEC_ADAPTER
      - SENEC_HOST
      - SENEC_SCHEMA
      - SENEC_INTERVAL
      - SENEC_LANGUAGE
      - SENEC_USERNAME
      - SENEC_PASSWORD
      - INFLUX_HOST
      - INFLUX_SCHEMA
      - INFLUX_PORT
      - INFLUX_TOKEN=${INFLUX_TOKEN_WRITE}
      - INFLUX_ORG
      - INFLUX_BUCKET
      - INFLUX_MEASUREMENT=${SENEC_INFLUX_MEASUREMENT}
    restart: unless-stopped
    logging:
      options:
        max-size: 10m
        max-file: '3'
    depends_on:
      influxdb:
        condition: service_healthy
    links:
      - influxdb
    labels:
      - com.centurylinklabs.watchtower.scope=solectrus
  watchtower:
    image: containrrr/watchtower
    environment:
      - TZ
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    command: --scope solectrus --cleanup
    restart: unless-stopped
    logging:
      options:
        max-size: 10m
        max-file: '3'
    labels:
      - com.centurylinklabs.watchtower.scope=solectrus

Please provide your .env file

##################################################################
###                          Generic                           ###
##################################################################

TZ=Europe/Berlin

##################################################################
###                   Dashboard application                    ###
##################################################################

# Domain name or IP address of your host
APP_HOST=falke

# Date of commissioning of your photovoltaic system
INSTALLATION_DATE=2023-xx-xx

# Password to login as administrator, required to manage settings like historical prices
ADMIN_PASSWORD=**************

# Interval in seconds for polling the InfluxDB
INFLUX_POLL_INTERVAL=5

# 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
SECRET_KEY_BASE=***************************************************************

# Start web server Puma in single mode (recommended to reduce memory usage)
WEB_CONCURRENCY=0

# Optional: Allow iframe embedding
# FRAME_ANCESTORS=https://my-other-home-automation-software.com

# Password for the PostgreSQL database, used by the app to communicate 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=****************

##################################################################
###                      Sensor mapping                        ###
##################################################################

# Where to find the data in the InfluxDB
# Each sensor must be mapped to a measurement and a field
# The format is: INFLUX_SENSOR_NAME=MEASUREMENT:FIELD
# Example: INFLUX_SENSOR_INVERTER_POWER=my_pv:inverter_power

INFLUX_SENSOR_INVERTER_POWER=SENEC:inverter_power
INFLUX_SENSOR_HOUSE_POWER=SENEC:house_power
INFLUX_SENSOR_GRID_IMPORT_POWER=SENEC:grid_power_plus
INFLUX_SENSOR_GRID_EXPORT_POWER=SENEC:grid_power_minus
INFLUX_SENSOR_BATTERY_CHARGING_POWER=SENEC:bat_power_plus
INFLUX_SENSOR_BATTERY_DISCHARGING_POWER=SENEC:bat_power_minus
INFLUX_SENSOR_BATTERY_SOC=SENEC:bat_fuel_charge
# INFLUX_SENSOR_WALLBOX_POWER=
INFLUX_SENSOR_CASE_TEMP=SENEC:case_temp
INFLUX_SENSOR_SYSTEM_STATUS=SENEC:current_state
INFLUX_SENSOR_SYSTEM_STATUS_OK=SENEC:current_state_ok
INFLUX_SENSOR_GRID_EXPORT_LIMIT=SENEC:power_ratio
# INFLUX_SENSOR_INVERTER_POWER_FORECAST=
# INFLUX_SENSOR_HEATPUMP_POWER=

# Optional: Exclude sensors from house power calculation
# Default is HEATPUMP_POWER (if defined)
# INFLUX_EXCLUDE_FROM_HOUSE_POWER=HEATPUMP_POWER,WALLBOX_POWER

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

# The adapter to use
# Values: local, cloud
SENEC_ADAPTER=local

# The IP address or hostname of your SENEC device
# Available only when using the local adapter
SENEC_HOST=192.168.178.55

# The schema protocol to use
# Available only when using the local adapter
# Values: http, https
SENEC_SCHEMA=https

# The language to use for status strings
# Available only when using the local adapter
# Values: de, en, it
SENEC_LANGUAGE=de

# The credentials for mein-senec.de
# Available only when using the cloud adapter
# SENEC_USERNAME=me@example.com
# SENEC_PASSWORD=my-senec-password

# The system ID of your SENEC device
# Available only when using the cloud adapter
# Can be empty if there is just one system
# SENEC_SYSTEM_ID=123456

# The interval in seconds for polling
# Minimum for local adapter is 5 seconds
# Minimum for cloud adapter is 30 seconds
SENEC_INTERVAL=5

# Measurement name for InfluxDB
SENEC_INFLUX_MEASUREMENT=SENEC

# Optional: Disable specific fields you do not want to send to InfluxDB.
# This can be useful if you are tracking them from another source.
# Comma separated list of fields, no whitespace. Example:
# SENEC_IGNORE=wallbox_charge_power,grid_power_minus

##################################################################
###                 InfluxDB time series database              ###
##################################################################

# InfluxDB host
INFLUX_HOST=influxdb

# InfluxDB schema (http or https)
INFLUX_SCHEMA=http

# InfluxDB port
INFLUX_PORT=8086

# Credentials for the InfluxDB, don't change after the first run!
INFLUX_ORG=solectrus
INFLUX_USERNAME=admin
INFLUX_PASSWORD=*****
INFLUX_ADMIN_TOKEN=*******

# Set these names before first run, they can't be changed later!
INFLUX_BUCKET=solectrus

# 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 InfluxDB data
INFLUX_VOLUME_PATH=./influxdb

##################################################################
###                    PostgreSQL database                     ###
##################################################################

# Volume path for storing the PostgreSQL data
DB_VOLUME_PATH=./postgresql

##################################################################
###                 Redis in-memory database                   ###
##################################################################

# Volume path for storing the database snapshot
REDIS_VOLUME_PATH=./redis

Anything else?

LFP-Tausch kurz vorher, danach lief es aber noch.

ledermann commented 3 months ago

Danke für den Hinweis. Du hast genau den passenden Ausschnitt aus den Logs gepostet:

senec-collector-1  | Getting state names (language: de) from SENEC by parsing source code...
senec-collector-1  | Error getting data from SENEC at https://192.168.178.55: undefined method `[]' for nil

Ursache ist also das Auslesen der Status-Codes. Ich habe da kürzlich einen Hinweis bekommen, dass SENEC nach dem LFP-Tausch etwas (in der Firmware) geändert hat.

Ich habe bereits einen Fix vornehmen können, der aber noch nicht vollständig getestet ist. Aber ich gehe davon aus, dass er bei dir helfen wird. Wechsele dazu bitte in der docker-compose.yml den SENEC-Collector von latest auf develop. Danach docker compose pull && docker compose up -d ausführen.

Bitte gib mir Bescheid, ob das hilft.

dellwo17 commented 3 months ago

Danke für die flotte Reaktion, das scheint zu klappen:

senec-collector-1 | Got record solectrus/solectrus#14 at 2024-08-06 17:05:31 +0200 within 13 ms, AKKU VOLL, Inverter 5133 W, House 505 W, Wallbox 0 W senec-collector-1 | Successfully pushed record solectrus/solectrus#14 to InfluxDB

Am Di., 6. Aug. 2024 um 16:57 Uhr schrieb Georg Ledermann < @.***>:

Danke für den Hinweis. Du hast genau den passenden Ausschnitt aus den Logs gepostet:

senec-collector-1 | Getting state names (language: de) from SENEC by parsing source code... senec-collector-1 | Error getting data from SENEC at https://192.168.178.55: undefined method `[]' for nil

Ursache ist also das Auslesen der Status-Codes. Ich habe da kürzlich einen Hinweis bekommen, dass SENEC nach dem LFP-Tausch etwas (per Firmware) geändert hat.

Ich habe bereits einen Fix vornehmen können, der aber noch nicht vollständig getestet ist. Aber ich gehe davon aus, dass er bei dir helfen wird. Wechsele dazu bitte in der docker-compose.yml den SENEC-Collecetor von latest auf develop. Danach docker compose pull && docker compose up -d .

Bitte gib mir Bescheid, ob das hilft.

— Reply to this email directly, view it on GitHub https://github.com/solectrus/senec-collector/issues/414, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHB37VJOWZVQDSLUVDP626LZQDP6FAVCNFSM6AAAAABMCQMG4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZRGUYDCNJXHA . You are receiving this because you authored the thread.Message ID: @.***>

ledermann commented 3 months ago

Sehr gut, danke für die Bestätigung. Ich werde in Kürze ein Update für den SENEC-Collector veröffentlichen, dann kannst du wieder auf latest wechseln.

ledermann commented 3 months ago

Update des SENEC-Collectors ist da: https://solectrus.de/blog/2024-08-06-update-fur-senec-firmware-0828/

@dellwo17 Du kannst also wieder auf latest wechseln.