lozzd / octopus-energy-rates-card

This lovelace card for Home Assistant displays the Octopus Energy rate prices per each 30 minute slot
MIT License
60 stars 22 forks source link

Use sensor value for limits #74

Closed aled2305 closed 2 months ago

aled2305 commented 3 months ago

Hi, I am looking for a way to dynamically change the low, medium and high limited.

I would like the medium to be set to each day's average cost, with high being set to the current price cap.

I have both values available as sensors but I'm not sure how to implement these, if indeed it's possible at all?

I have tried the following with no success

type: custom:octopus-energy-rates-card
currentEntity: event.octopus_energy_electricity_xxxxxxxxxx_xxxxxxxxxxxxx_current_day_rates
cols: 2
hour12: false
showday: true
showpast: false
title: Octopus Import
unitstr: p
lowlimit: 10
mediumlimit: {{states('sensor.today_agile_average_electric_rate')}}
highlimit: 28
roundUnits: 2
cheapest: true
multiplier: 100

and

type: custom:octopus-energy-rates-card
currentEntity: event.octopus_energy_electricity_xxxxxxxxxx_xxxxxxxxxxxxx_current_day_rates
cols: 2
hour12: false
showday: true
showpast: false
title: Octopus Import
unitstr: p
lowlimit: 10
mediumlimit: sensor.today_agile_average_electric_rate
highlimit: 28
roundUnits: 2
cheapest: true
multiplier: 100

The current value of {{states('input_number.current_electric_cap')}} is 28.62 and I have also tried {{states('input_number.current_electric_cap') | int}}

Is there anyway of achieving what I'm trying to do?

alinbalutoiu commented 2 months ago

Hey @aled2305, just to update here, you can now use:

mediumlimit: sensor.today_agile_average_electric_rate

To achieve what you're looking for (with the latest version).