BottlecapDave / HomeAssistant-OctopusEnergy

Unofficial Home Assistant integration for interacting with Octopus Energy
https://bottlecapdave.github.io/HomeAssistant-OctopusEnergy/
MIT License
610 stars 61 forks source link

Allow Agile Octopus Tracking for non-user #294

Closed JRascagneres closed 1 year ago

JRascagneres commented 1 year ago

Describe the feature

Essentially I'm considering getting agile octopus but would like to track the costs for a while into home assistant so I can calculate whether this would be worth-while for me. It would be quite nice if we could opt to have the agile octopus stats as sensors even though thats not what our account is using. This would be in addition to the existing account sensors.

BottlecapDave commented 1 year ago

Hello. This is already possible, see https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/blob/develop/_docs/sensors/electricity.md#tariff-overrides and https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/blob/develop/_docs/sensors/gas.md#tariff-overrides. If you're wanting to mimic you whole setup (e.g. target rate sensors) then be sure to follow https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues/221.

JRascagneres commented 1 year ago

So I can enable this override without affecting the other sensors which have my 'true' data?

BottlecapDave commented 1 year ago

Correct if you enable them they'll create additional sensors for your previous consumption which represents the override. You then do something like the following to compare your current tariff with your comparison tariff

chart_type: line
period: hour
type: statistics-graph
entities:
  - >-
    sensor.octopus_energy_electricity_xxx_xxx_previous_accumulative_cost
  - >-
    sensor.octopus_energy_electricity_xxx_xxx_previous_accumulative_cost_override
stat_types:
  - state
JRascagneres commented 1 year ago

Thanks. I might be being dumb but I'm finding the documentation lacking. So I've got my tarriff IDs and codes but what do I do? 'Enable' the control and then run something to set that control text?

BottlecapDave commented 1 year ago

As per the doc (https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/blob/develop/_docs/sensors/electricity.md#tariff-overrides) you have two sensors, which both need to be enabled.

You have the cost_override_tariff sensor which is a text sensor. This is where you set the tariff you want to compare (e.g. your agile tariff). To get the tariff codes, you need to follow this faq

You then have the cost_override sensor which is a numeric sensor. This is the cost of your previous consumption against the set tariff in the above sensor.

JRascagneres commented 1 year ago

Got it thanks! Presumably this just shows the days cost consumption (previous day) and doesn't allow for a sensor which shows hourly rates?

BottlecapDave commented 1 year ago

Correct. It's used to determine if your current behaviour would be more or less benefical on another tariff. You get the rate that was applied to each consumption (and cost) broken down in the attributes like the non override sensors.

JRascagneres commented 1 year ago

Thanks. Useful :) Would be nice to have a 'current tarriff' for override too

JRascagneres commented 1 year ago

I had it setup with E-1R-AGILE-FLEX-22-11-25-D and it was auto updated at 01:48 to E-1R-VAR-22-11-01-D. Is this expected? Additonally the value of previous_accumulative_cost_override is still "Unknown" but thats expected for a couple days right?

BottlecapDave commented 1 year ago

Correct. The cost override will populate at the same time as the normal cost. If you set it ATM after midnight then it'll be looking for data for the previous day which won't be available.

In terms of the sensor reverting, this should only occur if it fails to persist to HA and you restart HA or the integration. I've been using this integration for months and haven't seen this occur myself which would make it hard to fix it there's an issue with repo steps.

BottlecapDave commented 1 year ago

In terms of current tariff override I'll bare this is in mind if I introduce a current cost sensor

JRascagneres commented 1 year ago

Many thanks for your help. All working now :) Not sure what heppened with the reset but yeah, all good. Thanks!