Sensors to show the fixed peak/off-peak rates? #862
Replies: 3 comments 2 replies
-
Hello. There are peak/off peak sensors already present, just in a disabled state. See previous consumption sensor or this current rate sensor (if you have a Home Mini) as an example. Unless I'm misunderstanding? |
Beta Was this translation helpful? Give feedback.
-
Yes, those update every day when the rate changes, whereas I'm after "fixed" sensors that just show the price I'd pay during those times, if that makes sense? The way I've done it is I have dual-rate meters in HA that switch back and forth with the rate changes, but they just track usage. Then once a month I take the peak meter value and multiply it against the (manually set) peak rate, and the same with the off-peak meter and off-peak rate to get the costs of each. When the energy price cap changes, like it did last month, I need to go and amend the values in those helpers to keep it accurate but it would be good if it could be automatic, like it is for the standing charges. Now that I've typed it out I'm sure there must be a better way to do this using the energy dashboard but the last time I looked at that I just managed to confuse myself! I should probably look at it again... |
Beta Was this translation helpful? Give feedback.
-
Thanks, that's brilliant! Will have to sit down and think it through when
I've got a rested brain!
…On Mon, 1 Jul 2024, 19:55 MaximumFish, ***@***.***> wrote:
I've worked around this by using the current_day_min_rate and
current_day_max_rate attributes combined with some input_number helpers.
I've clipped the relevant part from a much larger automation that also
updates a whole bunch of date/time helpers with the current and next
Intelligent Dispatch and off-peak times. I can post the full thing if
there's interest, but that's why it runs twice a minute and does everything
in parallel (so that one error doesn't kill the whole thing).
Notes:
- Replace the entity values with the correct ones for your account.
- There's some logic to stop it from setting the off-peak rate to zero
if there happens to be a free (or negative) period that day. My region
doesn't get either so that part is untested.
- I'm on a fixed export rate so I set that using the average value
rather than min or max. It probably makes no difference either way.
trigger:
- platform: time_pattern
seconds: "10"
- platform: time_pattern
seconds: "50"
condition: []
action:
- parallel:
- service: input_number.set_value
data:
value: {{ state_attr('sensor.octopus_energy_electricity_xxxxxxxxxx_xxxxxxxxxxxxx_current_rate', 'current_day_max_rate') | float }}
target:
entity_id: input_number.octopus_peak_rate
- if:
- condition: template
value_template: {{ state_attr('sensor.octopus_energy_electricity_xxxxxxxxxx_xxxxxxxxxxxxx_current_rate', 'current_day_min_rate') | float > 0 }}
then:
- service: input_number.set_value
data:
value: {{ state_attr('sensor.octopus_energy_electricity_xxxxxxxxxx_xxxxxxxxxxxxx_current_rate', 'current_day_min_rate') | float }}
target:
entity_id: input_number.octopus_off_peak_rate
alias: Set off-peak cost, but only if the "current_day_min_rate" is > 0 (to avoid setting the rate to zero if there's a free period)
- service: input_number.set_value
data:
value: {{ state_attr('sensor.octopus_energy_electricity_xxxxxxxxxx_xxxxxxxxxxxxx_export_current_rate', 'current_day_average_rate') | float }}
target:
entity_id: input_number.octopus_export_rate
mode: single
—
Reply to this email directly, view it on GitHub
<#862 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BDVSJCMDYEWL4YY23GTSHPTZKGQY7AVCNFSM6AAAAABHDSGTYGVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TSMRZGA2TM>
.
You are receiving this because you commented.Message ID:
<BottlecapDave/HomeAssistant-OctopusEnergy/repo-discussions/862/comments/9929056
@github.com>
|
Beta Was this translation helpful? Give feedback.
-
I'm on Intelligent Go and have built an automation that sends me various energy stats on my billing rollover day, mostly because it takes Octopus themselves so long to send through actual statements. This takes the form of peak/off-peak usage, based on HA utility meter readings and their associated costs, based on a couple of input helpers where I've manually set the peak and off-peak prices.
Of course, any time these prices change, like they just did a few weeks ago, I have to manually adjust these helpers to match. It would be great if this integration could have these values as actual sensors, like it does for the standing charges, so that I don't need to manually adjust them each time - assuming Octopus provides such details of course!
Cheers for all your hard work!
Beta Was this translation helpful? Give feedback.
All reactions