frodeheg / no.sparegris

Saves money by adjusting when to use electricity
GNU General Public License v3.0
11 stars 4 forks source link

Add suport for electricity production #2

Open frodeheg opened 2 years ago

frodeheg commented 2 years ago

Solar power has the result of feeding negative power into Piggy bank.

Additional discussion on how to add electricity production support has been discussed here: https://community.homey.app/t/home-battery-thuisbatterij/61795/12?u=frodeheg

Summary:

frodeheg commented 2 years ago

I wonder if the following will do:

  1. Allow you to send the actual production as a flow in to PB
  2. Allow you to read the future prices from PB
  3. Allow you to send back a modified price table to PB

Then you can set your own price estimates on generated power and as such PB will adapt.

Now, the question is how to adapt:

  1. The easiest would be that the new price table just overrides the old one.
  2. Alternatively the price point is based on the actual production:
    • Whenever the production is higher than the consumption the price point will be considered from the production
    • Whenever the production is lower than the consumption the price point will be considered from the grid

Whether 2 is a good option or not is debatable as the consumption is dependent on the price point, so not sure if the consumption should be in the calculation, maybe a constant value could be considered instead?

Also this would mean that the price point could change several times per hour, is this ok?

ugumba commented 2 years ago

Currently, what makes the big difference in Norway is the electricity price relief. In effect, the greater the average price per month, the more beneficial it is to sell solar power to the grid rather than consuming it. This effect dwindles, of course, in fall and winter, as the amount of sun is reduced and the amount of required consumption increases.

Anyway, determining a price point is quite tricky, as you don't know the average price (hence the relief) until you're approaching the end of the month.

So I've kept it very simple for myself. When I detect solar production, I tell PB that power is "extreme". PB does what I expect, tuning consumption down, which is actually good enough for me for now.

(Without sun, I use heat controller to distribute the day's 24 prices into the usual buckets - I use fixed bucket sizes, to ensure that I always get 4 dirt cheap, 5 cheap, 5 normal, 5 expensive and 4 extreme prices. With "extreme" solar prices, I might lose some of these buckets - not sure what to do about that.)

frodeheg commented 2 years ago

So what you're saying is that the above proposal may be too complicated to be worth adding?

Regarding your current solution. As flows to change price point is not possible when you use internal price fetching, do you prefer me to open up so you can use the flow card to override the internal price-setting mechanics? Or do you prefer to do it all external?

ugumba commented 2 years ago

At the moment, and probably until spring, yes, it's probably overkill (and I wouldn't be able to test it properly).

Also, once the relief program ends (end of 2023? Or ever?), there's much less incentive to sell as much as possible - so the feature might only be useful for a short time.

For the time being, I'm happy with my own price scheme - but for PB's internal scheme, I think it would be a great feature to override the price level for, say, the current hour and X more hours.

frodeheg commented 2 years ago

You know what, there is a possibility to add a duration to flow cards. I can add duration on the price point setting, which will override the price point for the duration given (if given) when the internal price points are being used.

Will this be sufficient for now?

ugumba commented 2 years ago

It's a nice feature. Personally, I'm not sure I'll put it to use. I override the price level every time solar panels report production > reserved. I guess every few seconds. Your suggested feature could be useful for planning ahead, i.e. anticipating positive production for the next X hours (using weather reports? Time of year? Location?). All doable, but a bit daunting compared to just living in the moment😉...

frodeheg commented 1 year ago

I may reordering my schedule and add support for solar power next.

The reason is that I am a bit worried that the new version that is out for testing currently might mess up the calculations for those that use solar energy as it is using the meter reader directly. (If anyone with solar power are using the app yet)

Can you confirm the the following:

ugumba commented 1 year ago

I think the grid tariff is based on imported energy alone.

Personally, I use Tibber Pulse.

frodeheg commented 1 year ago

Thanks, For Tibber, the device dump I have only have measure_power and meter_power. I assume that measure_power is = the current power passing the house walls, so when negative you're exporting and positive you're importing. For meter_power I assume it is equal to imported - exported energy, is it?

Or does the Tibber Pulse expose more capabilities when you're able to export power? E.g. can you distinguish between import and export?

If so I would like a device dump of your Tibber Pulse so I can auto-detect if solar power is present.

mailoleas commented 6 months ago

Hi all – thanks for your contribution. My settings; Easy charger, Polestar, Growatt solar panels, tibber pulse – all available as power up in Tibber app. I have today Fjordkraft with virtual battery. The challenge is to charge the car when/ if the solar power is sufficient and be 90% charged until 06:00 in the morning. As I can read there is a lot of changes in the next beta release, and I have been reading to my eyes is sore. 😊 How do I accomplish this? I can't find a simple printscreen example for a flow to change Piggy's price from auto/ manual and back?

frodeheg commented 6 months ago

There is no flow to change between manual and auto price points. There is a ticket for it here though: https://github.com/frodeheg/no.sparegris/issues/255