wfurphy / creative-button-card-templates

Button Card templates for Home Assistant dashboards
MIT License
28 stars 1 forks source link

All templates missing #6

Open cgagliano opened 9 months ago

cgagliano commented 9 months ago

Hello there,

Wanted to bring up an issue I've been having. I've followed your instructions for installation; from a Home Assistant terminal session I've navigated to where the ui-lovelace.yaml is located and cloned this repository. I've also added the following to the top of my ui-lovelace.yaml file: button_card_templates: !include_dir_merge_named creative-button-card-templates/ Each time that I attempt to use one of the templates, I get the same error:

Button-card template 'title' is missing! type: custom:button-card template: title

Any guidance or direction would be greatly appreciated.

Thanks! Carlos

wfurphy commented 8 months ago

Hi Carlos,

Can you please double-check that when you cloned the repository it created the folder creative-button-card-templates/ and that it contains all of the folders and .yaml files?

cgagliano commented 8 months ago

Hey Will,

Thanks for the quick attention. As far as I can see, it did create the folder and it contains all the appropriate files:

Screenshot 2023-10-14 at 12 38 12 PM

Any thoughts?

wfurphy commented 8 months ago

Hrmmmmm I see, just a few more qualifying questions then:

cgagliano commented 8 months ago

Hey Will,

Thanks for your continued attention to this. I'll answer the questions to the best of my ability.

Dashboard code: button_card_templates: picture_button: aspect_ratio: 1/1 color_type: icon hold_action: action: none layout: vertical show_entity_picture: true show_icon: false show_label: false show_name: false show_state: false styles: card:

wfurphy commented 8 months ago

Hi again Carlos,

When you say "The code for each card is in its respective dashboard" do you mean each dashboard has it's own yaml file that is included in ui-lovelace.yaml? Or are you referring to editing the YAML in the Home Assistant UI?

Another thing I noticed is that the first line of your dashboard code is button_card_templates: which is a potential problem as you already specified that in the ui-lovelace.yaml correctly and this may be overriding it or confusing it at least.

wfurphy commented 8 months ago

I had a read over this again and I'm fairly certain the issue is that you are redefining button_card_templates in your dashboard code when you have already defined it, correctly for using these templates, in ui-lovelace.yaml.

If you wish to add your own template picture_button you can add a .yaml file for it in the creative-button-card-templates/custom/ folder.

cgagliano commented 8 months ago

Hi Will,

I think I misunderstood your question about the code for each card. I'm brand new to Home Assistant and YAML in general. It does seem like the code you were asking about is in ui-lovelace.yaml. I'd be happy to provide it (or an excerpt) if it'd help.

I did create a brand new testing dashboard and attempted to create a new custom button card with template "title" and was still greeted with the same "Button-card template 'title' is missing!" error.

I also noticed that if I change the first line on my dashboard to anything else, it breaks the "picture_button" items.

Any hope for this, or should I just burn the whole thing down and start over?

Thanks again for your continued attention to this. It's greatly appreciated.

wfurphy commented 6 months ago

@cgagliano Sorry for the delay on getting back to you here. I just had a look at this with fresh eyes though. Hopefully you still want to try and get it working?

I think I made it a tad confusing because I assumed by the way you asked the question that you are using your dashboards in YAML mode, but I should have asked. Do you have dashboards configured in yaml mode and are editing them in the YAML files or are you editing dashboards within the Home Assistant user interface?

Either way it looks as though you are overriding the button_card_templates: property which is set in ui-lovelace.yaml with the one you are setting in the dashboard code you posted above. You can't set this twice. So solutions are:

Sorry I didn't pick this up first time round - if you are able to enclose any code you post in a code block (surrounded by three (3) backticks) that would be a massive help moving forward. I'm precious and can't read the code properly without syntax highlighting and formatting, haha.

Hope this isn't too late and helps you to solve the issue.

cgagliano commented 5 months ago

Hi @wfurphy! Thanks so much for the continued attention to this. And no worries! I understand that we all get busy. In fact, I'm kinda going through it right now. I haven't had a chance to fully review your last message, but I'll take some time this week and I'll keep you posted.

Thanks again!