Read a state value from a scene

Hi all,

I’m new to HA and stumbling my way around (I’m very impressed with what I’ve seen and done) :slight_smile:

I’m now playing with scenes and was wondering/hoping if it’s possible to read a stored entity state value from a scene?

If it is, could someone post me an example of the code?

Thanks,
J.

I want to do the same thing. I have a scene with one entity and setting a state.
I would like to read this parameter. I tried this with templates, but I’m not getting it done.

Here is what I tried:

{% for entity_ids in state_attr('scene.test', 'entity_id') -%}
   {{ state_attr(entity_ids, 'current_position') }}
{%- endfor %}

This works, but it print the current state of the entity and not the state that is defined in the scene.

Can someone help here?

I got a solution to the problem. Instead of using a scene, I created a script to do the actions. The script gets its target value via a helper input_number. In the end, I can read the helper input_number again in another template like in a automation. One plus, now I can have a slide to adapt the target value.