Emoncms Demand Shaper module

Very nice, hadn’t realized there was user specific TZ setting in EmonCMS. No need for my OpenEVSE related TZ fix anymore, and can also confirm your implementation works based on my testing on current release and also with my Nordpool specific implementation.

2 Likes

Thanks that’s great to hear! I will merge the change into the master branch

Hi,
Please could anybody advise as to where in the latest emonESP firmware the type of device (i.e smartplug etc) is set? My understanding is the default is for a wifilink. I am trying to get a Huzzah esp module to think its a smart plug for use with demand shaper. I have flashed the pre compiled .bin form the compile-sonoff folder on github, but looks to behave as a wifi emoncms link.

The link in the post above on how to do this looks to be an old version and is broken.

Best Regards

James

1 Like

I think this is OK.

2 Likes

Hi,
Thank you, that is the image I tried initially. I have also tried version 3, and tried compiling verson 3 from source. I can see in the version 3 firmware the selection for the device, and sonoff is selected. The device is discovered by the demand shaper module, but fails after clicking allow to join, so it appears that the module is not getting configured.
Console output is:-
Received 12 bytes from 192.168.104.2, port 52242
UDP packet contents: emonpi.loca l
MQTT Connecting…
MQTT failed: -2

It appears error 2 is authentication failing, so I manually configured the MQTT logon details on the emon esp, and the login to the mqtt server succeeds. I also manually added the device type in th resultant line in inputs. The device then appears in the demand shaper, but shows as unresponsive.

It apars the module is not getting configured correctly by the emoncms.

Does anyone have suggestion how I can debug this?

Best Regards

James

Hi,

Further to the above, I now have this working using the version 3 firmware however I had to do the following manual configuration.

Correct the port number in EMONESP MQTT configuration to 1883

Put the emonpimqtt2016 password in (this may not have been necessary as that box is normally blank)

Create the profile in emoncms inputs manually.

The plug then appears and works from demand shaper.

Certainly, in my setup however, it appears the automatic configuration is only partially working.

Best Regards

James

2 Likes

Good to hear that you have it up and running @James_Hill

A factory reset after the upload usually fixes the incorrect original port number and then allows for the automatic configuration to work correctly. It requires quite a few things to be in the right state for it to start correctly.

1 Like

Thank you @TrystanLea , the demand shaper looks to be very powerful and I am excited to try it out.

Playing with ideas to economise when on an octopus agile tariff I would like to experiment with inhibiting the fridge or freezer from running during times of peak demand. ultimately this would need some custom hardware, or maybe a wifi relay type module to re enable the fridge if the temperature got too high, but the smart plug will suffice in the mean time.

This would need a feature in the demand shaper app to effectively do the opposite to what it does now, i.e, turn a device off during peaks? Is this something that is on your roadmap?

Something that would also be a great help, for example with my solar HW diverter would be to write the current octopus agile energy price to the MQTT broker, is there a way this can be configured?

Thanks again for the great work on this powerful ecosystem.

Best Regards

James

Something that might be worth mentioning,

V2.3 of the EMONESP firmware works fine with the sonoff smart plug, but V3 seems broken. It does not switch the relay.

Best Regards

James

Hi Trystan,

I’ve altered the code to include a couple of features but i’ve got a problem, when ever i restart it, it reverts back to only the settings that work which is the Useable Battery and EVSE Charge rate, my Balancing Percent and Time, SQL DB Query seems to disappear, but only after a restart, reloading the page is fine, and the database has the settings saved it’s only on load?

Any pointers to what i’ve got wrong?

Hello @sijones

The balancing percentage and balancing time looks great, was just discussing this with @glyn.hudson earlier who is going to start testing the demandshaper again now that he is on Agile.

How are you placing the SOC value in the mysql database to start with, is the query utilising an existing table that you writting the values to using a custom script or are you placing the SOC in the table using nodered?

Would writing the SOC to an emoncms input with a standard name under the OpenEVSE device name using MQTT or HTTP work? This input could then be read in to the demandshaper module for use in scheduling?

Hi @TrystanLea

The functionality of Balancing, if the module is set to charge higher than 80% then it will add 45 mins to the total schedule time, there is no prorata for say charging to 90% as it will just put 45mins on.

The wife’s car is a Renault Zoe, so i’ve got a Node Red script obtaining the percentage, range and other bits and shown in UI, as it does this it writes the range and soc to the database.

I thought having a generic sql query would be best as it’s then queried on demand, not sure how you’d store and retrieve the mqtt value for calculation at the time - I just did that as my thought of best way.

Do you want me to open the pull request so you can get the code?

Yes that would be great, is there any chance you could create a pull request with just the balancing feature?

For the custom SOC, if we use an emoncms input, you can write to this with NodeRed by publishing the SOC via MQTT to a topic name: emon/openevse/soc value e.g: 0.45. The emoncms input will then handle persisting the value for later retrieval by the demandshaper module. I will get an example of this working together this eve.

It’s a separate commit under this 31c4a98 id but i don’t really know how to take off my other changes and only have that commit - am not great with git at the moment.

1 Like

ok great, that’s fine, i will take a look

I’ve been able to put the SOC in to emon as suggested and have SOC there.

Haven’t been able to work out giving you just the balancing feature! Sorry

1 Like

Great!

I’ve put together an initial implementation of fetching the SOC from an input here: Set demandshaper EV state of charge from emoncms input by TrystanLea · Pull Request #41 · emoncms/demandshaper · GitHub Its currently still a development branch as Id like to do more testing.

Not to worry I should be able to merge that in, thanks a lot!

I’ve merged your balancing feature in @sijones, thanks a lot!

There’s also the reading of SOC from an emoncms input and option to set charge length by time as well. All merged into master.

To update SOC input with HTTP:

/input/post?node=openevse&data=soc:25

To update SOC with MQTT:

topic: emon/openevse/soc
value: 25

Thank you, will test end of the week as am currently away.

Did you find any issues with reloading the Balancing settings after a restart?

Also is there a plan to make this all work in the service scheduler so the web page doesn’t have to be reopened?