Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

Version 1 Current »

Load shedding is the intentional, temporary reduction of electrical power supply to certain appliances and/or circuits. This is done to reduce electrical consumption and is a cost saving measure. Load shedding helps to balance supply and demand, ensuring the stability of the overall electrical system during times of high demand or when there are issues with power generation.

AdobeStock_608968611.jpeg

Why use a Script for Load Shedding?

Using a script running on a Shelly Pro 3EM has a lot of advantages, especially when combined with various other Shelly relays. Scripting can offer a highly customizable and extremely efficient way to accomplish load shedding. A script either from the repopulated Shelly library or manually entered is used to create a system where you can dynamically control and shed loads based on certain conditions, such as high energy consumption or demand.

In this case, we will be using an Advanced Load Shedding Script that builds upon the basic version. The advanced version includes refined notifications and enhanced scheduling features, allowing for a more granular approach to load shedding.

Prerequisites

These devices will be used to gather the consumption data required for load shedding

PM devices can be used to gather additional consumption data and control circuits during shedding.

image-20240528-143349.png

These devices will be used to control various loads during shedding.

Steps to Setting up Load Shedding

1. Setting Up Shelly Pro 3EM

Wire and Configure the Pro 3EM

  1. Install and Configure: Install the Pro 3EM per the diagram below to monitor the energy consumption of the entire home.

In scenarios where CT-B is not used, it is advised to repurpose it to cover Neutral. This requires recalibrating in the device’s settings.

Standard split single phase electrical systems in North America will only use CT-A and CT-C to cover incoming feeds.

Note: Shelly Pro 3EM must use the C terminal connection to power the meter’s microcontroller, so CT C must always be used. Either CT A and CT B can be used for the other phase.

image-20240528-153746.png

Terminal C must be connected to line voltage to power the microcontroller of the Pro 3EM.

Legend

Terminals

Cables

A

Phase A input

LA

Phase A live (110-240 V) cable

B

Phase B input

LB

Phase B live (110-240 V) cable

C

Phase C and power supply input

LC

Phase C live (110-240 V) cable

N

Neutral terminal

L

Mono-phase live (110-240 V) cable

IA

Phase A current transformer input

N

Neutral cable

IB

Phase B current transformer input

Current transformers

IC

Phase C current transformer input

CTA

Phase A current transformer

IN

Neutral current transformer input

CTB

Phase B current transformer

CTC

Phase C current transformer

CTN

Neutral current transformer

  1. Connect to Network: Using Shelly Smart Control, connect the Pro 3EM to your network.

Shelly Pro 3EM supports both Wi-Fi and Ethernet

AdobeStock_708252872.jpeg
AdobeStock_705084752.jpeg

  1. Shelly Cloud (optional): Add Shelly Pro 3EM to a Shelly Cloud account for remote access.

2. Set Up Additional Shelly Relays

  1. Install Shelly Relays: Install Shelly relays to control the specific loads you want to manage.

Product Specific installation information can be found at the Knowledgebase

  1. Connect to Network: Using Shelly Smart Control, connect the Pro 3EM to your network.

Shelly Pro 3EM supports both Wi-Fi and Ethernet

AdobeStock_708252872.jpeg
AdobeStock_705084752.jpeg

  1. Shelly Cloud (optional): Add Shelly Pro 3EM to a Shelly Cloud account for remote access.

3. Adding the Load Shedding Script to the Host Pro 3EM

The below steps should be done on a computer using control.shelly.cloud instead of using the App on a mobile device.

  1. Navigate to the Scripts Menu: Shelly Smart Control has a section for Scripts for each compatible device. For Load Shedding we will use a Shelly Pro 3EM. With that device select click on the { } Icon.

  2. Click Create New Script: At the Time of this writing the Advanced Load Shedding Script is not yet available from the Library and will need to be added manually.

IMG_29403F52FBEC-1.jpeg

image-20240603-173137.png

  1. Name the Script: At the top of the screen give your script a name.

  1. Copy the Script from Github: The advanced load shedding script can be found on GitHub using the link to the right.

  2. Paste the Code: Once copied paste the code into the code window on control.shelly.cloud

https://github.com/ShellyUSA/Scripts/blob/main/load-shed/advanced-load-shedding.js

Before coping the script code, you should click on the Raw link in the bio right of the code panel.

image-20240612-163717.png

4. Configure the Script

image-20240612-164947.png

  1. Channel Settings: Device channel settings will need to be configured for the Pro 3Em and in this example Pro 4PM

  1. Configuring the Shedding Trigger Parameters:

    1. max_

    2. min_

Ensure that the value assigned to max_before_shedding is greater than the value set for min_before_re_adding

A 10% difference should be considered the minimum, but a 20% difference is preferable.

The larger the gap between the minimum and maximum values, the less "churn" you'll experience. Providing sufficient space between these values will enhance the efficiency of your load shedding.

max_ = 1200;
min_ = 900;

max_ referenced above is a global max, used only if not defined in schedules

min_ referenced above is a global max, used only if not defined in schedules

poll_time = 300;             // unless overriden in a schedule, defines time between shedding or adding load
short_poll = 10;             // faster cycle time when verifying that an "on" device is still on

  1. Configuring the Polling Frequency:

    1. poll_time

      1. Minimum interval between executing normal on/off steps

    2. short_poll

      1. Interval after toggling on a device assumed to be already on

The minimum value for poll_time should be 60. During "turn on" cycles, ensure you allow sufficient time for inrush spikes to stabilize.

  1. Additional Settings: The following settings are used for advanced applications and troubleshooting.

    1. logging

    2. kvs_status

    3. simulation_power

    4. simulation_hhmm

    5. simulation_day

