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

Deprecation of attributes - no longer works with 9.0.0+ #27

Closed BottlecapDave closed 7 months ago

BottlecapDave commented 9 months ago

Hello. I just wanted to inform you that I've made the attributes that this card uses deprecated, which will be removed in the next major version (post november 6th).

I suggest this card is adapted to take a collection of entities, which the card then merges the rate data for?

lozzd commented 9 months ago

Thanks for the head up! Do you have a new example data structure somewhere that I can check to see if I can make it work? (is that already live?)

lozzd commented 9 months ago

Wow I totally missed the link in that message originally. pre-coffee. Will look in to it.

lozzd commented 7 months ago

I haven't had time to look in to this so if you wish to keep using the card do not yet upgrade to 9.0 of the integration

steve-prentice commented 7 months ago

"if you wish to keep using the card do not yet upgrade to 9.0 of the integration"

Oops.... :-/

RazorClam commented 7 months ago

"if you wish to keep using the card do not yet upgrade to 9.0 of the integration"

Oops.... :-/

Ha, same! =( Something else my wife used and now doesn't work! This is life on the cutting edge. Thanks for all your work guys. Look forward to a fix

deltamelter commented 7 months ago

There's a lot to fix in this, I took the opportunity to add some additional colours and rate bands...

I still hate the way the browser refuses to give up using the cached version of javascript cards like this one, always seem to spend most of my time trying to get changes to appear :)

as well as the "start" all "all_rates" changes, the card expects to be dealing in pence whereas the value is now in decimal pounds so needs to be multiplied by 100... this threw me on some of the graphs too where I was previously dividing by 100 to get GBP

igloo32 commented 7 months ago

There's a lot to fix in this, I took the opportunity to add some additional colours and rate bands...

I still hate the way the browser refuses to give up using the cached version of javascript cards like this one, always seem to spend most of my time trying to get changes to appear :)

as well as the "start" all "all_rates" changes, the card expects to be dealing in pence whereas the value is now in decimal pounds so needs to be multiplied by 100... this threw me on some of the graphs too where I was previously dividing by 100 to get GBP

If your referencing your own version of the Javascript module you can add a version reference to the url, then you just increment it each time you update your Javascript, i.e. in the URL section do this:

/local/octopus-energy-rates-card.js?v=6

Now if you refresh the page it should force it to reload the new version

deltamelter commented 7 months ago

If your referencing your own version of the Javascript module you can add a version reference to the url, then you just increment it each time you update your Javascript, i.e. in the URL section do this:

/local/octopus-energy-rates-card.js?v=6

Now if you refresh the page it should force it to reload the new version

Oh, that's great, thanks for the tip I will give that a try

Daverover66 commented 7 months ago

"if you wish to keep using the card do not yet upgrade to 9.0 of the integration" Oops.... :-/

Ha, same! =( Something else my wife used and now doesn't work! This is life on the cutting edge. Thanks for all your work guys. Look forward to a fix

Same here. Also looking forward to a fix. This will currently sit as a blank card on my dashboard. Has anyone else noticed that the new event entity also doesn't work in apexcharts?

deltamelter commented 7 months ago

Looks like the card will need reorganising too, because the rates are now split by day. I thought it would just a case of renaming the array and start attribute and scaling to pence, but currently needs multiple cards... image

igloo32 commented 7 months ago

I've got a rough version working with some other bits in, need a bit of time to tidy it up but essentially you need to bring in the other 2 sensors with the past and future rates in and combine them into 1 array. image

LucidityCrash commented 7 months ago

completely unrelated but liking the Gas Tracker bit :)

stevetrease commented 7 months ago

I've just submitted a pull request (#34) for some quick and dirty changes to support v9.0.0 of the HomeAssistant-OctopusEnergy integration.

Essentially it uses event.octopus_energyelectricity{{METER_SERIAL_NUMBER}}{{MPAN_NUMBER}}_current_day_rates rather than the previous entity type.

It only supports one event entity, so if you want to see tomorrow's rates just use a second card with the event.octopus_energyelectricity{{METER_SERIAL_NUMBER}}{{MPAN_NUMBER}}_next_day_rates.

Since v9.0 now works in £ not pence I have changed default medium and high limits to 0.2 and 0.3 and rounding to 3 decimal places to show 1/10p.

It's my first attempt to push code via GitHub, so please be gentle ;-)

igloo32 commented 7 months ago

I've submit a pull request with changes that make this work as before with the 3 new v9 "events" and add optional combine rates/show cheapest/use multiplier functions for display in pence/pounds. To make it work as before you just need to specific the 3 events to get the rates from.

BottlecapDave commented 7 months ago

@igloo32 you need to fork the repo so you have read/write permissions. You then make the changes on your forked version of the repo. You then make a pull request from your repo (with your changes) to go into their repo

igloo32 commented 7 months ago

