# Tweaking ## Smart tracking Based on the Zendure-HA-zenSDK Home Assistant automation code you are running, you can increase your hysteresis buffer directly through the Home Assistant dashboard helper entities.The automation provides dedicated input_number sliders for exactly this purpose, meaning you do not need to modify any YAML code.Step 1: Adjust Your Buffers and ThresholdsLook for these specific entities on your Home Assistant dashboard (or search for them under Settings > Devices & Services > Helpers) and tweak their values:input_number.zendure_setting_start_charging_at: This controls the exact grid export power threshold that forces the battery to start charging. By default, it is set to -300 W. Increase the hysteresis gap by dragging this lower (e.g., to -400W or -500W) so that a massive amount of excess solar must build up before the system triggers a charge mode.input_number.zendure_setting_start_discharging_at: This dictates when the battery starts discharging to cover your home's load. By default, it is set to 100 W. Increase this to a higher baseline (e.g., 150W or 200W) so minor household appliances jumping on and off won't trip the relay.input_number.zendure_setting_charge_buffer: Tweak this higher (e.g., from 50 to 75 or 100) to damp the charging response.input_number.zendure_setting_discharge_buffer: Tweak this slightly higher (e.g., from 5 to 15 or 25) to prevent minor power dips from oscillating the inverter.Step 2: Enable the Internal Automation DelayIf you look closely at your smart discharge logic, there is an engineered delay buffer built right into the YAML sequence:yaml- condition: or conditions: - condition: state entity_id: sensor.zendure_charging_mode state: Charging for: hours: 0 minutes: 0 seconds: 9 Use code with caution.This constraint forces the system to stay in Charging mode for at least 9 seconds before it is legally allowed to pivot back to discharging.If your relay is clicking faster than every 9 seconds, the native 5-second time_pattern trigger (- seconds: /5) is firing too fast for your grid meter's reporting interval. To smooth this down completely:Go to your Automations tab in Home Assistant.Find the Zendure zenSDK (Gielz) Global automation.Click the three dots, select Edit in YAML, and scroll to the very top triggers: block.Change - seconds: /5 to a slower checking interval like - seconds: /10 or - seconds: /15.Slowing down the execution loop combined with wider power buffers will entirely eliminate the rapid clicking loops.If you change these parameters, let me know how often your smart meter updates (e.g., every 1 second or every 10 seconds) so we can tune the execution window perfectly to prevent overshoot.