Charge at the cheaper rates

Posted on
Tue Nov 10, 2020 3:56 pm
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Charge at the cheaper rates

Thanks for your work on this plugin - absolutely awesome!

I'm wondering if there is an easy way to charge my Tesla PowerWall Battery, and maybe my Car overnight.

I don't need it to charge for 2, 3, or 4 hour straight.
But instead I need it to charge for say, 4 or 6 hours - it doesn't matter when, but using the lowest rates overnight.

This means it could charge for 30m, stop because the rates spike up, then 30m later start charging again - as long as it gets a total of 6 hours of charging overnight I'm good.

At the moment I'm doing this by manually editing the trigger each night to charge when the price drops below the rate that I set (depending on what I see are coming up overnight).

Any way to automate this somehow?

Posted on
Tue Nov 10, 2020 4:13 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

This would work like the Ohme charger I have, and the plugin has all the rate info needed to do this. I could possibly add a Device state that changes when it is “preferred”. I would need to figure out the configuration of the number of 30 minute periods you would need and the time range you need it.

Would it always be overnight ? That could make the logic easier with a configurable time period.

Posted on
Tue Nov 10, 2020 5:03 pm
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Charge at the cheaper rates

For me yep, as it’s always charging overnight with typically cheaper rates.

During the daytime I have solar which tops up the battery so only need to charge overnight when it’s mostly dead anyway.


Sent from my iPhone using Tapatalk

Posted on
Wed Nov 11, 2020 1:49 am
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

Ok - I will have a look at the weekend and see what can be done.

Neil

Posted on
Sat Nov 14, 2020 8:31 am
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

Pete (and others),

https://github.com/neilkplugins/Octopus_Energy-indigo-plugin/releases/tag/0.2.17-alpha is a test version that includes my interpretation of the functionality you require, but will need testing. Here is how it works :-

- I have created a new device type "Charge Sensor" that can be triggered to "On" when the rate is "cheapest" to deliver the number of hours charging you require. It can also be overidden if the rate exceeds a configurable threshold. (e.g. It may be the one of the cheaper periods in the day or night, but it is still too high to warrant charging a Home Battery or Electric Vehicle)

The device configuration includes

Agile Rate Device - This is the tariff device that the "Charge Sensor" is associated with. In most cases this will be the Octopus Agile Device you already have designed, but it is possible to monitor rates and trigger for other locations (a home and an office for example)

How many hours of charging needed - Select the number of hours you would like to charge your load. In this initial version it will work across two periods "Night" which is from Midnight until 7:00am and "Day" which is 9:00 until 15:00. This is largely abritrary but the cheapest periods usually fall during these times.

Night / Day Charging - it will calculate the best periods for the charge time required in the "Night" or "Day" Windows described above.

Do not charge above (in Pence) - creates a rate threshold that will prevent the sensor turning "on" if the rate is above the defined figure. If you leave at the default of 35 then this will never happen as this is the maximum rate, but you can lower so that you do not pay to charge your powerwall if the rate is not economical even if in relative terms it is cheap for the day

You should be able to trigger from this as a normal Indigo sensor device.

I also provide device states that show "Preferred_Periods" that are the number of periods when the sensor will "fire" sorted from cheapest to most expense up until the number of hours you have requested. "Preferred_Rates" are the associated rates for the periods, again sorted cheapest to most expense.

It has had limited testing, so use at your own risk but it should not break anything else and feel free to give feedback and requests.

Future Version Plans

- I will add an action to allow the "No_Charge_Above" rate to be varied on demand, rather than as a fixed device configuration
- I will add a similar action to vary the number of hours needed to charge
- I will bring the hours after the evening peak into scope, this requires a little more work as currently this crosses the day boundary so I will need to make my logic a little more sophisticated. In most cases the best rates will be between 00:00 and 7:00 anyway I can easily extend the 7:00 limitation.

Thanks,
Neil

Posted on
Sun Nov 15, 2020 3:42 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

