with the auto-entities card i like a list of temperature devices whose battery_level is below 60%
this works, but my friendly names are composed like temperatuur batterijniveau tuin (translate temperature battery_level garden). I want to strip the temperatuur batterijniveau part, its in all of the names, so a bit redundant.
I tried several options with the options setting but so far no luck, all i tried to put in is taken literally and displayed as name so no name regex replace possibility so far as I can see. anybody out here with a solution?
Thanks for the hint, will try the template and template-entity-row option, and Marius sorry to say but your educational example way to complicated, way to steep for a beginner to even get a glance of whats its doing in relation to my question, thanks for letting me know what the possibilities are but in no way Iam at your level, just scratching the surface here
You are absolutely right, but I see it as, I asked to teach me how to ride a bike, and the example put me in a space shuttle, overwhelmed, and going stripping till I get the results I want not gonne cut it starting with the whole
style: |
:host {
thing, no mention of it in the custom:template-entity-row documentation, even google has no answer on the search home assistant :host
So, good example yes, but not for beginners, sorry…
basically what this does, is use the auto-entities card, set it to display entities in an entities card, which it should get from the entities in the group. (if you want, you can also use the other options of auto-entities, but the group is very easy)
It should do that, using the specified options. In this case I suggested the template-entity-row, with which you can set anything (state, icon, name etc etc, see the options there) with a template.
for that you use the config.entity (you dont hard code any entities, since this is created automatically) and the templates are for that entity. Depending on your naming, you should adjust the template.
Dont quote config.entity in those templates, since it is a system variable, and not a string.
What is your naming convention in the sensors?
Thanks for the clarification, I tried the stripped example form Ildar_Gabdullin, tried to modify it, bit no luck.
as said, Just scratching the surface here, the problem is that it is a huuuuge surface
My naming convention is straight forward:
sensortype.TypeOfDevice_property_zone
example, in dutch
sensor.deur_batterijniveau_keuken (translate sensor.door_batterylevel_kitchen)
and another example of a temperature/humidity/pressure device
As you can see I left out the split part batterijniveau_ I had another underscore following in 2 of my sensors namely Lcd_ So I came up with the split to use only the underscore and the [-1] part, show only the last split and it works. as a bonus I added the secondary info, although this was a little bit different in format as you can see than the regular config.entity.atrributes…
An here the result:
Ofcourse the cutoff value has to be set about 20% or so, for this example it was set to 101% show all…
Regards and thanks.
Frank
Did someone now if you can set a fix height to the auto-entities card?
I have is a glance card that is sometimes empty (that’s good),
I have the “show_empty:” on true,
But when the card is empty, the height of the card is not the same height else when there are entities in it.
stuck really, editing an older card of mine, which wont show the geo_location entities anymore…
filter:
template: |
{% set km = states('input_number.quakes_near')|float %}
{% set location = states('input_select.quakes_near') %}
{% for s in states.geo_location|selectattr('attributes.source','eq','usgs_earthquakes_feed') %}
{% if distance(s.entity_id,location) < km %}
{{- s.entity_id -}}
{% endif %}
{% endfor %}
gives me the error:
Either entities or geo_location_sources must be specified
the geo_location entity is live, and the the template is correct:
template: >
{%- set ns = namespace(quakes_near=[]) %}
{% set km = states('input_number.quakes_near')|float %}
{% set location = states('input_select.quakes_near') %}
{% for s in states.geo_location|selectattr('attributes.source','eq','usgs_earthquakes_feed')
if distance(s.entity_id,location) < km %}
{% set ns.quakes_near = ns.quakes_near + s.entity_id %}
{% endfor %}
{{ns.quakes_near}}
though I believed the other template to also create a true list because the empty list showed as [] in the editor, it probably doesn’t… this should be correct., only thing is I can not really test it, because there’s no quakes near at the moment