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

keine Kommunikation #105

Closed Boemelmann closed 10 months ago

Boemelmann commented 10 months ago

Moin,

ich bekomme das Skript leider nicht zum Laufen. Ich verwende einen Raspberry zero, SHELLY 3EM und eine Ahoy DTU. Alle Lifedaten der DTU kann ich über den Browser sehen. Muss die Inverternummer nirgendwo eingegeben werden?

Hier ein Auszug aus der .ini

  GNU nano 7.2                                                                        HoymilesZeroExport_Config.ini
# --- define your DTU (only one) ---
USE_AHOY = true
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 = 192.168.178.113

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

[TASMOTA]
# --- defines for Tasmota Smartmeter Modul---
TASMOTA_IP = 192.168.10.90
# 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=stat>
# 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 =

[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 = 192.168.178.113

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

[TASMOTA]
# --- defines for Tasmota Smartmeter Modul---
TASMOTA_IP = 192.168.10.90
# 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=stat>
# 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 =

[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

[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# 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 cur>
# --- 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 = true
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 = 192.168.178.93
# 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 = admin
SHELLY_PASS_INTERMEDIATE = eigenesPass

[INTERMEDIATE_SHRDZM]
# --- defines for SHRDZM Smartmeter Modul ---
SHRDZM_IP_INTERMEDIATE = xxx.xxx.xxx.xxx
SHRDZM_USER_INTERMEDIATE =
SHRDZM_PASS_INTERMEDIATE =
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 = 20
# 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 = 20
# 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 = 100
# 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

# List of INVERTERS, based on COMMON/COUNT
[INVERTER_1]
# power rating of your inverter
HOY_MAX_WATT = 1500
# 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 inverte>
# 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

Auszug von dem Fehler.

Oct 12 20:55:20 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 12 20:55:20 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 12 20:55:20 raspberrypi systemd[1]: HoymilesZeroExport.service: Consumed 1.0                                                                                                                     00s CPU time.
Oct 12 20:55:20 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 5.
Oct 12 20:55:20 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 12 20:55:20 raspberrypi systemd[1]: HoymilesZeroExport.service: Consumed 1.0                                                                                                                     00s CPU time.
Oct 12 20:55:20 raspberrypi systemd[1]: HoymilesZeroExport.service: Start reques                                                                                                                     t repeated too quickly.
Oct 12 20:55:20 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 12 20:55:21 raspberrypi systemd[1]: Failed to start HoymilesZeroExport.servi                                                                                                                     ce - HoymilesZeroExport Service.
Oct 13 09:23:58 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:23:59 raspberrypi python3[1774]: Traceback (most recent call last):
Oct 13 09:23:59 raspberrypi python3[1774]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:23:59 raspberrypi python3[1774]:     from packaging import version
Oct 13 09:23:59 raspberrypi python3[1774]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:23:59 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:23:59 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:23:59 raspberrypi systemd[1]: HoymilesZeroExport.service: Consumed 1.0                                                                                                                     10s CPU time.
Oct 13 09:23:59 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 1.
Oct 13 09:23:59 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:23:59 raspberrypi systemd[1]: HoymilesZeroExport.service: Consumed 1.0                                                                                                                     10s CPU time.
Oct 13 09:23:59 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:24:00 raspberrypi python3[1777]: Traceback (most recent call last):
Oct 13 09:24:00 raspberrypi python3[1777]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:24:00 raspberrypi python3[1777]:     from packaging import version
Oct 13 09:24:00 raspberrypi python3[1777]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:24:00 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:24:00 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:24:00 raspberrypi systemd[1]: HoymilesZeroExport.service: Consumed 1.0                                                                                                                     18s CPU time.
Oct 13 09:24:00 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 2.
Oct 13 09:24:00 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:24:00 raspberrypi systemd[1]: HoymilesZeroExport.service: Consumed 1.0                                                                                                                     18s CPU time.
Oct 13 09:24:00 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:24:01 raspberrypi python3[1778]: Traceback (most recent call last):
Oct 13 09:24:01 raspberrypi python3[1778]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:24:01 raspberrypi python3[1778]:     from packaging import version
Oct 13 09:24:01 raspberrypi python3[1778]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:24:01 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:24:01 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:24:01 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 3.
Oct 13 09:24:01 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:24:02 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:24:02 raspberrypi python3[1779]: Traceback (most recent call last):
Oct 13 09:24:02 raspberrypi python3[1779]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:24:02 raspberrypi python3[1779]:     from packaging import version
Oct 13 09:24:02 raspberrypi python3[1779]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:24:03 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:24:03 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:24:03 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 4.
Oct 13 09:24:03 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:24:03 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:24:04 raspberrypi python3[1780]: Traceback (most recent call last):
Oct 13 09:24:04 raspberrypi python3[1780]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:24:04 raspberrypi python3[1780]:     from packaging import version
Oct 13 09:24:04 raspberrypi python3[1780]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:24:04 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:24:04 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:24:04 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 5.
Oct 13 09:24:04 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:24:04 raspberrypi systemd[1]: HoymilesZeroExport.service: Start reques                                                                                                                     t repeated too quickly.
Oct 13 09:24:04 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:24:04 raspberrypi systemd[1]: Failed to start HoymilesZeroExport.servi                                                                                                                     ce - HoymilesZeroExport Service.
Oct 13 09:25:49 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:50 raspberrypi python3[1798]: Traceback (most recent call last):
Oct 13 09:25:50 raspberrypi python3[1798]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:25:50 raspberrypi python3[1798]:     from packaging import version
Oct 13 09:25:50 raspberrypi python3[1798]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:25:50 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:25:50 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:25:50 raspberrypi systemd[1]: HoymilesZeroExport.service: Consumed 1.0                                                                                                                     02s CPU time.
Oct 13 09:25:51 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 1.
Oct 13 09:25:51 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:51 raspberrypi systemd[1]: HoymilesZeroExport.service: Consumed 1.0                                                                                                                     02s CPU time.
Oct 13 09:25:51 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:52 raspberrypi python3[1799]: Traceback (most recent call last):
Oct 13 09:25:52 raspberrypi python3[1799]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:25:52 raspberrypi python3[1799]:     from packaging import version
Oct 13 09:25:52 raspberrypi python3[1799]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:25:52 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:25:52 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:25:52 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 2.
Oct 13 09:25:52 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:52 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:53 raspberrypi python3[1800]: Traceback (most recent call last):
Oct 13 09:25:53 raspberrypi python3[1800]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:25:53 raspberrypi python3[1800]:     from packaging import version
Oct 13 09:25:53 raspberrypi python3[1800]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:25:53 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:25:53 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:25:53 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 3.
Oct 13 09:25:53 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:53 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:54 raspberrypi python3[1801]: Traceback (most recent call last):
Oct 13 09:25:54 raspberrypi python3[1801]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:25:54 raspberrypi python3[1801]:     from packaging import version
Oct 13 09:25:54 raspberrypi python3[1801]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:25:54 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:25:54 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:25:54 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 4.
Oct 13 09:25:55 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:55 raspberrypi systemd[1]: Started HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:55 raspberrypi python3[1802]: Traceback (most recent call last):
Oct 13 09:25:55 raspberrypi python3[1802]:   File "/home/admin/HoymilesZeroExpor                                                                                                                     t/HoymilesZeroExport.py", line 32, in <module>
Oct 13 09:25:55 raspberrypi python3[1802]:     from packaging import version
Oct 13 09:25:55 raspberrypi python3[1802]: ModuleNotFoundError: No module named                                                                                                                      'packaging'
Oct 13 09:25:56 raspberrypi systemd[1]: HoymilesZeroExport.service: Main process                                                                                                                      exited, code=exited, status=1/FAILURE
Oct 13 09:25:56 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:25:56 raspberrypi systemd[1]: HoymilesZeroExport.service: Scheduled re                                                                                                                     start job, restart counter is at 5.
Oct 13 09:25:56 raspberrypi systemd[1]: Stopped HoymilesZeroExport.service - Hoy                                                                                                                     milesZeroExport Service.
Oct 13 09:25:56 raspberrypi systemd[1]: HoymilesZeroExport.service: Start reques                                                                                                                     t repeated too quickly.
Oct 13 09:25:56 raspberrypi systemd[1]: HoymilesZeroExport.service: Failed with                                                                                                                      result 'exit-code'.
Oct 13 09:25:56 raspberrypi systemd[1]: Failed to start HoymilesZeroExport.servi                                                                                                                     ce - HoymilesZeroExport Service.

Über eine Hilfe, würde ich mich sehr freuen.

VG Sebastian

irrwitzer42 commented 10 months ago

Hi @Boemelmann ,

die relevanten Zeilen sind die hier:

Oct 13 09:23:59 raspberrypi python3[1774]: File "/home/admin/HoymilesZeroExpor t/HoymilesZeroExport.py", line 32, in
Oct 13 09:23:59 raspberrypi python3[1774]: from packaging import version
Oct 13 09:23:59 raspberrypi python3[1774]: ModuleNotFoundError: No module named 'packaging'

Installier mal das "packaging" modul nach:

sudo pip3 install packaging

Boemelmann commented 10 months ago

Hallo Boemelmann ,

die Zeilen sind die hier:

Oct 13 09:23:59 raspberrypi python3[1774]: File "/home/admin/HoymilesZeroExpor t/HoymilesZeroExport.py", line 32, in
Oct 13 09:23:59 raspberrypi python3[1774]: from packaging import version
Oct 13 09:23:59 raspberrypi python3[1774]: ModuleNotFoundError: No module named 'packaging'

Installier mal das "packaging" modul nach:

sudo pip3 install packaging

danke für die schnelle Antwort.

dann bekomme ich folgende Fehlermeldung.

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.

VG

reserve85 commented 10 months ago

versuche mal sudo pip3 install packaging --break-system-packages aus: https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3

nochwas Vorab: deine Config oben passt so nicht, da fehlen teilweise Zeilen. Du darfst nix aus der config löschen, nur die Einträge bearbeiten. Sonst hagelt es die nächsten Fehler.

irrwitzer42 commented 10 months ago

@Boemelmann , oder sudo apt install python3-packaging

Boemelmann commented 10 months ago

versuche mal sudo pip3 install packaging --break-system-packagesaus: https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3

Moin,

super es hat geklappt. 💯

Okt 13 11:37:30 raspberrypi python3[2476]: 2023-10-13 11:37:30 INFO Ahoy: Cu rrent Version: 0.7.36 Okt 13 11:37:30 raspberrypi python3[2476]: 2023-10-13 11:37:30 INFO Ahoy: In verter "yet unknown" reachable: True Okt 13 11:37:31 raspberrypi python3[2476]: 2023-10-13 11:37:31 INFO Ahoy: In verter "Balkonsolar" / serial number "116183121579" / temperature 21.6 degC Okt 13 11:37:31 raspberrypi python3[2476]: 2023-10-13 11:37:31 INFO Ahoy: In verter "Balkonsolar": Turn on Okt 13 11:37:41 raspberrypi python3[2476]: 2023-10-13 11:37:41 INFO setting new limit to 75 Watt Okt 13 11:37:41 raspberrypi python3[2476]: 2023-10-13 11:37:41 INFO Ahoy: In verter "Balkonsolar": setting new limit from 0 Watt to 75 Watt Okt 13 11:37:41 raspberrypi python3[2476]: 2023-10-13 11:37:41 INFO Ahoy: In verter "Balkonsolar": Limit acknowledged Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 WARNING Certific ate did not match expected hostname: 192.169.178.93. Certificate: {'subject': (( ('commonName', 'fbfanimation.com'),),), 'issuer': ((('countryName', 'GB'),), ((' stateOrProvinceName', 'Greater Manchester'),), (('localityName', 'Salford'),), ( ('organizationName', 'Sectigo Limited'),), (('commonName', 'Sectigo RSA Domain V alidation Secure Server CA'),)), 'version': 3, 'serialNumber': 'CE37276CC1AB86E1 5D58013D6082DA60', 'notBefore': 'Oct 17 00:00:00 2022 GMT', 'notAfter': 'Nov 17 23:59:59 2023 GMT', 'subjectAltName': (('DNS', 'fbfanimation.com'), ('DNS', 'www .fbfanimation.com')), 'OCSP': ('http://ocsp.sectigo.com',), 'caIssuers': ('http: //crt.sectigo.com/SectigoRSADomainValidationSecureServerCA.crt',)} Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 ERROR Exceptio n at GetHoymilesActualPower Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 ERROR HTTPSCon nectionPool(host='192.169.178.93', port=443): Max retries exceeded with url: /st atus (Caused by SSLError(CertificateError("hostname '192.169.178.93' doesn't mat ch either of 'fbfanimation.com', 'www.fbfanimation.com'"))) Okt 13 11:38:02 raspberrypi python3[2476]: 2023-10-13 11:38:02 INFO ---Start Zero Export--- Okt 13 11:38:03 raspberrypi python3[2476]: 2023-10-13 11:38:03 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:38:03 raspberrypi python3[2476]: 2023-10-13 11:38:03 INFO powermeter Shelly 3EM: 234 Watt Okt 13 11:38:03 raspberrypi python3[2476]: 2023-10-13 11:38:03 INFO setting new limit to 1500 Watt Okt 13 11:38:03 raspberrypi python3[2476]: 2023-10-13 11:38:03 INFO Ahoy: Inverter "Balkonsolar": setting new limit from 75 Watt to 1500 Watt Okt 13 11:38:04 raspberrypi python3[2476]: 2023-10-13 11:38:04 INFO Ahoy: Inverter "Balkonsolar": Limit acknowledged Okt 13 11:38:19 raspberrypi python3[2476]: 2023-10-13 11:38:19 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:38:19 raspberrypi python3[2476]: 2023-10-13 11:38:19 INFO powermeter Shelly 3EM: 102 Watt Okt 13 11:38:19 raspberrypi python3[2476]: 2023-10-13 11:38:19 INFO Inverterlimit already at 1500 Watt Okt 13 11:38:34 raspberrypi python3[2476]: 2023-10-13 11:38:34 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:38:34 raspberrypi python3[2476]: 2023-10-13 11:38:34 INFO powermeter Shelly 3EM: 104 Watt Okt 13 11:38:34 raspberrypi python3[2476]: 2023-10-13 11:38:34 INFO Inverterlimit already at 1500 Watt Okt 13 11:38:49 raspberrypi python3[2476]: 2023-10-13 11:38:49 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:38:49 raspberrypi python3[2476]: 2023-10-13 11:38:49 INFO powermeter Shelly 3EM: 110 Watt Okt 13 11:38:49 raspberrypi python3[2476]: 2023-10-13 11:38:49 INFO Inverterlimit already at 1500 Watt Okt 13 11:39:04 raspberrypi python3[2476]: 2023-10-13 11:39:04 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:39:05 raspberrypi python3[2476]: 2023-10-13 11:39:05 INFO powermeter Shelly 3EM: 116 Watt Okt 13 11:39:05 raspberrypi python3[2476]: 2023-10-13 11:39:05 INFO Inverterlimit already at 1500 Watt Okt 13 11:39:20 raspberrypi python3[2476]: 2023-10-13 11:39:20 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:39:20 raspberrypi python3[2476]: 2023-10-13 11:39:20 INFO powermeter Shelly 3EM: 136 Watt Okt 13 11:39:20 raspberrypi python3[2476]: 2023-10-13 11:39:20 INFO Inverterlimit already at 1500 Watt Okt 13 11:39:35 raspberrypi python3[2476]: 2023-10-13 11:39:35 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:39:35 raspberrypi python3[2476]: 2023-10-13 11:39:35 INFO powermeter Shelly 3EM: 133 Watt Okt 13 11:39:35 raspberrypi python3[2476]: 2023-10-13 11:39:35 INFO Inverterlimit already at 1500 Watt Okt 13 11:39:50 raspberrypi python3[2476]: 2023-10-13 11:39:50 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:39:50 raspberrypi python3[2476]: 2023-10-13 11:39:50 INFO powermeter Shelly 3EM: 140 Watt Okt 13 11:39:50 raspberrypi python3[2476]: 2023-10-13 11:39:50 INFO Inverterlimit already at 1500 Watt Okt 13 11:40:05 raspberrypi python3[2476]: 2023-10-13 11:40:05 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:40:06 raspberrypi python3[2476]: 2023-10-13 11:40:06 INFO powermeter Shelly 3EM: 141 Watt Okt 13 11:40:06 raspberrypi python3[2476]: 2023-10-13 11:40:06 INFO Inverterlimit already at 1500 Watt Okt 13 11:40:21 raspberrypi python3[2476]: 2023-10-13 11:40:21 INFO Ahoy: Inverter "Balkonsolar" reachable: True Okt 13 11:40:21 raspberrypi python3[2476]: 2023-10-13 11:40:21 INFO powermeter Shelly 3EM: 153 Watt Okt 13 11:40:21 raspberrypi python3[2476]: 2023-10-13 11:40:21 INFO Inverterlimit already at 1500 Watt

Eine Frage habe ich noch. Startet die Software morgends und nach dem reboot automatisch?

Danke für eure Hilfe.

VG

reserve85 commented 10 months ago

nene, das passt noch nicht, da kommt noch ein Zertifikatsfehler bei der Abfrage von Ahoy? Da bin ich allerdings total überfragt.

Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 WARNING Certificate did not match expected hostname: 192.169.178.93. Certificate: {'subject': (( ('commonName', 'fbfanimation.com'),),), 'issuer': ((('countryName', 'GB'),), ((' stateOrProvinceName', 'Greater Manchester'),), (('localityName', 'Salford'),), ( ('organizationName', 'Sectigo Limited'),), (('commonName', 'Sectigo RSA Domain V alidation Secure Server CA'),)), 'version': 3, 'serialNumber': 'CE37276CC1AB86E1 5D58013D6082DA60', 'notBefore': 'Oct 17 00:00:00 2022 GMT', 'notAfter': 'Nov 17 23:59:59 2023 GMT', 'subjectAltName': (('DNS', 'fbfanimation.com'), ('DNS', 'www .fbfanimation.com')), 'OCSP': ('http://ocsp.sectigo.com/',), 'caIssuers': ('http: //crt.sectigo.com/SectigoRSADomainValidationSecureServerCA.crt',)}
Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 ERROR Exception at GetHoymilesActualPower
Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 ERROR HTTPSConnectionPool(host='192.169.178.93', port=443): Max retries exceeded with url: /st atus (Caused by SSLError(CertificateError("hostname '192.169.178.93' doesn't mat ch either of 'fbfanimation.com', 'www.fbfanimation.com'")))

https://stackoverflow.com/questions/28768530/certificateerror-hostname-doesnt-match

Boemelmann commented 10 months ago

nene, die ganz, die nicht, da zu ein beamtenfehler bei der Abfrage von Ahoy? Da bin ich total überfragt.

Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 WARNING Certificate did not match expected hostname: 192.169.178.93. Certificate: {'subject': (( ('commonName', 'fbfanimation.com'),),), 'issuer': ((('countryName', 'GB'),), ((' stateOrProvinceName', 'Greater Manchester'),), (('localityName', 'Salford'),), ( ('organizationName', 'Sectigo Limited'),), (('commonName', 'Sectigo RSA Domain V alidation Secure Server CA'),)), 'version': 3, 'serialNumber': 'CE37276CC1AB86E1 5D58013D6082DA60', 'notBefore': 'Oct 17 00:00:00 2022 GMT', 'notAfter': 'Nov 17 23:59:59 2023 GMT', 'subjectAltName': (('DNS', 'fbfanimation.com'), ('DNS', 'www .fbfanimation.com')), 'OCSP': ('http://ocsp.sectigo.com/',), 'caIssuers': ('http: //crt.sectigo.com/SectigoRSADomainValidationSecureServerCA.crt',)}
Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 ERROR Exception at GetHoymilesActualPower
Okt 13 11:37:42 raspberrypi python3[2476]: 2023-10-13 11:37:42 ERROR HTTPSConnectionPool(host='192.169.178.93', port=443): Max retries exceeded with url: /st atus (Caused by SSLError(CertificateError("hostname '192.169.178.93' doesn't mat ch either of 'fbfanimation.com', 'www.fbfanimation.com'")))

https://stackoverflow.com/questions/28768530/certificateerror-hostname-doesnt-match

jetzt aber, war mein Fehler. Ich hatte in der .ini unter [SELECT_INTERMEDIATE_METER] auch die Anmeldedaten vom SHELLY_3EM hinterlegt. Gibt es noch die Möglichgeit, dass das Skript automatisch nach dem Neutstart startet?

Vielen Dank noch einmal!

reserve85 commented 10 months ago

Ja, du musst das Scipt als Service eintragen:

cat << EOF | tee /etc/systemd/system/HoymilesZeroExport.service
[Unit]
Description=HoymilesZeroExport Service
After=multi-user.target
[Service]
Type=simple
Restart=always
ExecStart=/usr/bin/python3 ${SCRIPT_DIR}/HoymilesZeroExport.py
[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable HoymilesZeroExport.service
systemctl start HoymilesZeroExport.service
systemctl status HoymilesZeroExport.service

${SCRIPT_DIR} musst du mit deinem Dir ersetzen.