mampfes / ha_epex_spot

Adds EPEX Spot data to Home Assistant.
MIT License
130 stars 19 forks source link

update epex_spot_at_lowest_price when time is over #23

Closed pos-ei-don closed 1 year ago

pos-ei-don commented 1 year ago

Can we please uptate epex_spot_at_lowest_price or add an epex_spot_at_lowest__next_price when the time os over? It does't help to see an lowest price from the day before.

mampfes commented 1 year ago

@pos-ei-don The lowest-price sensor shows the lowest price of the actual day - not the day before. I don't know really understand your request because I don't know your application. Could you please describe what you want to achieve?

There is a similar discussion here: https://github.com/mampfes/ha_epex_spot/issues/22#issuecomment-1524727480

If this fits to your discussion, please continue the discussion there.

pos-ei-don commented 1 year ago

We now have 15:18, I need the next time of a low price, not the one at 03:00 which is over!

Today, the next "lowest price" is now! The overall lowest price is tomorrow at 14:00

grafik

mampfes commented 1 year ago

Thanks for the info. I'm still trying to find out what you want to achieve and why you want to do this - otherwise I cannot implement anything. Some basic question that I have are:

So it would be really helpful if you can explain your application - what to you want to achieve?

pos-ei-don commented 1 year ago

Thank you A LOT for the answer.

* Do you just need the point in time of the next lowest price? Or do you need the time to the next lowest price?

To be honest, both. When the SOC of the battery is <30%, I need "the next! If the SOC is >30%, i need the overall lowest to charge my battery at the lowest possible price with maximum speed (>200A).

* Do you want to use this value for an automation or just for viewing purposes?

Currently for viewing and manually deciding, but later i plan to automate it aswell.

* Why do you need the point of next lowest price right after the last lowest price has been elapsed? Wouldn't it be sufficient (e.g. for an automation) to get the lowest price of the current day at midnight?

When after a full hour of charging the SOC of the battery ist still <80% and the next lowest price i still lower than the price to sell solar-power (return) AND the solar forecast is bad, I'd charge the battery a second timeslot.

* In your example, the lowest price is at 14:00 of the next day. Lets assume that new values for the following day (the one after tomorrow) will be fetched tomorrow at 13:55 and the new values contain an even lower price for the following day. How should the sensor behave in that case. Should it simply switch to the newest lowest price? I cannot image an useful application for that behavior.

Yes, it should switch to the next lowest price! My Script decides in SOC and on other values if I need to charge the battery sooner or if i can wait longer for a lower price.

So it would be really helpful if you can explain your application - what to you want to achieve?

First usage is for viewing. Sometimes the price difference between the timeslots is so small that you cannot see this in a plot. So I'd like to know, when the next low price timeslot is. Having an earlier one and the total minimum of all known prices would be the best solution in my pov. The next thing i'd like to achive is to show the same information in the plot as in these values to achive a better WAF. It the Plot tells me that the lowest charging rate is on the next day at 14:00, it would be ideal if this entity tells my wife the same thing ;-). For the automation-part I plan to use the "quantile" value. p.ex. if SOC is very low and the Solar forecast for the next 3 hours is bad, charge if quantile is >0.1, else if SOC is "ok", charge only if quantile is 0.

I hope I could explaind what i am trying to do and I hope this all makes sense.

best regards, Joe

mampfes commented 1 year ago

Thanks for the detailed explanation. I think you have a rather special application which cannot be easily supported by a general integration like this. If you need the values for display purposes only, I would recommend to build s.th. with ApexCharts (look like you already did it). And if you already have a script for the automation part, I would add the missing functionality there. All needed data is available in the sensor attributes. Sorry.