@igloo32 you need to fork the repo so you have read/write permissions. You then make the changes on your forked version of the repo. You then make a pull request from your repo (with your changes) to go into their repo

Cheers - I switched to VS Code and it actually gave me a useful error message and solution.

DJBenson commented 7 months ago

@igloo32 you need to fork the repo so you have read/write permissions. You then make the changes on your forked version of the repo. You then make a pull request from your repo (with your changes) to go into their repo

Cheers - I switched to VS Code and it actually gave me a useful error message and solution.

Great work! I've switched to your repo for now.

image

Daverover66 commented 7 months ago

@DJBenson

Great work! I've switched to your repo for now.

How have you done that? I copied his forked code, but I can't find where the frontend custom elements are in HA?

DJBenson commented 7 months ago

@DJBenson

Great work! I've switched to your repo for now.

How have you done that? I copied his forked code, but I can't find where the frontend custom elements are in HA?

I removed the existing version using HACS, added his GitHub repo as a custom repo, installed and updated the card config to include the three new entities as per the readme. When the original version gets fixed I'll just do the reverse, remove @igloo32 repo and switch back.

lozzd commented 7 months ago

Thanks so much for the PRs here - I'll try and get this reviewed merged and released asap for all. Thanks again!

RazorClam commented 7 months ago

@DJBenson

Great work! I've switched to your repo for now.

How have you done that? I copied his forked code, but I can't find where the frontend custom elements are in HA?

I removed the existing version using HACS, added his GitHub repo as a custom repo, installed and updated the card config to include the three new entities as per the readme. When the original version gets fixed I'll just do the reverse, remove @igloo32 repo and switch back.

I do not seem to have those 3 entities.... what am i missing? I use the bottlecapdave octopus int

mateuszdrab commented 7 months ago

@DJBenson

Great work! I've switched to your repo for now.

How have you done that? I copied his forked code, but I can't find where the frontend custom elements are in HA?

I removed the existing version using HACS, added his GitHub repo as a custom repo, installed and updated the card config to include the three new entities as per the readme. When the original version gets fixed I'll just do the reverse, remove @igloo32 repo and switch back.

I do not seem to have those 3 entities.... what am i missing? I use the bottlecapdave octopus int

You need to enable them as they're disabled by default in the integration settings

RazorClam commented 7 months ago

@DJBenson

Great work! I've switched to your repo for now.

How have you done that? I copied his forked code, but I can't find where the frontend custom elements are in HA?

I removed the existing version using HACS, added his GitHub repo as a custom repo, installed and updated the card config to include the three new entities as per the readme. When the original version gets fixed I'll just do the reverse, remove @igloo32 repo and switch back.

I do not seem to have those 3 entities.... what am i missing? I use the bottlecapdave octopus int

You need to enable them as they're disabled by default in the integration settings

Perfect, just found that as you replied! Does it take a while to update? For me all 3 events return 'Unkonwn'

corvus2606 commented 7 months ago

@DJBenson

Great work! I've switched to your repo for now.

How have you done that? I copied his forked code, but I can't find where the frontend custom elements are in HA?

I removed the existing version using HACS, added his GitHub repo as a custom repo, installed and updated the card config to include the three new entities as per the readme. When the original version gets fixed I'll just do the reverse, remove @igloo32 repo and switch back.

I do not seem to have those 3 entities.... what am i missing? I use the bottlecapdave octopus int

You need to enable them as they're disabled by default in the integration settings

Perfect, just found that as you replied! Does it take a while to update? For me all 3 events return 'Unkonwn'

They refresh every 30 minutes.

lozzd commented 7 months ago

Thanks again everyone - v0.3.0 has been released now. It's unfortunate those entities are disabled by default - I've mentioned that in the release notes. I think a clarification to the README will be neccessary also. I'm still waiting for mine to start working, reloading the integration isn't enough to trigger the "event" to make the rates load it seems.

RazorClam commented 7 months ago

My card only goes to 10.30 tonight... is that expected behaviour?

lozzd commented 7 months ago

Yes, for now anyway - tomorrow's rates aren't out yet.

(Mine is now working as expected after the event fired)

RazorClam commented 7 months ago

Yes, for now anyway - tomorrow's rates aren't out yet.

(Mine is now working as expected after the event fired)

Perfect, thanks. Everything back to normal then. Thanks to all for getting this back going. It was my most used part of HA =)

lozzd commented 7 months ago

As above, versus 0.3.0 is now out which resolves this.

BottlecapDave commented 7 months ago

As of 9.0.1 the entities should be enabled by default, but I'm not sure if this will apply to people who installed the integration before this release.

lozzd commented 7 months ago

I upgraded from 8.whatever straight to 9.0.1 and they were disabled. I updated the README already to explain how to enable them for now...

Daverover66 commented 7 months ago

Thanks to everyone who contributed to making this work again. Much appreciated!