reserve85 / HoymilesZeroExport

Zero Export Script for Hoymiles Inverters using AhoyDTU / OpenDTU and Tasmota Smart Meter inferface / Shelly 3EM / SHRDZM / Emlog / ioBroker
GNU General Public License v3.0
134 stars 31 forks source link

Fehler beim start #121

Closed Delta1987 closed 7 months ago

Delta1987 commented 7 months ago

grafik

Ich habe immer wieder das gleiche problem.

Vielleicht wiesst ihr da weiter

Hab euch mal meine Config mit geschickt

Gruß Dennis


# HoymilesZeroExport - https://github.com/reserve85/HoymilesZeroExport
# Copyright (C) 2023, Tobias Kraft

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# ---------------------------------------------------------------------
# --- DO NOT DELETE ANY ENTRIES HERE - else your script won´t start ---
# ---------------------------------------------------------------------

[VERSION]
VERSION = 1.64

[SELECT_DTU]
# --- define your DTU (only one) ---
USE_AHOY = false
USE_OPENDTU = false

[SELECT_POWERMETER]
# --- define your Powermeter (only one) ---
USE_TASMOTA = false
USE_SHELLY_EM = false
USE_SHELLY_3EM = true
USE_SHELLY_3EM_PRO = false
USE_SHRDZM = false
USE_EMLOG = false
USE_IOBROKER = false
USE_HOMEASSISTANT = false
USE_VZLOGGER = false

[AHOY_DTU]
# --- defines for AHOY-DTU ---
# in settings/inverter set interval to 6 seconds!
AHOY_IP = xxx.xxx.xxx.xxx

[OPEN_DTU]
# --- defines for OPEN-DTU ---
OPENDTU_IP = xxx.xxx.xxx.xxx
OPENDTU_USER = 
OPENDTU_PASS = 

[TASMOTA]
# --- defines for Tasmota Smartmeter Modul---
TASMOTA_IP = xxx.xxx.xxx.xxx
# the following three constants describes how to navigate through the Tasmota-JSON. 
# if you do not know the format of your Tasmota reader, open a browser and put in the following string replacing xxx with the IP address of your Tasmota device: http://xxx.xxx.xxx.xxx/cm?cmnd=status%2010
# e.g. JSON_Result = {"StatusSNS":{"Time":"2023-02-28T12:49:49","SML":{"total_kwh":15011.575,"curr_w":-71}}}
TASMOTA_JSON_STATUS = StatusSNS
# Prefix for Web UI and MQTT JSON payload
TASMOTA_JSON_PAYLOAD_MQTT_PREFIX = SML
# Power-MQTT label (the current power in Watt, positive (import more energy than export) or negative (export more energy than import)).
TASMOTA_JSON_POWER_MQTT_LABEL = curr_w
# if your powermeter does NOT output the current power: you need to calculate it -> Power(W) = OBIS(1.7.0) - OBIS(2.7.0)
TASMOTA_JSON_POWER_CALCULATE = FALSE
# Power-MQTT Input label (positive active instantaneous power, e.g. OBIS Code 1.7.0)
TASMOTA_JSON_POWER_INPUT_MQTT_LABEL =
# Power-MQTT output label (negative active instantaneous power, e.g. OBIS Code 2.7.0)
TASMOTA_JSON_POWER_OUTPUT_MQTT_LABEL =

[SHELLY]
# --- defines for Shelly ---
SHELLY_IP = 192.168.178.53
# if you restricted the web login enter your username and password, for Shelly "Generation 2" devices the username is always "admin" (e.g. Shelly pro 3EM)
SHELLY_USER =admin
SHELLY_PASS =admin

[SHRDZM]
# --- defines for SHRDZM Smartmeter Modul ---
SHRDZM_IP = xxx.xxx.xxx.xxx
SHRDZM_USER =
SHRDZM_PASS =

[EMLOG]
# --- defines for EMLOG (electronic meter log) System ---
EMLOG_IP = xxx.xxx.xxx.xxx
EMLOG_METERINDEX = 

