andrey-git / home-assistant-custom-ui

Custom UI elements for https://home-assistant.io
https://home-assistant.io
MIT License
526 stars 97 forks source link

HA 0.70.0 and CustomUI 20180521 issues #134

Closed Scaryman closed 6 years ago

Scaryman commented 6 years ago

Checklist

Browser + Version: Chrome 66.0.3359.181

CustomUI version: 20180521

Home Assistant release (hass --version): 0.70.0

Problem-relevant configuration.yaml entries:

homeassistant:
  customize_glob:
    "*.*":
      custom_ui_state_card: state-card-custom-ui

  customize: !include customize.yaml

customizer:
  custom_ui: local

Problem-relevant Home Assistant log entries:

2018-05-28 20:40:59 ERROR (MainThread) [frontend.js.latest.201805264] :0:0 Script error.
2018-05-28 20:41:00 ERROR (MainThread) [frontend.js.latest.201805264] :0:0 Script error.
2018-05-28 20:42:34 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:12032 Uncaught TypeError: Cannot read property 'EventsMixin' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:15227 Uncaught ReferenceError: StateCardDisplay is not defined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:21460 Uncaught TypeError: Polymer.mixinBehaviors is not a function
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:28132 Uncaught TypeError: Cannot read property 'computeDomain' of undefined
2018-05-28 20:42:35 ERROR (MainThread) [frontend.js.latest.201805264] http://10.8.0.5:8123/local/custom_ui/state-card-custom-ui.html:1:6409 Uncaught TypeError: Cannot read property 'LOGIC_STATE_ATTRIBUTES' of undefined

Any errors from browser Javascript console:

Loaded CustomUI 20180521
(index):1 Uncaught (in promise) DOMException: Only secure origins are allowed (see: https://goo.gl/Y0ZkNV).
(anonymous) @ (index):1
load (async)
(anonymous) @ (index):1

I have problems after updating HA to 0.70.0 and CustomUI to 20180521. Each time i updated HA homepage, errors are added to the log.

On my phone, the HA opens only if in config i specify "custom_ui: debug", otherwise all groups are empty.

photo_2018-05-28_21-21-09

And another bug. In cards where i use CustomUI i have this trash:

screenshot_10

Sorry for my english =)

andrey-git commented 6 years ago

This looks caching issue - try to clear browser cache.

Scaryman commented 6 years ago

It does not help. I tried on two different computers with chrome. I also tried to open a site in the Edge, result the same.

andrey-git commented 6 years ago

Try with

customizer:
  custom_ui: hosted

If that works it means your downloaded files are corrupted.

Scaryman commented 6 years ago

Try with

customizer: custom_ui: hosted If that works it means your downloaded files are corrupted.

I have this error:

Access to Imported resource at 'https://github.com/andrey-git/home-assistant-custom-ui/releases/download/global/state-card-custom-ui.html' from origin 'http://10.8.0.5:8123' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://10.8.0.5:8123' is therefore not allowed access. The response had HTTP status code 404.

And now with debug key i have the same error

Scaryman commented 6 years ago

I tried to delet all filese from www and custom_components. Then i ran ./update.sh, it downloaded all files. Changed custom_ui to local. But it didn't help

cjsmns commented 6 years ago

I was having the exact same issue. I tried everything and then came here and noticed this issue and saw @andrey-git mentioned it might be a cache issue. I'm also using the same version of Chrome, so I went into the Developer Tools > Application Tab > Clear storage and then clicked on Clear site data. Logged back into HA and its working fine.

cjsmns commented 6 years ago

And the blank cards have returned. Seems that clearing the cache is only a temporary solution.

morestart commented 6 years ago


/local/custom_ui/state-card-custom-ui-es5.html:1:20601 Uncaught ReferenceError: StateCardDisplay is not defined

/local/custom_ui/state-card-custom-ui-es5.html:1:13618 Uncaught TypeError: Cannot read property 'EventsMixin' of undefined

/local/custom_ui/state-card-custom-ui-es5.html:1:6579 Uncaught TypeError: Cannot read property 'LOGIC_STATE_ATTRIBUTES' of undefined```

what's wrong??
andrey-git commented 6 years ago

If you look at state-card-custom-ui-es5.html you will see that it doesn't contain the text StateCardDisplay and EventsMixin which where used in 20180427.

So this is a caching issue.

morestart commented 6 years ago

@andrey-git yeah,it's ok

Scaryman commented 6 years ago

Ok, after all cache cleanups, i have one error left:

2018-05-29 09:28:27 ERROR (MainThread) [frontend.js.latest.201805264] :0:0 Script error.
2018-05-29 09:28:27 ERROR (MainThread) [frontend.js.latest.201805264] :0:0 Script error.
2018-05-29 09:33:11 ERROR (MainThread) [frontend.js.latest.201805264] :0:0 Script error.
2018-05-29 09:33:11 ERROR (MainThread) [frontend.js.latest.201805264] :0:0 Script error.

And still have issues in cards with CustomUI screenshot_135

andrey-git commented 6 years ago

I suspect you have an error in one of your templates. Try to remove them one by one.

Scaryman commented 6 years ago

I created new config folder for test. But the issue remained.

My test configuration file:

homeassistant:
  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 54.2021
  longitude: 37.6443
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 0
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/Moscow

  customize_glob:
    "*.*":
      custom_ui_state_card: state-card-custom-ui

  # Customization file
  customize: !include customize.yaml

customizer:
  custom_ui: local

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:

# Enables configuration UI
config:

http:

updater:

discovery:

conversation:

history:

logbook:

map:

sun:

sensor:
  - platform: yr

tts:
  - platform: google

cloud:

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

My customize file:

switch.Plug_158d000122b4d9:
  friendly_name: Switcher
  extra_data_template: >
    Test: ${attributes.power_consumed}W

It's working on main screen:

screenshot_136

But not in card:

screenshot_137

andrey-git commented 6 years ago

This is working as intended. The more-info window is generally not affected by CustomUI.

Scaryman commented 6 years ago

I downgraded my HA to 0.68.1. CustomUI version 20180528. And issue in more-info window disappeared: screenshot_138

Then i updated my HA to 0.70.0 and issue returned: screenshot_139

andrey-git commented 6 years ago

Oh, now I understand what you mean. Unfortunately since 0.70 the previous way of hiding attributes in more-info doesn't work. I'm looking for a workaround.