Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Hoymiles Zero Export script

  • 02-09-2024 8:39pm
    #1
    Registered Users, Registered Users 2 Posts: 7,563 ✭✭✭


    A bit niche, but this might be in someone's interest.

    A gent called Tobias Kraft released a script which can be used to manage a zero-export configuration on a microinverter solar solution. It's mainly aimed at the balcony solar market where the amount of energy generated is not enough to want to move to a feed-in tariff plan. The objective of the script is to manage the output of the inverters to closely match or follow the local power demand so that the system has very limited export to the grid. It does this by turning up or down the level of power generated from each inverter using a script which writes to each inverter through OpenDTU.

    It's easy enough to deploy in a docker environment, but the initial config is quite involved and you need to have a compatible power meter (such as a Shelly EM) on the network.

    https://github.com/reserve85/HoymilesZeroExport

    root@gp-docker:/opt/HoymilesZeroExport# git clone https://github.com/reserve85/HoymilesZeroExport
    

    Before running in docker, I gave it the required HoymilesZeroExport_Config_Override.ini file with the following params:

    [COMMON]
    # Number of Inverters
    INVERTER_COUNT = 3
    # 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 = 10
    # 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
    # if your powermeter falls below POWERMETER_MIN_POINT: immediatelly decrease the limit
    ON_GRID_FEED_FAST_LIMIT_DECREASE = false
    # max difference between Limit and real output power in % of HOY_MAX_WATT (100 = disabled)
    # which limits the limit from increasing even if no more can be produced (not enough sun). Otherwise the limit will constantly run towards 1500W, but the inverter will hover around 300W.
    MAX_DIFFERENCE_BETWEEN_LIMIT_AND_OUTPUTPOWER = 10
    # enable logging to file
    ENABLE_LOG_TO_FILE = true
    # 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 = true
    # Total number of retries to allow.
    MAX_RETRIES = 10
    # 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 = -30
    # 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
    # POWERMETER_MIN_POINT is the minimum power of your powermeter for the normal "regulation loop".
    # if your powermeter jumps under this point, the limit will be reduced instantly. it is like a "super high priority limit change".
    POWERMETER_MIN_POINT = -500
    
    # List of INVERTERS, based on COMMON/COUNT
    [INVERTER_1]
    # Name: hm350-office
    # 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 = 112183214420
    # enable (true) / disable (false) this inverter
    ENABLED = true
    # manufacturer power rating of your inverter.
    HOY_INVERTER_WATT = 350
    # 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 = 350
    # minimum limit in percent, e.g. 5% of your inverter power rating
    HOY_MIN_WATT_IN_PERCENT = 15
    
    

    Then watch the output by looking as the log output using docker:

    root@gp-docker:/opt/HoymilesZeroExport# docker container ls
    CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
    dee62f17ffe9 ghcr.io/reserve85/hoymileszeroexport:main "/venv/bin/python3 H…" 8 hours ago Up 8 hours hoymileszeroexport
    root@gp-docker:/opt/HoymilesZeroExport# docker logs -f dee62f17ffe9 2024-09-02 18:59:48 INFO powermeter ShellyEM: 969 Watt
    2024-09-02 18:59:48 INFO Inverterlimit was already accepted at 1850 Watt
    2024-09-02 18:59:58 INFO OpenDTU: Inverter "hm350-office" reachable: True
    2024-09-02 18:59:59 INFO OpenDTU: Inverter "hm800-office" reachable: True
    2024-09-02 18:59:59 INFO OpenDTU: Inverter "hm700-shed" reachable: True
    2024-09-02 18:59:59 INFO powermeter ShellyEM: 1001 Watt
    2024-09-02 18:59:59 INFO Inverterlimit was already accepted at 1850 Watt
    2024-09-02 19:00:09 INFO OpenDTU: Inverter "hm350-office" reachable: True
    2024-09-02 19:00:09 INFO OpenDTU: Inverter "hm800-office" reachable: True
    2024-09-02 19:00:09 INFO OpenDTU: Inverter "hm700-shed" reachable: True
    2024-09-02 19:00:09 INFO powermeter ShellyEM: 975 Watt
    2024-09-02 19:00:09 INFO Inverterlimit was already accepted at 1850 Watt
    2024-09-02 19:00:19 INFO OpenDTU: Inverter "hm350-office" reachable: True
    2024-09-02 19:00:19 INFO OpenDTU: Inverter "hm800-office" reachable: True
    2024-09-02 19:00:19 INFO OpenDTU: Inverter "hm700-shed" reachable: True
    2024-09-02 19:00:20 INFO powermeter ShellyEM: 981 Watt

    I'm waiting for a sunny day to see how well it follows the changes in demand in my house.



