Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Mikescotland opened this issue Nov 25, 2023 · 10 comments
Closed

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

Mikescotland opened this issue Nov 25, 2023 · 10 comments

Comments

@Mikescotland
Copy link

Mikescotland commented Nov 25, 2023

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_energy_electricity_(xxxx)current_day_rates
futureEntity: event.octopus_energy_electricity
(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
Copy link

andyblac commented Nov 25, 2023

same

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

@Mikescotland
Copy link
Author

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
Copy link

do not have such entities,

Screenshot 2023-11-25 at 13 13 06

@Mikescotland
Copy link
Author

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
Copy link

andyblac commented Nov 25, 2023

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
Copy link

Ashpork commented Nov 25, 2023 via email

@Mikescotland
Copy link
Author

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
Copy link
Contributor

igloo32 commented Nov 25, 2023

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.

@Mikescotland
Copy link
Author

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
Copy link
Owner

lozzd commented Nov 25, 2023

#37 merged, will cut a release

@lozzd lozzd closed this as completed Nov 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants