Thanks for this answer, your answer did not give straight away the solution but forced me to examine possibilities even further.
So far it looks that the hold_action is more responsive than the tab_action. The tab_action is still going to to the logbook details. I also prefer the hold_action because you can make a more deliberate and visible decision.
I moved away from a direct action to a script because a script can show me traces of what I am doing (wrong). Also I needed either a partial entity_id (“{{ entity_id[-20:-8] }}”) or the attribute.public_key. But I failed to do that directly (or not and it is too much invisible because the action is performed on the device of the integration). Isn’t the devil is in the syntax detail?
So these problems are tackled but the last problem is that I want to use a template because my selection is more complex than what is possible with the standard include section. Got this template working but the tab_action looks like a part of the empty include section and does not do anything more. So the question arise how do I integrate it with the template?
hold_action is working tab_action not (do not mind this minor problem)
type: custom:auto-entities
card: null
filter:
include:
- options:
hold_action:
action: call-service
service: script.meshcore_remove_contact_script
service_data:
entity_id: this.entity_id
tab_action:
action: call-service
service: script.meshcore_remove_contact_script
service_data:
entity_id: this.entity_id
integration: 01K1JG8Z9Q0CF1YPW759T2QSXS
state: stale
attributes:
type: 3
sort:
reverse: true
With a more complex selection in a template but how to get the hold_action back to work?
type: custom:auto-entities
card: null
filter:
include:
- options:
hold_action:
action: call-service
service: script.meshcore_remove_contact_script
service_data:
entity_id: this.entity_id
template: >-
{% set tijd = now() | as_timestamp | int %} {% set type =
states['input_select.meshcore_contact_type'].state[:1] | int %} {% set
days_old = states['input_number.meshcore_days_old'].state | int %}
{{ states.binary_sensor
| selectattr('entity_id', 'search', 'meshcore_')
| selectattr('entity_id', 'search', '_contact')
| selectattr('state', 'eq', 'stale')
| selectattr('attributes.type', 'eq', type )
| selectattr('attributes.lastmod', 'lt', tijd - days_old*60*60*24)
| map(attribute='entity_id') | list
}}
The simplified version of the use of a template in a card is given in examples like (which can be copied in a empty card, working effect is better after dark).
type: custom:auto-entities
card:
type: entities
filter:
template: "{{states.light
| selectattr('state', '==', 'on')
| map(attribute='entity_id') | list}}"
So does anyone know how to can this be extended with a hold_action?