[IOBROKER]
# --- defines for IOBROKER (make sure you installed https://github.com/ioBroker/ioBroker.simple-api) ---
IOBROKER_IP = xxx.xxx.xxx.xxx
IOBROKER_PORT = 8087
IOBROKER_CURRENT_POWER_ALIAS = alias.0.Zaehler.Zaehler_CurrentWatt
# if your powermeter does NOT output the current power: you need to calculate it -> Power(W) = OBIS(1.7.0) - OBIS(2.7.0)
IOBROKER_POWER_CALCULATE = FALSE
# Power-MQTT Input label (positive active instantaneous power, e.g. OBIS Code 1.7.0)
IOBROKER_POWER_INPUT_ALIAS = alias.0.Zaehler.Zaehler_CurrentInputWatt
# Power-MQTT output label (negative active instantaneous power, e.g. OBIS Code 2.7.0)
IOBROKER_POWER_OUTPUT_ALIAS = alias.0.Zaehler.Zaehler_CurrentOutputWatt

[HOMEASSISTANT]
# --- defines for HOME ASSISTANT ---
HA_IP = xxx.xxx.xxx.xxx
HA_PORT = 8123
# you need to create a Long-Lived Access Token in your Home Assistant: click on your profile, then scroll down to the bottom
HA_ACCESSTOKEN = xxx
HA_CURRENT_POWER_ENTITY = sensor.dtz541_sml_curr_w
# if your powermeter does NOT output the current power: you need to calculate it -> Power(W) = OBIS(1.7.0) - OBIS(2.7.0)
HA_POWER_CALCULATE = FALSE
# Power-MQTT Input label (positive active instantaneous power, e.g. OBIS Code 1.7.0)
HA_POWER_INPUT_ALIAS = sensor.dtz541_sml_170
# Power-MQTT output label (negative active instantaneous power, e.g. OBIS Code 2.7.0)
HA_POWER_OUTPUT_ALIAS = sensor.dtz541_sml_270

[VZLOGGER]
# --- defines for VZLOGGER (local http API https://wiki.volkszaehler.org/software/controller/vzlogger/vzlogger_conf_parameter#local) ---
VZL_IP = 127.0.0.1
VZL_PORT = 2081
# you need to specify the uuid of the vzlogger channel for the reading OBIS(16.7.0) (aktuelle Gesamtwirkleistung)
VZL_UUID = 30c6c501-9a3c-4b0f-bda5-1d1769904463

[SELECT_INTERMEDIATE_METER]
# if you have an intermediate meter ("Zwischenzähler") to measure the outputpower of your inverter you can set it here. It is faster than the DTU current_power value
# --- define your intermediate meter - if you don´t have one set the following defines to false to use the value from your DTU---
USE_TASMOTA_INTERMEDIATE = false
USE_SHELLY_EM_INTERMEDIATE = false
USE_SHELLY_3EM_INTERMEDIATE = false
USE_SHELLY_3EM_PRO_INTERMEDIATE = false
USE_SHELLY_1PM_INTERMEDIATE = false
USE_SHELLY_PLUS_1PM_INTERMEDIATE = false
USE_SHRDZM_INTERMEDIATE = false
USE_EMLOG_INTERMEDIATE = false
USE_IOBROKER_INTERMEDIATE = false
USE_HOMEASSISTANT_INTERMEDIATE = false
USE_VZLOGGER_INTERMEDIATE = false

[INTERMEDIATE_TASMOTA]
# --- defines for Tasmota Smartmeter Modul---
TASMOTA_IP_INTERMEDIATE = xxx.xxx.xxx.xxx 
# the following three constants describes how to navigate through the Tasmota-JSON
# e.g. JSON_Result = {"StatusSNS":{"Time":"2023-02-28T12:49:49","SML":{"curr_w":500}}}
TASMOTA_JSON_STATUS_INTERMEDIATE = StatusSNS
# Prefix for Web UI and MQTT JSON payload
TASMOTA_JSON_PAYLOAD_MQTT_PREFIX_INTERMEDIATE = SML
# Power-MQTT label (the current solar-power in Watt).
TASMOTA_JSON_POWER_MQTT_LABEL_INTERMEDIATE = curr_w

[INTERMEDIATE_SHELLY]
# --- defines for Shelly ---
SHELLY_IP_INTERMEDIATE = xxx.xxx.xxx.xxx
# if you restricted the web login enter your username and password, for Shelly "Generation 2" devices the username is always "admin" (e.g. Shelly pro 3EM)
SHELLY_USER_INTERMEDIATE =
SHELLY_PASS_INTERMEDIATE =

[INTERMEDIATE_SHRDZM]
# --- defines for SHRDZM Smartmeter Modul ---
SHRDZM_IP_INTERMEDIATE = xxx.xxx.xxx.xxx
SHRDZM_USER_INTERMEDIATE =
SHRDZM_PASS_INTERMEDIATE =

