At present, it is possible to read the list of entities from a scene, but not the state or other attributes, such as brightness and colour, that are stored in the scene for those entities.
I propose that they should be made available as a JSON dictionary similar to that returned from states
. That can then be further processed in templates using the standard JINJA filters.
For example, if I had a scene based on the entities
['light.hall_ceiling_light_light', 'light.bedroom_ceiling_light_light', 'light.bedside_lamp']
then the value returned from the proposed function might be something like
<template TemplateState(<state light.hall_ceiling_light_light=on; supported_color_modes=[<ColorMode.BRIGHTNESS: 'brightness'>], color_mode=brightness, brightness=254, off_with_transition=False, off_brightness=None, friendly_name=Hall ceiling light Light, supported_features=40 @ 2024-06-29T16:28:21.243433+01:00>)>
<template TemplateState(<state light.bedroom_ceiling_light_light=off; supported_color_modes=[<ColorMode.BRIGHTNESS: 'brightness'>], color_mode=None, brightness=None, off_with_transition=True, off_brightness=254, friendly_name=Bedroom ceiling light Light, supported_features=40 @ 2024-06-29T15:07:20.481094+01:00>)>
<template TemplateState(<state light.bedside_lamp=on; supported_color_modes=[<ColorMode.HS: 'hs'>], color_mode=hs, brightness=255, hs_color=(0.0, 0.0), rgb_color=(255, 255, 255), xy_color=(0.323, 0.329), friendly_name=Bedside Lamp, supported_features=0 @ 2024-06-29T15:05:08.337577+01:00>)>
I produced this example by filtering states
and added newlines for readability, but for a scene it would include the device attribute values that are stored in the scene.