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

Conditional User Issue with Weather Chart Card in Home Assistant #260

Open
cloudbr34k84 opened this issue Oct 18, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@cloudbr34k84
Copy link

cloudbr34k84 commented Oct 18, 2024

Description:

When adding a user-based visibility condition card to my Lovelace dashboard, I encountered multiple errors related to the weather-chart-card. The card fails to load properly, causing glitches, and the preview pane in the editor does not display anything. The errors occur on both Chrome WebView (Android) and Chrome (Windows), and seem to be caused by missing or undefined functions in the custom card's JavaScript.

Environment:

Home Assistant Version: 2024.10
Browser:
Chrome WebView 126.0.6478.186 (Android 14)
Chrome 129.0.0.0 (Windows 10)
weather-chart-card Version: V2.4.11

### Steps to Reproduce:
Add the weather-chart-card to a Lovelace dashboard.
Add a visibility condition card based on user to control when the weather-chart-card is shown.
Edit the card; observe the preview pane on the right.
Open the dashboard on Android or Windows devices using Chrome WebView or Chrome.

Expected Behavior:

The weather-chart-card should load and display weather-related charts without any errors. The preview pane should function normally when editing the card.

Actual Behavior:

The preview pane in the editor is blank, and the card glitches out during the editing process.
The card fails to load properly when the dashboard is viewed, resulting in multiple console errors.

Error Messages:

Logger: frontend.js.modern.202410023
Source: components/system_log/__init__.py:331
First occurred: 10:59:43 (4 occurrences)
Last logged: 12:16:18

Uncaught error from Chrome WebView 126.0.6478.186 on Android 14 
ReferenceError: drawChartOncePerHour is not defined 
/hacsfiles/weather-chart-card/weather-chart-card.js:18218:7

Uncaught error from Chrome WebView 126.0.6478.186 on Android 14 
Script error. null @:0:0

Uncaught error from Chrome 129.0.0.0 on Windows 10 
TypeError: Cannot read properties of undefined (reading 'state') 
set hass (/hacsfiles/weather-chart-card/weather-chart-card.js:17931:84)
createCardElement (src/panels/lovelace/cards/hui-card.ts:99:27) 
ev.stopPropagation (src/panels/lovelace/cards/hui-card.ts:125:13) 
dispatchEvent (src/common/dom/fire_event.ts:76:7) 
tag.includes (src/panels/lovelace/create-element/create-element-base.ts:198:14)

Troubleshooting Steps Taken:

  1. Cleared browser cache and tested in incognito mode.
  2. Verified the configuration of the weather-chart-card to ensure all required entities are provided.
  3. Disabled the visibility condition card, which temporarily resolves the error.

### Additional Context:

  • The error appears to be related to the drawChartOncePerHour function being undefined in the JavaScript of the weather-chart-card.
  • The issue is most prominent when using a user-based visibility condition.
  • The card preview fails to load in the editor, making it difficult to make changes without applying and reloading the dashboard.
  • The card works when the visibility condition is removed, suggesting an incompatibility between the custom card and the visibility condition feature.
@cloudbr34k84 cloudbr34k84 added the bug Something isn't working label Oct 18, 2024
@cloudbr34k84 cloudbr34k84 changed the title Compatibility Issue with Weather Chart Card in Home Assistant Conditional User Issue with Weather Chart Card in Home Assistant Oct 18, 2024
@chrisannen
Copy link

Same issue here. Without visibility the card is shown:

image

With an visibility, the card is not shown:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants