The emoncms demand shaper module uses a day ahead forecast and user set schedules to determine the best time to run household loads. An example could be charging an electric car, the user enters a desired completion time and charge duration, the demand shaper module then works out the best time to charge the car, generally there will be higher power availability overnight and during sunny midday hours. The demand shaper attempts to avoid running appliances at peak times while ensuring that the appliance has completed the required run period.
The demand shaper supports the following forecasts:
- UK Grid Carbon Intensity forecast
- Agile Octopus tariff forecast
- EnergyLocal power availability forecast
See extended discussion on demand side response here: OpenEnergyMonitor Demand Side Response Development
See the github repository readme for the installation guide and requirements.
The demand shaper process publishes the device state to an MQTT topic of the form:
Which is picked up by the smart plug. The EmonEVSE will listen for start & end time schedule updates rather than regular on/off state updates - work still in progress.
There are a number of interesting elements that happen behind the scene when the demand shaper module is used in conjunction with the latest emoncms & device module and EmonESP firmware for the Sonoff S20. I have copied in the guide for using the demand shaper module with the sonoff s20 plug from the readme here for illustration. Note the sections “What happened here?”
Using the Demand Shaper module with a SonOff S20 smart plug
Install the EmonESP (control_merge branch) firmware on a Sonoff S20 smartplug. See guide here:
Enable the UDP broadcast script on the emonbase/emonpi:
crontab -e * * * * * php /home/pi/emonpi/UDPBroadcast/broadcast.php 2>&1
- Install the demand shaper module as above and make sure that you have the latest emoncms master branch and latest emoncms device module installed.
- The Sonoff S20 smartplug creates a WIFI access point, connect to the access point and enter home WIFI network. That is all the configuration required.
- Connect back to your home WIFI network. Login to emoncms and navigate to inputs. Refresh the page until a popup appears asking to connect:
What happened here?: The smart plug discovers the emonbase/emonpi automatically by listening out for the periodic UDP packet published by the emonbase/emonpi, enabled by the UDP broadcast script.
- After clicking allow the smart plug will then appear in the inputs list with a small icon identifying it as a schedulable device:
What happened here?: The smart plug received the MQTT authentication details from the emonbase/emonpi automatically as part of a pairing process enabled by clicking on Allow. After connecting to MQTT the smartplug sent a descriptor message that automatically created and configured an emoncms device based on the smartplug device template in the emoncms device module.
- Click on the clock icon to load the demandshaper module, where the smart plug can be scheduled:
- Wait for the plug to turn on!
We are using these developments in the EnergyLocal smart grid project and much of the above was completed last year. The main new additions are the support of the Octopus Agile tariff forecast and UK grid carbon intensity forecast which starts to make this module useful on a wider basis.