[INTERMEDIATE_EMLOG]
# --- defines for EMLOG (electronic meter log) System ---
EMLOG_IP_INTERMEDIATE = xxx.xxx.xxx.xxx
EMLOG_METERINDEX_INTERMEDIATE = 

[INTERMEDIATE_IOBROKER]
# --- defines for IOBROKER (needs installed https://github.com/ioBroker/ioBroker.simple-api) ---
IOBROKER_IP_INTERMEDIATE = xxx.xxx.xxx.xxx
IOBROKER_PORT_INTERMEDIATE = 8087
IOBROKER_CURRENT_POWER_ALIAS_INTERMEDIATE = alias.0.Zaehler.Zaehler_SolarCurrentWatt

[INTERMEDIATE_HOMEASSISTANT]
# --- defines for HOME ASSISTANT (you need to create a Long-Lived Access Token in your profile) ---
HA_IP_INTERMEDIATE = xxx.xxx.xxx.xxx
HA_PORT_INTERMEDIATE = 8123
HA_ACCESSTOKEN_INTERMEDIATE = xxx
HA_CURRENT_POWER_ENTITY_INTERMEDIATE = sensor.dtz541_sml_curr_w

[INTERMEDIATE_VZLOGGER]
# --- defines for VZLOGGER (local http API https://wiki.volkszaehler.org/software/controller/vzlogger/vzlogger_conf_parameter#local) ---
VZL_IP_INTERMEDIATE = 127.0.0.1
VZL_PORT_INTERMEDIATE = 2081
# you need to specify the uuid of the vzlogger channel for the reading OBIS(16.7.0) (aktuelle Gesamtwirkleistung)
VZL_UUID_INTERMEDIATE = 06ec9562-a490-49fe-92ea-ffe0758d181c

[COMMON]
# Number of Inverters
INVERTER_COUNT = 1
# max difference in percent between SetpointLimit change to approximate the power to new setpoint
SLOW_APPROX_LIMIT_IN_PERCENT = 5
# if slow approximation: additional limit based on the limit-difference to "smoot the curve": newLimitSetpoint = newLimitSetpoint + (LimitDifference * SLOW_APPROX_FACTOR_IN_PERCENT / 100)
SLOW_APPROX_FACTOR_IN_PERCENT = 5
# interval time for setting limit to Hoymiles
LOOP_INTERVAL_IN_SECONDS = 20
# delay time after sending limit to Hoymiles Inverter
SET_LIMIT_DELAY_IN_SECONDS = 5
# Timeout time to wait for Acknowledge after sending limit to Hoymiles Inverter
SET_LIMIT_TIMEOUT_SECONDS = 10
# delay time after sending limit to Hoymiles Inverter when using more than one Inverter
SET_LIMIT_DELAY_IN_SECONDS_MULTIPLE_INVERTER = 2
# polling interval for powermeter (must be < LOOP_INTERVAL_IN_SECONDS)
POLL_INTERVAL_IN_SECONDS = 1
# if your powermeter exceeds POWERMETER_MAX_POINT: immediatelly set the limit to predefined percent of HOY_MAX_WATT (if you have more than one inverter it´s the sum of all HOY_MAX_WATT)
# value = 0 disables the feature. Values are possible from [0 to 100]
ON_GRID_USAGE_JUMP_TO_LIMIT_PERCENT = 0
# max difference between Limit and real output power in % of HOY_MAX_WATT (100 = disabled)
MAX_DIFFERENCE_BETWEEN_LIMIT_AND_OUTPUTPOWER = 100
# enable logging to file
ENABLE_LOG_TO_FILE = false
# how many logfiles you wish to keep
LOG_BACKUP_COUNT = 30
# defines how often a identical limit will be set, set it to "-1" for disabled (infinite repeat)
SET_LIMIT_RETRY = 10
# log the inverter temperature
LOG_TEMPERATURE = false
# delay time after turning the inverter off or on
SET_POWER_STATUS_DELAY_IN_SECONDS = 10

[CONTROL]
# --- global defines for control behaviour ---
# POWERMETER_TARGET_POINT is the target power for powermeter in watts
POWERMETER_TARGET_POINT = -20
# POWERMETER_TOLERANCE is the tolerance (pos and neg) around the target point. in this range no adjustment will be set
POWERMETER_TOLERANCE = 25
# POWERMETER_MAX_POINT is the maximum power of your powermeter for the normal "regulation loop".
# if your powermeter jumps over this point, the limit will be increased instantly. it is like a "super high priority limit change".
# if you defined ON_GRID_USAGE_JUMP_TO_LIMIT_PERCENT > 0, then the limit will jump to the defined percent when reaching this point.
POWERMETER_MAX_POINT = 0

