mampfes / ha_epex_spot

Adds EPEX Spot data to Home Assistant.
MIT License
141 stars 21 forks source link

How to start automation from sensor time #22

Closed mm20231988 closed 1 year ago

mm20231988 commented 1 year ago

How can I start an automation from the sensor value (time when the Energy is the cheapest)

mampfes commented 1 year ago

Use the rank sensor for that. It has the value 0 for the cheapest hour and 23 for the most expensive hour.

image

hwellisch commented 1 year ago

is there a possibility to change the time-period to the next 24h instead of the last 24h, for getting the best rank in future from now on? i know that the day-ahead prices from EPEX are not available at midnight. but from 2pm on it should be possible, to get the next-day prices... (awattar at)

mampfes commented 1 year ago

@hwellisch: I'm not sure if a fully understand your request.

First a minor clarification: The time period for the rank sensor is the current day - not the last 24h hours. This a clear and fixed size time-period.

I don't know your concrete application, but I assumed so far that is desireable to always use a fixed time-period. But if you only want to look at the values in the future, this would limit the time-period to max. ~8h because before 14.oo you don't have the values for the next day. There is another issue that I see (and probably this is also because I don't understand your application): If you move the observation window with every hour, so that you only look at values in the future, then it could be that your automation will not trigger for multiple observation-time-periods (e.g. days) in case the lowest price continously decreases across multiple days. Is this what you really want? Or do you want to get exactly 1 trigger in a defined time-period? But then you also have to look into the past...

So, please explain your desired application and also the values that you need from sensor, e.g. is it the start- (and end-) time of the lowest price in a defined time-period? Or the price?

mampfes commented 1 year ago

Closed because no response from originator.