Testing in developer tools shows the first returns an array, the second does not. So for second you could try…
[
{% for state in states.input_datetime %}
{{ {'entity': state.entity_id, 'type': "button" } }},
{% endfor %}
]
template-entity-row actions are templatable, but you need to return an object for the main action config, being tap_action for what you are after. See doco for more.
Can you tell me how to make a list of unavailable devices? Not entities, but devices. If a device is completely unavailable, its entities are also unavailable.
{% set ns = namespace(devices=[]) %}
{% for entity in states if entity.state == 'unavailable' %}
{% set device = device_attr(entity.entity_id, 'name') %}
{% if device and device not in ns.devices %}
{% set ns.devices = ns.devices + [device] %}
{% endif %}
{% endfor %}
{{ ns.devices | count }}
In a template sensor, that would be something like:
Thank you. I created a template sensor and it started displaying the devices. Could you please fully share the card to display this custom:auto-entities
I can't display a list of devices. If I create a regular sensor to display an attribute as the main property, it complains about the length of the status text.
You can definitely solve this with the info you have. The auto entities card support templates. Otherwise, display this in a markdown card: remove the count, sort and add newlines.
States are limited to 255 characters. You can put this in an attribute though (and make the state e.g. the count).