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
144 stars 33 forks source link

5% #176

Closed Boemelmann closed 7 months ago

Boemelmann commented 7 months ago

Moin,

nach Start des Scripts, wird der Wechselrichter immer auf 5% gedrosselt. Anbei meine ini.

"[VERSION] VERSION = 1.89

[SELECT_DTU]

--- 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 USE_SCRIPT = false

[AHOY_DTU]

--- defines for AHOY-DTU ---

in settings/inverter set interval to 6 seconds!

AHOY_IP = 192.168.178.113 AHOY_PASS = 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.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 = SHELLY_PASS =

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

if your powermeter does NOT output the current power: you need to calculate it -> Power(W) = OBIS(1.7.0) - OBIS(2.7.0)

EMLOG_JSON_POWER_CALCULATE = TRUE

[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

[SCRIPT]

--- defines for Shell Script Smartmeter Modul ---

SCRIPT_IP = xxx.xxx.xxx.xx SCRIPT_FILE = GetPowerFromVictronMultiplus.sh SCRIPT_USER = SCRIPT_PASS =

[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_ESPHOME_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_ESPHOME] ESPHOME_IP_INTERMEDIATE = xxx.xxx.xxx.xxx ESPHOME_PORT_INTERMEDIATE = 80 ESPHOME_DOMAIN_INTERMEDIATE = ESPHOME_ID_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

Uncomment the following section if you want to use MQTT to dynamically reconfigure some settings while the script is running

[MQTT_CONFIG]

MQTT_BROKER = localhost

MQTT_PORT = 1883

MQTT_CLIENT_ID = HoymilesZeroExport

The script subscribes to the following topics:

- zeropower/set/powermeter_target_point: To change the target point of the powermeter

- zeropower/set/powermeter_max_point: To change the max point of the powermeter

- zeropower/set/powermeter_tolerance: To change the tolerance of the powermeter

- zeropower/set/on_grid_usage_jump_to_limit_percent: To change the on grid usage jump to limit percent

- zeropower/set/inverter/0/min_watt_in_percent: To change the min watt in percent of the first inverter

- zeropower/set/inverter/0/normal_watt: To change the battery normal watt of the first inverter

- zeropower/set/inverter/0/reduce_watt: To change the battery reduce watt of the first inverter

- zeropower/set/inverter/0/battery_priority: To change the battery priority of the first inverter

MQTT_SET_TOPIC = zeropower/set

MQTT_RESET_TOPIC = zeropower/reset

[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

Timeout time to wait for Acknowledge after sending limit to Hoymiles Inverter

SET_LIMIT_TIMEOUT_SECONDS = 10

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 the Inverter Power Status will be set, set it to "-1" for disabled (infinite repeat)

SET_POWERSTATUS_CNT = 10

log the inverter temperature

LOG_TEMPERATURE = false

delay time after turning the inverter off or on

SET_POWER_STATUS_DELAY_IN_SECONDS = 10

define if you want to set your inverter to min-limit when your powermeter can't be read out

SET_INVERTER_TO_MIN_ON_POWERMETER_ERROR = false

Total number of retries to allow.

MAX_RETRIES = 3

A set of integer HTTP status codes that we should force a retry on. Don´t change unless you know what you are doing

RETRY_STATUS_CODES = 500,502,503,504

It allows you to change how long the process will sleep between failed requests. The algorithm is as follows: {backoff factor} * (2 ** ({number of total retries} - 1))

RETRY_BACKOFF_FACTOR = 0.1

[CONTROL]

--- global defines for control behaviour ---

POWERMETER_TARGET_POINT is the target power for powermeter in watts

POWERMETER_TARGET_POINT = -75

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]

serial number of your inverter, if empty it is automatically read out of the API. If you have more than one inverter you should define the serial number here (prevents mix-up).

SERIAL_NUMBER =

manufacturer power rating of your inverter.

HOY_INVERTER_WATT =

max. power output of your inverter (e.g. if you have a 1500W Inverter and you only want to output max. 1000W)

HOY_MAX_WATT = 1500

minimum limit in percent, e.g. 5% of your inverter power rating

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

Number of measured values for the moving average of the min panel voltage

HOY_BATTERY_AVERAGE_CNT = 1"

Über eine Hilfe, wäre ich sehr dankbar.

VG