UI in yaml mode

Mmm, strange but why is this configuration.yaml code, throwing an error in the log:-

lovelace:
  mode: yaml
  resources:
    - url: /local/simple-thermostat.js?v=1
      type: module
Mar 22 21:53:06 pi hass[28675]: 2020-03-22 21:53:06 ERROR (MainThread) [homeassistant.config] Invalid config for [lovelace]: [resources] is an invalid option for [lovelace]. Check: lovelace->lovelace->resources. (See /home/homeassistant/.homeassistant/configuration.yaml, line 6). Please check the docs at https://www.home-assistant.io/integrations/lovelace
Mar 22 21:53:06 pi hass[28675]: 2020-03-22 21:53:06 ERROR (MainThread) [homeassistant.setup] Setup failed for lovelace: Invalid config.

Seems valid when reading this:

Also, is the /local/ reference, a ref to www in HA config dir (which for me is /home/homeassistant/.homeassistant/www) where my simple-thermostat.js resides?

TIA

If you add it to /www/ folder you have to type /local/

thanks for the reply,
yep, that is where I added it, but it throws that error

I am confused here.

I added the .js into the www directory which is in the same directory as my configuration.yaml
I changed my configuration.yaml to:

lovelace:
  mode: yaml

then I created the ui-lovelace.yaml which contains:



title: KEATS
views:
    cards:
      - type: "custom:simple-thermostat"
        entity: climate.lounge
        step_size: 1
            icon: mdi:whitewalker
    path: mobile
    title: Mobile

but the card isnt shown and I get a red box on the UI:

Custom element doesn't exist: simple-thermostat.

Fixed.

resources: goes in the ui-lovelace.yaml file at the top

That is only true if you are using v106 or earlier.

The location of the resources has changed starting in v107. They will now be added to the lovelace: section of configuration.yaml as you originally had it.

If you update be prepared for things not to work again until you fix it.

Ah - ok.
I wish the devs would not break previous working functionality - it’s a rather frustrating “upgrade” feature. If that’s going to happen, then - as indeed we do in our software house - provide an upgrade tool , or better , resolve obsolescence as part of the upgrade.
But then again, it is FOSS .

@finity: I have the same erro.
Please can you explain this “They will now be added to the lovelace: section of configuration.yaml as you originally had it.”
Thanks

The OP had moved their “resources:” section to the “lovelace:” section of the configuration.yaml. Like this:

lovelace:
  mode: yaml
  resources:
    - url: /local/simple-thermostat.js?v=1
      type: module

the person i was responding to said the resources section needed to be in the ui-lovelace.yaml file. but i clarified that was only true on HA version 106 and earlier. In v107 the location changed to the location noted above.

Tks now it’s clair.

@finity is spot on correct.