logging = false;
kvs_status = false;          // store status in key-value-store
simulation_power = 0;        // set this to manually test in console
simulation_hhmm = "";        // leave "" for normal operation, set to time like "03:00" to test
simulation_day = -1;         // -1 for normal operation, to test, 0=Sunday, 1=Monday...
devices = [ { "name":"Water heater", "descr": "Shelly Pro 3EM", "addr":"192.168.1.105","gen":2, "type":"Switch", "id":100, "notify" : true },
            { "name":"EV charger", "descr": "Shelly Pro 3EM", "addr":"192.168.1.106","gen":2, "type":"Switch", "id":100, "notify" : true },
            { "name":"Pool Pump", "descr": "Shelly Pro 3EM", "addr":"192.168.1.107","gen":2, "type":"Switch", "id":100, "notify" : false },
            { "name":"Oven", "descr": "Shelly Pro 3EM", "addr":"192.168.1.108","gen":2, "type":"Switch", "id":100, "notify" : true },
            { "name":"Air Conditioner", "descr": "Shelly Pro 3EM", "addr":"192.168.1.109","gen":2, "type":"Switch", "id":100, "notify" : false },
            { "name":"Ceiling fan",  "descr": "Shelly 1PM", "addr":"192.168.1.110","gen":1, "type":"relay", "id":0, "notify" : false },
            { "name":"Hot Tub", "descr": "NodeRed endpoint to control non-shelly devices", 
                     "on_url":"http://192.168.2.1:1880/endpoint/hot_tub?state=ON",
                     "off_url":"http://192.168.2.1:1880/endpoint/hot_tub?state=ON",
                     "notify" : false },
            { "name":"Entertainment Center",  "descr": "Shelly Plus 2PM relay single channel",
                     "addr":"192.168.1.114","gen":2,"type":"relay","id":0, "notify" : true },
            { "name":"HVAC",  "descr": "Shelly Plus 1PM with contactor",
                     "addr":"192.168.1.111","gen":2,"type":"relay","id":0, "notify" : true },
            { "name":"Dishwasher",  "descr": "Shelly Plus 2PM relay first channel",
                     "addr":"192.168.1.112","gen":2,"type":"relay","id":0, "notify" : true },
            { "name":"Microwave", "descr": "Shelly Plus 2PM relay second channel",
                     "addr":"192.168.1.112","gen":2,"type":"relay","id":1, "notify" : true },
          ]

The best practice is to categorize all included devices in each schedule into one of the following sets: "priority," "on," or "off."

  1. Setting the Devices to be Shed: The devices to be shed using this script are listed in a JSON schema following the example on the right.

The description and notification settings are optional. By default, notifications (notify) is set to false.

Any device not listed or omitted from all schedules will remain unmanaged and will never be subject to load shedding.

  1. Configuring Notifications: This script has the ability to fire off IFTTT Webhook Applets to then trigger notifications via various platforms.

IFTTT is a 3rd-Party Platform and any issues are not supported by Shelly.

notify = [ { "name": "notify off", "descr": "IFTTT webhook to fire when a device is disabled",
              "url":"https://maker.ifttt.com/trigger/send_email/with/key/crLBieQXeiUi1SwQUmYMLn&value1=knobs" },
            { "name": "notify on",
              "url":"https://maker.ifttt.com/trigger/send_email/with/key/crLBieQXeiUi1SwQUmYMLn&value1=sally" },
         ]
https://ifttt.com/
schedules = [ { "name":"Daytime Solar", "enable": true, "start":"07:00", "days":"SMTWTFS",
                "descr":"Weekdays, starting 7AM, when solar production ramps up",
                "priority":["HVAC","Oven","Microwave","Entertainment Center","Water heater","EV charger","Dishwasher","Ceiling fan","Pool Pump"],
                "min":2500, "max":3500, "poll_time":300, short_poll:10 },
             { "name":"Evening Time of Use-Peak Demand", "enable": true, "start":"17:00", "days":".MTWTF.",
                "descr":"Weekdays, starting 5PM, returning to grid, time of use/peak demand rates apply with penalty",
                "priority":["HVAC","Ceiling fan","Entertainment Center","Microwave","Dishwasher"],
                "off" : ["Pool Pump"],
                "min":2000, "max":3000, "poll_time":300, short_poll:10,
                "notify_on" : "notify on", "notify_off" : "notify off" },
             { "name":"Weekend Nights Grid", "enable": true, "start":"17:00", "days":"S.....S",
                "descr":"Saturday/Sunday after solar, no Time of Use rates",
                "on" : ["ALL"] },
             { "name":"All Nights Grid", "enable": true, "start":"20:00", "days":"SMTWTFS",
                "descr":"Every day, starting 8PM, returning to grid, time of use/peak demand rates have ended",
                "on" : ["ALL"] },
  1. Setting Schedules: Schedules are defined in a JSON list and set day and time for the Shedding schedule as well as on/off times and device priority. An example of scheduling in on the left.

Priority is ranked from most important (keep on if possible) to least important.

image-20240603-180340.png

  1. Saving and Executing the Script:

    1. Click the Save Button in the top right next the the Script Name and Play Button

    2. Click the Play Button in the top right next to the Script Name.

5. System Testing

  1. Simulate High Load: Increase the load to trigger the thresholds.

  2. Verify Script Actions: Check if the Activity Log to verify the Load Shedding Script is executing the defined commands.

IMG_1DD4F941632D-1.jpeg

Adjust Settings: After a satisfactory system test setting should be fine-tuned in regard to the thresholds and actions based on your requirements.

image-20240528-164510.png

By following these steps, you can effectively use a Script with Shelly Pro 3EM and various Shelly relays to implement load shedding, helping to manage and reduce energy consumption dynamically.

  • No labels