-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Templating in the future? #35
Comments
id like to add a +1 to the request, and give an example of what I would love to be able to do:
it would be all needed, no further extra custom cards, not even the templater card. It would automatically create 24 + switches like this: (now made with a decluttering template and as many configs as switches.Fyi, This would take all switches in my config in the form of switch.sw_boiler_bijkeuken_template, and have the sensors sensor.boiler_bijkeuken_actueel, and sensor.boiler_bijkeuken_totaal, as multiple entities. the template format in my example is but a suggestion of sorts, hope it is clear for the purpose. this is the jinja template:
but it could be in JS too of course. We might be able to get close using the template-entity-row card, though I dont think it allows for the very nice multiple-entity you provide ;-) tbh, I wouldn't even know where to start using the config template card used by @SeLLeRoNe |
I actually got confused and I provided the wrong response, those variables are taken directly from the Decluttering Card (https://github.com/custom-cards/decluttering-card) If you use decluttering-card already you just need to send variables: What you can do is a template with decluttering-card for a standard switch (as per your example above) and then a decluttering-card template which call, for each sensor, the decluttering-card again passing as variable the entity to use. Not really sure if the [10:-9] would work there, if it does, you don't need much more than the decluttering-card existing variables function. As an example, this is how I generate the "energy view" on each room:
Basically I call each power monitor device using the decluttering card templates I have ready, sending the two only variables I need to change (this way, if I have a new device, I simply add it here). So, for now you don't really need templating if you're using the decluttering-card, the only thing I am not sure is the range of numbers [10:-9], the rest it's fairly easy. Please let me know if that's not clear enough and I can provide you maybe a few examples on your config. Andrea |
Im using something like that:
with a decluttering card:
my hope was to compact all that to the one config above, if multiple-entity-row would support templating. and no decluttering only supports strings, no templates of any kind. Did wager a FR with Thomas, but it wasn't accepted (I think) |
Hello, thank you for valuable card. I like it and I also appreciated templating posibility, especially to set icon in dependency on the state or attribute. |
HI @benct Ben, was this a no, or could we temp you to support templates in the fields. It would truly make this a much more versatile and prominent card... Appreciate your stance to keep the card as independent as possible. Still, have my hopes up for this fundamental piece of support for templating, especially since introducing card-templater or config-template-card would be even more of a complicating factor, relying on external custom cards, on cooperation with the auto entities. Tried that but couldn't get it to work just yet.. maybe not even possible thanks for considering anyways! |
I can try to add some sort of fundamental templating support in the next release. |
great, that would be really awesome! |
Any updates? I need to use area and last_changed in local language in my secondary info field using auto-entities card. Since there’s no area attribute, I have to use template with area_name() call. Would be great if secondary_info value could be a template string. |
Just here to ask for this as well. Would like to set the value of secondary_info in the way I want/need via template |
Loving the card, but really craving some templating! I've seen others using
card-tools
to interpret the template for arbitrary config keys - would it be possible to add something like this in the near future?The text was updated successfully, but these errors were encountered: