Closed shlomki closed 1 year ago
its simple: button-card uses javascript, not jinja. so forget about those custom_templates.
as for system wide templates in button-card: we've had those since forever through configuration templates.
please close the issue @shlomki
Home Assistant 2023.4 adds new functionality for reusing jinja templates by writing macros: https://www.home-assistant.io/docs/configuration/templating/#reusing-templates
However, I wasn't able to use this functionality in button-card.
I've tried adding the macro in the example to HA, and by writing the following button card code (though I'm not sure the syntax is correct here):
But got the following error:
it seems that the problem is with javascript and how it tries to import modules and not macros. It would be really nice to be able to use macros in button-card, do you think you would be able to add support for it? Would gladly help in any way I can.
Is your feature request related to a problem? Please describe. Described above.
Describe the solution you'd like Be able to use macros in some way in button-card templates.
Describe alternatives you've considered Writing the same template over and over again every time it needs to be used.