Comments

  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,217 Mod ✭✭✭✭Jonathan


    But there should be no need for this in Ireland as everyone has submitted an NC6 for all their inverters, right? 😂



  • Registered Users, Registered Users 2 Posts: 7,563 ✭✭✭10-10-20


    It's just for while you wait for your NC6 to be drawn up. 😀



  • Registered Users, Registered Users 2 Posts: 7,563 ✭✭✭10-10-20


    It's working pretty well. It's hovering around an export of 50w and adjusting every 10 seconds.

    2024-09-03 14:46:51 INFO     powermeter ShellyEM: -41 Watt
    2024-09-03 14:46:52 INFO powermeter ShellyEM: -71 Watt
    2024-09-03 14:46:53 INFO powermeter ShellyEM: -49 Watt
    2024-09-03 14:46:54 INFO powermeter ShellyEM: -73 Watt
    2024-09-03 14:46:55 INFO powermeter ShellyEM: -55 Watt
    2024-09-03 14:46:56 INFO powermeter ShellyEM: -60 Watt
    2024-09-03 14:46:57 INFO powermeter ShellyEM: -26 Watt
    2024-09-03 14:46:58 INFO powermeter ShellyEM: -69 Watt
    2024-09-03 14:46:59 INFO powermeter ShellyEM: -43 Watt
    2024-09-03 14:47:00 INFO powermeter ShellyEM: -61 Watt
    2024-09-03 14:47:02 INFO intermediate meter OpenDTU: 452 Watt
    2024-09-03 14:47:02 INFO overproducing: reduce limit based on actual power
    2024-09-03 14:47:02 INFO setting new limit to 427 Watt
    2024-09-03 14:47:02 INFO OpenDTU: Inverter "hm350-office": setting new limit from 350 Watt to 80 Watt
    2024-09-03 14:47:12 INFO OpenDTU: Inverter "hm350-office": Limit acknowledged
    2024-09-03 14:47:12 INFO OpenDTU: Inverter "hm800-office": setting new limit from 800 Watt to 184 Watt
    2024-09-03 14:47:15 INFO OpenDTU: Inverter "hm800-office": Limit acknowledged
    2024-09-03 14:47:15 INFO OpenDTU: Inverter "hm700-shed": setting new limit from 700 Watt to 161 Watt
    2024-09-03 14:47:18 INFO OpenDTU: Inverter "hm700-shed": Limit acknowledged
    2024-09-03 14:47:18 INFO OpenDTU: Inverter "hm350-office" reachable: True
    2024-09-03 14:47:18 INFO OpenDTU: Inverter "hm800-office" reachable: True
    2024-09-03 14:47:18 INFO OpenDTU: Inverter "hm700-shed" reachable: True
    2024-09-03 14:47:18 INFO powermeter ShellyEM: 7 Watt
    2024-09-03 14:47:18 INFO setting new limit to 1850 Watt
    2024-09-03 14:47:18 INFO OpenDTU: Inverter "hm350-office": setting new limit from 80 Watt to 350 Watt
    2024-09-03 14:47:21 INFO OpenDTU: Inverter "hm350-office": Limit acknowledged
    2024-09-03 14:47:21 INFO OpenDTU: Inverter "hm800-office": setting new limit from 184 Watt to 800 Watt
    2024-09-03 14:47:23 INFO OpenDTU: Inverter "hm800-office": Limit acknowledged
    2024-09-03 14:47:23 INFO OpenDTU: Inverter "hm700-shed": setting new limit from 161 Watt to 700 Watt

    I'll continue to play.



  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,217 Mod ✭✭✭✭Jonathan


    Just make sure it isn't storing the export limit in some sort of EEPROM which has a limit number of writes...



  • Registered Users, Registered Users 2 Posts: 7,563 ✭✭✭10-10-20


    Yes, I was thinking about that yesterday and I know it's using REST to modify the inverter values through the DTU, but then the DTU sends the value as a non-persistant value. I'd be hoping that's in-memory.



  • Advertisement
Advertisement