I don’t know how you tested it to arrive at the conclusion that it doesn’t work. Perhaps you assumed scene_entities contains a string but, in fact, it will be a list.
If you try the following blueprint, you’ll see that it does work. The list is converted to a comma-separated string and displayed as a persistent_notification.
Blueprint
blueprint:
name: Test C
description: Test C
domain: automation
input:
the_scene:
name: Scene
description: Select a scene.
selector:
entity:
domain: scene
default: ''
the_boolean:
name: Boolean
description: Select an input_boolean.
selector:
entity:
domain: input_boolean
default: ''
variables:
s1: !input the_scene
e: "{{ state_attr(s1, 'entity_id') }}"
trigger:
- platform: state
entity_id: !input the_boolean
action:
- service: persistent_notification.create
data:
title: "{{ now().timestamp()|timestamp_local() }}"
message: "{{ e | join(', ') }}"
Thank you very much. I was trying to get the entitites of a scene to turn them off. I got an error, that in my case {{scene_entities}} is not valid target when calling homeassistant.turn_off service.
You can’t ‘call on a list’? Well that’s just wrong. The blueprint I posted does in fact ‘call on a list’.
As for ‘looping over the list’ with a for-loop, that’s fine in the Template Editor but nowhere else. I invite you try it in a Template Sensor or automation to discover for yourself why the result is not usable when generated that way.
The blueprint I posted uses the join filter to convert the list of entities into a comma-separated string of entities.