mampfes / ha_epex_spot

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

Feature request: Service to get second lowest price hour #72

Closed pos-ei-don closed 6 months ago

pos-ei-don commented 9 months ago

Hi! I use the current service a los to automatically start charging my car at the lowest hout a day. Unfortunately, for my seconc car i need the second lowest hour to set the scheduler. Searing for "duration: 2:00:00" does not seem to be a good solution! The two hours do not need to be near!! Currently I monitor the "rank" value, but setting it when rank=1 is to unflexible and sometimes too late.

maybe something like "min_rank", "min_net_price" or even "but not start time" would be very nice.

Or do you have a better idea?

I cannot charge two cars at the same time as my grid is limited to 20A, and earch car charges with 16A.

mampfes commented 9 months ago

Interesting idea. Let me check.

feutl commented 8 months ago

Hi, perhaps looking at the awattar exampls for IFTTT could be interesting as this would make things simpler for some automations like charging a battery (during winter) and finding the 12 or 6 hours which have high prices for using the battery. I know that this is already implemented somehow with the service calls, but perhaps getting this information more automated as sensors would be great too as I see me struggling implementing the template already ;) .

https://www.awattar.at/services/ifttt image

hlinden commented 8 months ago

I know, ideas are cheap, however, this enhances @pos-ei-don s idea: I would like to use this plugin to optimize my heatpump. I know the outside temperature and derived from that I know how many hours I'll need to run it on a day. So all I need is a state that answers "are we in the n cheapest hours of the day?". They don't even have to be consecutive, stepping runtime in 1h steps is fine for a heatpump. I'd just derive the value for n from a linear function which gets the 24h medium temperature from the weather forecast as an input and run or lock the heatpump depending on the state throughout the day.

EDIT: Well I just understood that's basically what rank does, so, this: https://github.com/mampfes/ha_epex_spot/issues/74

EDIT 2: And now I understood that I can use this right away to implement what I've described above. Sorry, a bit dim today.

mampfes commented 7 months ago

@feutl @hlinden Please have a look at the new EPEX Spot sensor. https://github.com/mampfes/ha_epex_spot_sensor This can be used to do similar things like with the rank sensor. But you are not limited to a whole day, not limited to full hours, and you can choose between intermittend and contiguous.

mampfes commented 7 months ago

@pos-ei-don Something like 2nd lowest price is hard to configure and to implement. But I have a suggestion: Try the new EPEX Spot sensor https://github.com/mampfes/ha_epex_spot_sensor and create an "intermittent" sensor. Set the duration to the sum of the charging durations for car 1 and car 2. Use this sensor as input for an extra automation in HA. This automation shall which charging for car 1 on if the EPEX Spot sensor goes on and after a delay switch charging to car 2. I think this is feasible with the HA automation cababilities.

feutl commented 7 months ago

@feutl @hlinden Please have a look at the new EPEX Spot sensor. https://github.com/mampfes/ha_epex_spot_sensor This can be used to do similar things like with the rank sensor. But you are not limited to a whole day, not limited to full hours, and you can choose between intermittend and contiguous.

Already testing the spot sensor and I am very happy with the ease of implementation :) Thanks

hlinden commented 7 months ago

@mampfes Already seen it, thank you for the implementation - I'm a bit in over my ears in other stuff right now, but I'm getting around to that as soon as I can.