Split config - Simple card - issues - switch layout

Show everything that you have regarding this custom:button-card.

  • file in the directory structure
  • entry in the resources
  • your configuration.yaml file

What do you mean by rss?

Ok so to clarify.

downloaded the js from: Release v4.1.2 · custom-cards/button-card · GitHub
i tried to place it (upload it to the following dir) under:

/www/button-card.js
/www/community/button-card.js
/www/community/lovelace-button/button-card.js

The code that im trying to run is:

type: custom:button-card
entity: sensor.test_sensor
name: "test"
state: "1234"
show_name: true
show_state: true
styles:
  card:
    - padding: 2px
    - background-color: white
  icon:
    - color: red
    - width: 50px
    - height: 50px
  name:
    - color: blue
  state:
    - color: green
icon: "mdi:home"  # PNG check for later! It should work.......... i think 

my config file contains:

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  extra_module_url:
    - /local/card-mod.js
    - /local/button-card.js
    
  themes: !include_dir_merge_named themes
  

# Set Lovelace to YAML mode (this will load ui-lovelace.yaml)
#lovelace:
  #mode: yaml

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

Everytime after changing and trying new location, i add the rss (resources) in the dashboard where i plan to use them.

And the step by step action im doing is:
upload js file to ANY location (i tried all)
go to dashboard and add the resource to where i plan to use it
restart HA
logout HA
clear cache/cookies from browser
close browser
open browser
login into HA
confirm the resource is still showing on the dashboard
add new card
select manual type
input the yaml code
get error message

this is the last 2 i tried

and HA auto selects javascript as Resource type

Miguel, just do as I wrote before

Good morning,
New error :smiley:

This is because it cannot find the right file (button-card.js) at the right location, being the file

  • is not at the place you tell your system
  • it’s not the right one
  • isn’t found by your browser

Do you block anything with an add-on in your browser?

It’s really simple:

  • you put the custom file on your system
  • you tell your system the location of that file

Comment/or remove this whole section from your config file:

# Load frontend themes from the themes folder
frontend:
  extra_module_url:
    - /local/card-mod.js
    - /local/button-card.js
    
  themes: !include_dir_merge_named themes

This is another example of installing a custom card
Manual

  1. Download slider-button-card.js file from the latest-release.
  2. Put slider-button-card.js file into your config/www folder.
  3. Go to ConfigurationLovelace DashboardsResources → Click Plus button → Set Url as /local/slider-button-card.js → Set Resource type as JavaScript Module.
  4. Add custom:slider-button-card to Lovelace UI as any other card (using either editor or YAML configuration).

Hello Nick, easier way to check my steps.

https://youtu.be/H8rHwEVd8oc - HA “murdering” the CPU since update

https://youtu.be/DWOZRh7WPLU - a 7min long video showing all steps
New error generated…

Can you try with a newly created custom button with the bare minimum?

@Nick4 https://youtu.be/bsPQE4oU_Oc :scream_cat:

So finally it works! :sparkler:

f… yes!
now i’ve done this before twice! why didnt it work??

Plus the code i wa susing in the first place, is it wrong??
I see no yaml errors

You know that the same input gives the same result so something must have been wrong.

Which code in which first place?
You mean the one from post #25?

this one:

type: custom:button-card
entity: sensor.test_sensor
name: "test"
state: "1234"
show_name: true
show_state: true
styles:
  card:
    - padding: 2px
    - background-color: white
  icon:
    - color: red
    - width: 50px
    - height: 50px
  name:
    - color: blue
  state:
    - color: green
icon: "mdi:home"  # PNG check for later! It should work.......... i think 

No idea, there must be some error but at least you know that the foundation is correct now so you can chase what is wrong in the config of that card.