Coder Social home page Coder Social logo

Comments (32)

igloo32 avatar igloo32 commented on June 18, 2024 8

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

from octopus-energy-rates-card.

stevetrease avatar stevetrease commented on June 18, 2024 5

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_energy_electricity_{{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_energy_electricity_{{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 ;-)

from octopus-energy-rates-card.

igloo32 avatar igloo32 commented on June 18, 2024 1

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

from octopus-energy-rates-card.

LucidityCrash avatar LucidityCrash commented on June 18, 2024 1

completely unrelated but liking the Gas Tracker bit :)

from octopus-energy-rates-card.

igloo32 avatar igloo32 commented on June 18, 2024 1

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.

from octopus-energy-rates-card.

DJBenson avatar DJBenson commented on June 18, 2024 1

@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.

from octopus-energy-rates-card.

lozzd avatar lozzd commented on June 18, 2024 1

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

from octopus-energy-rates-card.

lozzd avatar lozzd commented on June 18, 2024

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?)

from octopus-energy-rates-card.

lozzd avatar lozzd commented on June 18, 2024

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

from octopus-energy-rates-card.

lozzd avatar lozzd commented on June 18, 2024

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

from octopus-energy-rates-card.

steve-prentice avatar steve-prentice commented on June 18, 2024

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

Oops.... :-/

from octopus-energy-rates-card.

RazorClam avatar RazorClam commented on June 18, 2024

"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

from octopus-energy-rates-card.

deltamelter avatar deltamelter commented on June 18, 2024

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

from octopus-energy-rates-card.

deltamelter avatar deltamelter commented on June 18, 2024

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

from octopus-energy-rates-card.

Daverover66 avatar Daverover66 commented on June 18, 2024

"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?

from octopus-energy-rates-card.

deltamelter avatar deltamelter commented on June 18, 2024

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

from octopus-energy-rates-card.

BottlecapDave avatar BottlecapDave commented on June 18, 2024

@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

from octopus-energy-rates-card.

igloo32 avatar igloo32 commented on June 18, 2024

@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.

from octopus-energy-rates-card.

DJBenson avatar DJBenson commented on June 18, 2024

@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

from octopus-energy-rates-card.

Daverover66 avatar Daverover66 commented on June 18, 2024

@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?

from octopus-energy-rates-card.

RazorClam avatar RazorClam commented on June 18, 2024

@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

from octopus-energy-rates-card.

mateuszdrab avatar mateuszdrab commented on June 18, 2024

@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

from octopus-energy-rates-card.

RazorClam avatar RazorClam commented on June 18, 2024

@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'

from octopus-energy-rates-card.

corvus2606 avatar corvus2606 commented on June 18, 2024

@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.

from octopus-energy-rates-card.

lozzd avatar lozzd commented on June 18, 2024

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.

from octopus-energy-rates-card.

RazorClam avatar RazorClam commented on June 18, 2024

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

from octopus-energy-rates-card.

lozzd avatar lozzd commented on June 18, 2024

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

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

from octopus-energy-rates-card.

RazorClam avatar RazorClam commented on June 18, 2024

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 =)

from octopus-energy-rates-card.

lozzd avatar lozzd commented on June 18, 2024

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

from octopus-energy-rates-card.

BottlecapDave avatar BottlecapDave commented on June 18, 2024

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.

from octopus-energy-rates-card.

lozzd avatar lozzd commented on June 18, 2024

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...

from octopus-energy-rates-card.

Daverover66 avatar Daverover66 commented on June 18, 2024

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

from octopus-energy-rates-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.