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

Cannot read properties of undefined (reading 'attributes') #36

Closed Mikescotland closed 7 months ago

Mikescotland commented 7 months ago

After upgrading both, integration and the card, enabling events I've got this error. Here's yaml

type: custom:octopus-energy-rates-card cols: 2 currentEntity: event.octopus_energyelectricity(xxxx)_current_day_rates futureEntity: event.octopus_energyelectricity(xxx)_next_day_rates showday: true showpast: false hour12: false highlimit: 28.1 unitstr: p roundUnits: 1 title: 🔌 Rates (normal = 28.3p)

Github slightly formatted the underline in the entity names, in original it's correct.

andyblac commented 7 months ago

same

type: custom:octopus-energy-rates-card
currentEntity: sensor.octopus_energy_electricity_xxxxxx_xxxxx_current_rate
cols: 2
showday: true
showpast: false
Mikescotland commented 7 months ago

same

type: custom:octopus-energy-rates-card
currentEntity: sensor.octopus_energy_electricity_xxxxxx_xxxxx_current_rate
cols: 2
showday: true
showpast: false

Switch entity to event.xxx as per readme (activate them if not active)

andyblac commented 7 months ago

do not have such entities,

Screenshot 2023-11-25 at 13 13 06
Mikescotland commented 7 months ago

Did you upgrade the octopus integration (not card) to version 0.9.x? Please read the readme, there is clear instruction.

My case is different as I have these events and card is configured. Still throws an error

andyblac commented 7 months ago

Did you upgrade the octopus integration (not card) to version 0.9.x? Please read the readme, there is clear instruction.

My case is different as I have these events and card is configured. Still throws an error

yes been running 9.0.x for a while now.

Ashpork commented 7 months ago

Have you enabled those event entities? That message is usually shown when they're not enabled.

On Sat, 25 Nov 2023 at 13:15, Andrew Blackburn @.***> wrote:

Did you upgrade the octopus integration (not card) to version 0.9.x? Please read the readme, there is clear instruction.

My case is different as I have these events and card is configured. Still throws an error yes been running 9.0.x for a while now.

— Reply to this email directly, view it on GitHub https://github.com/lozzd/octopus-energy-rates-card/issues/36#issuecomment-1826305275, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ3KT4IJ3IJQEBRUORUABLDYGHVOTAVCNFSM6AAAAAA72CFPTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWGMYDKMRXGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Mikescotland commented 7 months ago

Have you enabled those event entities? That message is usually shown when they're not enabled. … On Sat, 25 Nov 2023 at 13:15, Andrew Blackburn @.> wrote: Did you upgrade the octopus integration (not card) to version 0.9.x? Please read the readme, there is clear instruction. My case is different as I have these events and card is configured. Still throws an error yes been running 9.0.x for a while now. — Reply to this email directly, view it on GitHub <#36 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQ3KT4IJ3IJQEBRUORUABLDYGHVOTAVCNFSM6AAAAAA72CFPTKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWGMYDKMRXGU . You are receiving this because you are subscribed to this thread.Message ID: @.> Screenshot_20231125_133629

igloo32 commented 7 months ago

I suspect the issue is the current version of the card expects past/future entities to be provided even though it doesn't require them. I've just submitted a fix https://github.com/lozzd/octopus-energy-rates-card/pull/37 to ensure they are optional. To fix in the mean time you can just provide them in the config.

Mikescotland commented 7 months ago

I suspect the issue is the current version of the card expects past/future entities to be provided even though it doesn't require them. I've just submitted a fix #37 to ensure they are optional. To fix in the mean time you can just provide them in the config.

You're a life saver. Didn't cross my mind I have to provide all three events as the documentation table says optional for previous and next. Now working. Thank you very much!

So, in order to have it working you need to specify all three, currentEntity, pastEntity and futureEntity - info for people struggling with it.

lozzd commented 7 months ago

37 merged, will cut a release