Skip to content

Calculate next night lowest price #864

Closed Answered by BottlecapDave
luismsousa asked this question in Q&A
Discussion options

You must be logged in to vote

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.

{% set rates = state_attr('binary_sensor.octopus_energy_target_{{TARGET_RATE_NAME}}', 'target_times') %}
{% if rates is not none and rates | length > 0 %}
{{ rates[0]["value_inc_vat"] }}
{% endif %}

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@luismsousa
Comment options

Answer selected by luismsousa
Comment options

You must be logged in to vote
2 replies
@luismsousa
Comment options

@BottlecapDave
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants