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

**Custom element doesn't exist: aarlo-glance** via Google Cast to Nest Displays #172

Open
MankiniChykan opened this issue Feb 15, 2025 · 4 comments

Comments

@MankiniChykan
Copy link

MankiniChykan commented Feb 15, 2025

I have the Card working perfectly on all devices except my Nest Hubs.

Get a Custom element doesn't exist: aarlo-glance

I have tried manually adding resources but still does not work

  • /local/aarlo-glance.js
  • /hacsfiles/lovelace-hass-aarlo/hass-aarlo.js
  • /hacsfiles/lovelace-hass-aarlo/hass-aarlo.js?hacstag=1972451790261

Is there a slight naming issue here? aarlo-glance vs hass-aarlo;
or is this a limitation of google cast devices?

Also the below error shows.

Logger: frontend.js.modern.202502140
Source: components/system_log/init.py:331
First occurred: 00:22:03 (2 occurrences)
Last logged: 00:22:12

Uncaught error from Chrome 130.0.0.0 on Chromecast Fuchsia 1.56.500000 TypeError: Cannot convert undefined or null to object /hacsfiles/lovelace-hass-aarlo/hass-aarlo.js:38:27

@rainieryoung
Copy link
Contributor

I don't have a direct solution for you, but I can say that I do have aarlo working with Google Cast devices, specifically the custom:aarlo-glance card.

My devices are primarily chrome-casts (hdmi device to a TV), but I do recall having it load on my Google Home (first gen display device, prior to any rebranding to Nest). I'm unsure if there is a nuance with Nest devices / later models.

A while back I did find/resolve an issue related to the thumbnail, the issue write-up is here: #129 and the PR that fixed it is linked.

You may have already located this troubleshooting note, but juts in case: https://github.com/twrecked/lovelace-hass-aarlo/blob/master/hacsinstall.md#troubleshooting

@rainieryoung
Copy link
Contributor

Uncaught error from Chrome 130.0.0.0 on Chromecast Fuchsia 1.56.500000 TypeError: Cannot convert undefined or null to object /hacsfiles/lovelace-hass-aarlo/hass-aarlo.js:38:27

I'm not familiar with the error message syntax, but it does appear 38:27 is a line reference. If that's true, it would indicate its finding hass-aarlo.js but failing due to a null value when its not expected.

@MankiniChykan
Copy link
Author

Which *.js module do you have loaded up in your dashboard resources?

I have Second Generation Google Hubs, Pixel Hub and Google Max displays. None seem to work with the aarlo-glance card.

Through experimentation, I found the work-around a few years back to display the thumbnail image on my Google Hubs using picture glance cards.
I am also able to cast video streams to the hubs.

Wish this card would work so I could go through the history thumbnails on my hubs.

@MankiniChykan
Copy link
Author

MankiniChykan commented Feb 18, 2025

I run this through MS Copilot AI. It come up with the following.

_real function: Ensured that it checks if a value is neither undefined nor null:

javascript
function _real(value) {
return value !== undefined && value !== null;
}
_array function: Added a check using _real to return the default value if config is undefined or null. Also, improved the type checks for config:

javascript
function _array(config, value = []) {
if (!_real(config)) {
return value;
}
if (typeof config === "string") {
return config.includes("|") ? config.split("|") : config.split(",");
}
if (typeof config === "number") {
return [config];
}
return config;
}
Helper functions: Added the _real check to other helper functions to handle undefined or null values more robustly:

javascript
function _value(config, value = null) {
return _real(config) ? config : value;
}

function _value_int(config, value = 0) {
return parseInt(_value(config, value));
}

function _value_float(config, value = 0) {
return parseFloat(_value(config, value));
}

function _includes(config, item, value = false) {
return _real(config) ? config.includes(item) : value;
}
_replaceAll function: Kept the original logic but ensured it is clear and concise:

javascript
function _replaceAll(old_string, from, to) {
while (true) {
const new_string = old_string.replace(from, to);
if (new_string === old_string) {
return new_string;
}
old_string = new_string;
}
}
These changes should help avoid the TypeError you encountered by ensuring that all functions handle undefined or null values gracefully. If you need any further help or have more questions, feel free to ask!

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

2 participants