This sophisticated load-shedding script aims to maintain energy consumption within specified minimum and maximum thresholds by dynamically controlling devices. The script prioritizes devices based on predefined schedules, minimizing power usage while ensuring essential devices remain operational. It offers several strategies to optimize performance, such as setting a significant spread between minimum and maximum power limits and adjusting poll times to reduce unnecessary churn. The script supports both Shelly devices and external devices via webhooks. Notifications can be configured to alert users when devices are toggled. This solution is suitable for environments where energy management is crucial, such as solar power systems or peak demand management.
Load-shedding script will keep measured usage between a low (min) and high (max) total power (watts), by controlling power to other devices.
Key considerations:
1. Make sure the value set for max is greater than the value set for min (10% should be considered the lowest spread, 20% is a better minimum spread)
2. The greater the distance between min and max, the less "churn" you'll have. Setting ample space between these values will make your load shedding more efficient.
3. The lowest value for poll_time should be 60 - during "turn on" cycles, you should allow enough time for inrush spikes to settle.
4. Priority is in order of most important (keep on if possible) to least important.
5. Any device that isn't listed at all, or is left out from all schedules will be unmanaged--never subject to load shedding.
6. Best practice is to name all of the included devices in each schedule, in one of the sets "priority," "on," or "off".
poll_time: minimum time span between applying normal on/off steps
short_poll: when adding devices, highest priority devices are turned on, even if they are presumed to already be on, this shorter time speeds the process