Custom Tile
With the help of AI, I’ve created a custom tile that integrates with my Hubitat hub through ST. The dashboard shows metrics calculated from movement & door opening patterns but has several rendering issues. Specifically, my tile incorporates Chart.js for visualization & TensorFlow.js for pattern analysis. I continue to see empty containers where charts should appear & I suspect both libraries might be having timeout, loading & initialization problems within ST. The tile is meant to update in response to Hubitat Global Variable event changes from custom Rule Machine rules built to calculate metrics & update those variables based upon trigger events occurring under specific conditions.
Tabbing Function
My tile features a tab-based navigation system to switch between views, but the tab switching functionality fails to work properly. Clicking the tab buttons registers events (confirmed via console logs), but doesn’t successfully toggle the visibility of the corresponding content sections as expected. Each view contains individual cards with graphs/charts & tooltips, but the content areas remain in their initial state regardless of which tab is selected.
Connecting to Hubitat
Hubitat integration seems intermittent. I’m using the Hubitat Maker API app & created additional tile config. settiings with properly configured access token & Maker API base URL for accessing GLOBAL hub variables used in my Hubitat rules. Perhaps there a limit to how many variables can be retrieved in one request?
Maker API Cloud URL used for accessing Hub global variables:
[https://cloud.hubitat.com/api/[Hub](https://cloud.hubitat.com/api/[Hub) ID]/apps/[Maker AI App ID]/globalVariables?access_token=[Maker API Key]
Misc:
The HTML elements exist in the DOM & have the correct IDs (as far as I now), but the charts never appear. Instead, I see “Loading…” Does ST impose restrictions on certain JavaScript libraries for security reasons? Are there specific initialization sequences needed for complex libraries in the ST environment?
I’m seeking guidance on:
- How ST manages loading external libraries like Chart.js& TensorFlow.js in custom tiles successfully
- Best practices for implementing tab switching within custom dashboards
- Recommendations for ensuring smooth integration between ST & Hubitat (via Maker API).
- Tips for diagnosing rendering issues in ST custom tiles &/or guidance on how custom UI controls should be implemented within ST to ensure proper event handling.
I can provide HTML wrapper & JS code snippets for further root/cause analysis by those far more skilled at coding than myself. Just tell me what you need
I’d prefer to solve these issues without completely rebuilding my dashboard as its quite large as a standalone monolithic file.