DemandShaper v2

Im happy to say that DemandShaper v2 has now been released :tada:

DemandShaper is an Emoncms module to enable smart scheduling of appliances and EV charging based on day ahead forecasts such as the Octopus Agile forecast.

New Features:

  • Improved modularity, to make it easier to add new forecasts and devices.
  • Combine multiple forecasts such as the Octopus Agile and Solcast Solar PV forecast (optimise for both on-site solar and the agile tariff)
  • New forecasts: Nordpool (thanks @jpalo), Solcast Solar Forecast & ClimaCell
  • Improved scheduler algorithm allowing variable length schedules at minute resolution

Screenshot of new configuration interface, allowing selection and combination of multiple forecasts:

To update:

The demandshaper module is available as standard on emonSD systems. To upgrade just run the Emoncms upgrade tool from the Admin page.

Original demandshaper thread:
Emoncms Demand Shaper module

Guide: DemandShaper
Emoncms Demand Shaper Module (beta) - Guide | OpenEnergyMonitor


Not really a fan of the effort expended on this TBH; IMHO there are other more pressing things that need fixing and enhancing - it is your baby though. However, have you checked the CPU use of DemandShaper? Last time I looked it was about 15% so I killed the service (as I didn’t use it).

1 Like

That’s fine, Im using this for our work with EnergyLocal where the custom design is required. I also really like it and use it to schedule the OpenEVSE every day.

1 Like

Invaluable to me.
On Agile tariff.
Control OpenEVSE for lowest cost charging.
Control Inverter for lowest cost storage battery charging.
Control plugs to stop dehumidifiers running during peak rates.
Control plugs to turn off Fridge/Freezer during peak.
Our annual bill was close to £1000. Early days and Agile rates may well start to rise. But initial data suggests savings approaching 40%.


Pretty sure I’ve fixed that since, mine is showing 0.3% at the moment.

I should say, I think it would be good to provide documentation on the OEM guide on using alternative approaches such as NodeRed or/and HomeAssistant, I’m aware there are a lot of people doing good work on using those tools for this application, yourself included @borpin. Home Assistant based scheduling may well suit a lot of OEM users better than the demandshaper, my intention is not to say everyone should use this approach at all and it’s great to see ongoing discussion and activity on the forums on using those platforms.

1 Like

Thanks @ian, glad your finding it useful, hopefully we can get all the teething problems sorted out :slight_smile:

Hi Ian, When you say controlling inverter, have you got this working and which inverter. Currently looking at this with SolaX and modbus!

1 Like

4 posts were split to a new topic: Disabling the DemandShaper Module

I have a Lux inverter. Someone reverse engineered the control protocol and wrote a Pi based MQTT client that issues commands direct to the Lux inverter bypassing LuxPower’s cloud based control.

1 Like

I’m having some troubles with DemansShaper together with Nordpool feed. Everything works as longs as I go to the DS web page and do a refresh - it then correctly fetches prices and sets the smart schedule. What doesn’t seem to work reliably is fetching the Nordpool prices using the demandshaper_run.php background service. That too works great if I stop the service, execute demandshaper_run.php manually on command line, but it just doesn’t fetch prices always when running on the background as a service. It might work for a few days, then stop. I see redis nordpool cache item being (NIL). The actual service status looks fine and active.

Is there some specific logic somewhere that would work differently when running as a service vs. running on CLI manually? I haven’t yet figured out how I could debug the code when it runs as a service, so I’m a bit stuck.

EDIT: Haa, now looking at it, it seems to be running demandshaper_run.php from the “original” location, that doesn’t contain the additional bugfixes I’ve made.

● demandshaper.service - Emoncms Demandshaper service
   Loaded: loaded (/lib/systemd/system/demandshaper.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2022-08-29 14:43:58 BST; 15h ago
 Main PID: 13756 (php)
    Tasks: 1 (limit: 2068)
   CGroup: /system.slice/demandshaper.service
           └─13756 /usr/bin/php /opt/emoncms/modules/demandshaper_original/demandshaper_run.php