New piece of code for Octopus Saving Sessions. They are offering £2.25 per kWh that we save.
def checkBlockers(self, deviceInfos: DeviceInfos) -> Optional[bool]: blockers: Iterable[Predicate[DeviceInfos]] = [ OctopusGo.isSavingSession,
def reasonWeShouldTurnOn(): ... if OctopusGo.isSavingSessionSoon(calculationMoment,deviceInfos): # We're assuming it's cold because otherwise Octopus wouldn't need the saving session return "It will soon be time for a Saving Session so get the house warm in advance."
Although, having written that I changed my mind because the blocker might just leave it on if it’s already on when the session starts. I’ve done this instead:
def reasonWeShouldTurnOff(calculationMoment: datetime.datetime, deviceInfos: DeviceInfos) -> Optional[str]: if OctopusGo.isSavingSession(calculationMoment,deviceInfos): return "The heating shouldn't be on during a Saving Session"
ofc I can test the future too:
bash test.sh --calculation-moment 2022-11-22T17:05:16
2022-11-21T22:46:45.118 DEBUG root Turning on so we can do some heating. It will soon be time for a Saving Session so get the house warm in advance. (Power → true from ManageSpaceHeatingPower.manage)
Gosh, using EmonCMS I can see that sometimes I use over 4kWh in the same hour as tomorrow’s window, it’s not my average though.
I haven’t automated the parsing of the email into the
OctopusGo class yet
I’m sure you are nudging things around using your automation too so it’d be fun to see what you decided to do.