https://github.com/neilkplugins/Octopus_Energy-indigo-plugin/releases/tag/0.2.18-Alpha

This release adds the following -

A new "evening" charge period (19:30 to 23:30), and updates "day" (08:00 to 15:30) and "night" ("00:00" to 7:30)
Device actions to update the max charge rate and the charge hours (which now also show as device states)
Fixed a general bug with an uncaught error with the daily standing charge update if the API is not available and general enghancements to the charge sensor

@petematheson - try this one if you have not started yet,.

Neil

Posted on
Tue Nov 17, 2020 4:00 pm
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Re: Charge at the cheaper rates

Just curious... I don't have a plugin car, but would be half way interested in running my pool pump when the power is cheaper. Might it be possible for you to explain what hardware is needed to determine the current electric rate, and how that hardware interfaces with Indigo?

Posted on
Tue Nov 17, 2020 4:38 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

You are right this approach works for any load that you may be able to switch with Indigo. The plugin is linked to a Time of Use Tariff from UK energy provider Octopus, currently the only one available for us. They publish the rates in 30 min “periods” every day mid afternoon following the daily auction via their JSON api. The plugin pulls down the rates and makes them available as device states, and with this sensor functionality.

No hardware required for Integration but you will need a smart meter.

Posted on
Tue Nov 17, 2020 10:30 pm
jltnol offline
Posts: 994
Joined: Oct 15, 2013

Re: Charge at the cheaper rates

Well I THINK I have a smart meter, but live in the US.. ;(

The smart meter was installed about a year ago, and I'm not sure the utility provider has fully implemented everything it can do.

Basically, what I understand is that your utility company advertises the current rates on the web, your plugin gathers that info, and Indigo can act/react according.

thanks for the info..

Posted on
Thu Nov 19, 2020 1:04 pm
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Charge at the cheaper rates

Thanks for this! Sorry for the delay.
Upgraded, created the new device and I get this:
Octopus Energy Debug Starting device: new device 1
Octopus Energy Debug 1623288911 new device 1
Octopus Energy Error Error in plugin execution ServerReplacedElem:

Traceback (most recent call last):
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/plugin_base.py", line 1179, in deviceUpdated
File "plugin.py", line 75, in deviceStartComm
File "plugin.py", line 126, in update
ValueError: invalid literal for int() with base 10: ''

Posted on
Thu Nov 19, 2020 2:09 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

Pete - no problems, I was just curious, and that will teach me to ask. :wink:

I will take a look now, all good on my development machine.

Neil

Posted on
Thu Nov 19, 2020 2:20 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

Hi Pete,
That was nice and easy. If you could edit the device settings, I am guessing the pull down "Agile Rate Device" is not set. You should see a pull down that is greyed out saying "-select an item", with a pull down list next to it. I assume you already have an Energy Rate Device, and you should see that named and select it and all should be good.

A new version will follow that traps this, but once configured (worst case restart the plugin) and you should be good with the version you have.

Thanks,
Neil

Posted on
Thu Nov 19, 2020 2:52 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

https://github.com/neilkplugins/Octopus_Energy-indigo-plugin/releases/tag/0.219-Alpha

Fixes the error with a tariff device not being defined in the device settings, the settings dialog is now validated before saving, and the update code elegantly traps the error if no device is defined (the device settings was cancelled rather than saved).

It is not necessary to upgrade, as no additional functionality.

Thanks,
Neil

Posted on
Fri Nov 20, 2020 2:28 pm
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Charge at the cheaper rates

Upgraded! Will see how tonight goes in terms of charging - Huge thanks for this!

If this works then the only thing left to do is automate a way of estimating the solar generation for the next day so I can decide whether I should charge or not the night before!

Posted on
Fri Nov 20, 2020 3:18 pm
neilk offline
Posts: 715
Joined: Jul 13, 2015
Location: Reading, UK

Re: Charge at the cheaper rates

Let me know how it goes and if we need to tweak it.

Neil

Who is online

Users browsing this forum: No registered users and 2 guests