# List of INVERTERS, based on COMMON/COUNT
[INVERTER_1]
# power rating of your inverter
HOY_MAX_WATT = 600
# minimum limit in percent, e.g. 5%
HOY_MIN_WATT_IN_PERCENT = 5
# factor to multiply before set Limit. Some Inverters have some offsets, with that factor you can compensate it. Default = 1
HOY_COMPENSATE_WATT_FACTOR = 1
# battery powered?
HOY_BATTERY_MODE = false
# voltage to turn off the inverter
HOY_BATTERY_THRESHOLD_OFF_LIMIT_IN_V = 47
# voltage to limit the inverter to a maximum of HOY_BATTERY_REDUCE_WATT
HOY_BATTERY_THRESHOLD_REDUCE_LIMIT_IN_V = 48
# voltage to limit the inverter to a maximum of HOY_BATTERY_NORMAL_WATT
HOY_BATTERY_THRESHOLD_NORMAL_LIMIT_IN_V = 48.5
# maximum limit in watts when battery is high (above HOY_BATTERY_THRESHOLD_NORMAL_LIMIT_IN_V)
HOY_BATTERY_NORMAL_WATT = 1500
# maximum limit in watts when battery is low (below HOY_BATTERY_THRESHOLD_REDUCE_LIMIT_IN_V)
HOY_BATTERY_REDUCE_WATT = 300
# reenable inverter at this voltage
HOY_BATTERY_THRESHOLD_ON_LIMIT_IN_V = 51
# define which panels you want to ignore for the panel voltage. E.g. if you have input 1 + 2 battery powered and input 3 + 4 for solar panels you can disable panel 3 and 4.
# if you want to ignore Panel 3 and Panel 4 type: "HOY_BATTERY_IGNORE_PANELS = 3,4". leave it empty for no ignore.
HOY_BATTERY_IGNORE_PANELS = 
# define prioriry of the inverters (possible values: 1 (high) ... 5 (low); default = 1). same priorities are also possible. Not supported in mixed modes (a mix of solar and battery powered inverters)
# example 1 (default):
# inverter 1 = 1000W, priority = 1 // inverter 2 = 500W, priority = 1: 
# set limit of 1100W -> inverter 1 is set to 733W and inverter 2 is set to 367W
# set limit of 300W -> inverter 1 is set to 200W and inverter 2 is set to 100W
# example 2:
# inverter 1 = 1000W, priority = 1 // inverter 2 = 500W, priority = 2: 
# set limit of 1100W -> inverter 1 is set to 1000W and inverter 2 is set to 100W
# set limit of 300W -> inverter 1 is set to 300W and inverter 2 is powered off
HOY_BATTERY_PRIORITY = 1

# grid power
#    ...
#     |
#     | -------> if you defined ON_GRID_USAGE_JUMP_TO_LIMIT_PERCENT > 0, then the limit will jump to the defined percent of HOY_MAX_WATT when reaching this point. else: increasing limit <-------
#     |
#   [0W]      [POWERMETER_MAX_POINT]
#     |
#     | -------> increasing limit <-------
#     |
#  [-50W]     [POWERMETER_TARGET_POINT + POWERMETER_TOLERANCE]
#     |
#     | -------> no limit change between -100W ... -50W <-------
#     |
#  [-75W]     [POWERMETER_TARGET_POINT]
#     |
#     | -------> no limit change between -100W ... -50W <-------
#     |
#  [-100W]    [POWERMETER_TARGET_POINT - POWERMETER_TOLERANCE]
#     |
#     | -------> decreasing limit <-------
#     |
#    ...
reserve85 commented 7 months ago

Hi,

schau mal hier: https://github.com/reserve85/HoymilesZeroExport/issues/118

Delta1987 commented 7 months ago

Hab ich,. Habe das auch noch installiert und dennoch kommt diese Meldung

reserve85 commented 7 months ago

Mein Fehler:

pip3 install packaging

Delta1987 commented 7 months ago

dennis@pi:~ $ pip3 install packaging error: externally-managed-environment

× This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification.

das bekomme ich rasu wenn ich das eingebe

reserve85 commented 7 months ago

pip3 install packaging --break-system-packages

siehe auch https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3

Delta1987 commented 7 months ago

grafik also wenn ich das so eingebe, 4mal mein rasp passwort eingebe dann starte er es aber er überschreibt nicht die DTU

reserve85 commented 7 months ago

