BottlecapDave / HomeAssistant-OctopusEnergy

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

Unit as part of value in target entities #480

Closed LucidityCrash closed 11 months ago

LucidityCrash commented 11 months ago

Describe the bug

Target entities have a number of cost attributes and they all have a "p" in their value :

overall_average_cost: 18.8265p
overall_min_cost: 17.997p
overall_max_cost: 19.5825p
current_average_cost: null
current_min_cost: null
current_max_cost: null
next_average_cost: 18.826500000000003p
next_min_cost: 17.997p
next_max_cost: 19.5825p

(the null ones do as well)

the current day rate entity doesn't :

current_day_min_rate: 2.4255
current_day_max_rate: 37.6635
current_day_average_rate: 19.366108695652173

Reproduction steps

create a target entity

Expected behaviour

the cost values should be a float not a string.

Tariff Code

No response

Integration Version

8.4.4

Home Assistant Version

2023.10.3

Fresh Install?

Not specified

Home Assistant Logs

N/A

LucidityCrash commented 11 months ago

Also while you are looking at that, would it be "better" to have those attributes in GBP rather than pence for consistency with the sensor unit of measure ?

BottlecapDave commented 11 months ago

Hi and thanks for raising this issue. The denomination was present to make it clear what the value represents. The inconsistency between some of the attributes was mainly due to OE reporting in pence and HA wanting data reported in pounds and pence. I was trying to avoid transforming the data reported by OE to reduce errors, but this has lead to a less than ideal experience for users.

I had a few inconsistency reports, which I've consolidated into https://github.com/BottlecapDave/HomeAssistant-OctopusEnergy/issues/481 as they will all result in a breaking change and it makes it easier for me to track them all. Therefore I will be closing this issue and you should watch that issue for updates.