Calculate next night lowest price #864
-
Hi there, I'm trying to create an automation to run after the next day rates are published and set a sensor with the lowest night time (00:00-06:00) Agile price so I can schedule devices to charge at that time. I notice that the next day entity comes in the format of:
Is there an easy way in HA to iterate over the time map and find the lowest price? Cheers thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
So far, I've tried setting a helper template sensor with this template this but with no success:
this query does return the min value for the whole day:
|
Beta Was this translation helpful? Give feedback.
-
Hello. The easiest way would be to use a target rate sensor, with a focus on 0.5 hours and a min-max time set to your desired period. This will turn on/off when the current rate is the cheapest rate. You could then use a template sensor to index into the first item of the
|
Beta Was this translation helpful? Give feedback.
-
If anyone in the future comes looking for a way to set your house battery to charge at night for 3 periods of 30 mins, here's what I did.
|
Beta Was this translation helpful? Give feedback.
Hello. The easiest way would be to use a target rate sensor, with a focus on 0.5 hours and a min-max time set to your desired period. This will turn on/off when the current rate is the cheapest rate. You could then use a template sensor to index into the first item of the
target_times
attribute. E.g.