dann bist du ja schon mal einen schritt weiter. Das mit den ganzen Passworteingaben und installieren der Packages liegt an deinem System, das kenne ich so nicht.

mit sudo journalctl -u HoymilesZeroExport.service -n 20000 -e -f kannst du dir das Log anschauen, vermutlich gibt es noch ein Problem in der config irgendwo. Wenn ich die auf die schnelle anschaue hast du gar keine DTU definiert.

Delta1987 commented 7 months ago

Log Datei.txt

hab die jetzt mal rauskopiert, da steht was von zeile 32, hab nachgeschaut das ist die info wegen Shelly3

Delta1987 commented 7 months ago

Ich kann auch gerne das ganze teil neu aufsetzten habe damit kein problem, hab das zwar schon mindestens 10mal gemacht und immer hänge ich an der gleichen stelle

reserve85 commented 7 months ago

Sorry aber das liegt an deiner Python Installation, dir fehlt definitiv das Package „packaging“. Das musst du installieren.

irrwitzer42 commented 7 months ago

Hey @Delta1987 , Du schreibst, Du hast es schon 10mal neu aufgesetzt - meint das den Checkout vom ZeroExport Skript, oder meinst Du damit, dass Du den ganzen Rechner, auf dem das Skript läuft?

Du könntest es Dir deutlich einfacher machen und die Docker-Lösung einsetzen, dann musst Du Dich nicht mit Python und den Abhängigkeiten rumärgern, weil die alle im Container enthalten sind.

sudo apt-install docker.io docker-compose # sofern Du ein debian basiertes System verwendest
cat > docker-compose.yml <<EOF
version: '3.3'
services:
  hoymileszeroexport:
    image: ghcr.io/reserve85/hoymileszeroexport:main
    volumes:
      - ./HoymilesZeroExport_Config_Override.ini:/app/config.ini
    command: -c /app/config.ini
EOF
# in der Annahme, Du hast schon eine HoymilesZeroExport_Config_Override.ini angelegt:
docker-compose up -d && docker-compose logs -f

in der Theorie sollte das das Programm dann laufen. Die Ausgabe des Logfiles kannst Du dann mit STRG+C Stoppen, der Container und das Programm laufen weiter.

Delta1987 commented 7 months ago

also egal was ich mache ich bekomme es nicht zum laufen.

Ich habe eine Rasp 3 zur verfügung, Open DTU und Shelly 3EM

Den Rasp installiere ich mit dem Rasp Installer, richte dort schon gleich den SSH und das wlan ein.

Versucht habe ich jetzt mehrfach den Zeroexport und mehrfach die Nulleinspeisung von selbstbau PV, beide laufen nicht.

Die Anleitung ist ja hier super aber sie funktioniert halt bei mir leider nicht.

@reserve85 okay und wie installiere ich nur das nach?

Delta1987 commented 7 months ago

Also ich setzte den Rasp neu auf. grafik das ist die software die ich immer wähle, stimmt die soweit?

irrwitzer42 commented 7 months ago

Nimm lieber die hier:

Moderne 64bit und Du brauchst auf dem Ding definitiv kein Desktop-Environment.

Delta1987 commented 7 months ago

@irrwitzer42, okay die hab ich jetzt drauf

Delta1987 commented 7 months ago

Hab es zum laufen gebracht, jetzt setzt er den WR immer auf 25W, aber ich bin schonmal weiter^^

grafik diese meldung kommt jetzt immer

Delta1987 commented 7 months ago

script.txt

Wo hab ich den fehler? er sagt mir dass er den WR auf 30W regelt und dann kommt der error von oben

bekommt er keine daten vom Shelly?

reserve85 commented 7 months ago

ja, bekommt keine Daten vom Shelly. Die 30W schreibt er beim start vom Script, bekommt aber dann kein Wert von deinem Energiezähler. Zeig mal deine komplette config.

gerade gesehen du hast die ja oben gepostet.

[SHELLY]
# --- defines for Shelly ---
SHELLY_IP = 192.168.178.53
# if you restricted the web login enter your username and password, for Shelly "Generation 2" devices the username is always "admin" (e.g. Shelly pro 3EM)
SHELLY_USER =
SHELLY_PASS =

so sollte es klappen wenn du den 3EM hast und kein passwort im Shelly eingestellt hast.

Delta1987 commented 7 months ago

es läuft, ich hatte im shelly die anmeldung beschrängt, wieso auch immer.....

jetzt musst ich nur noch die feineinstellung der config machen.

danke vielmals für eure hilfe.