Create restore scene of group of entities

hi so i have tried 2 different scripts 2nd one i found searching
1st One

sequence:
  - action: scene.create
    metadata: {}
    data:
      scene_id: led_light_current_leds_state
      snapshot_entities:
        - group.wled_devices_save_restore_settings
alias: LED - LIGHT - CURRENT STATE
description: ""

2nd One

sequence:
  - action: scene.create
    metadata: {}
    data:
      scene_id: led_light_current_leds_state
      snapshot_entities: {{ state_attr('group.wled_devices_save_restore_settings', 'entity_id') }}
alias: LED - LIGHT - CURRENT STATE
description: ""

now the first one runs but it doesnt record properly as when it restores. it will restore WLED Presets as blanks and down the road screws up

the 2nd one when i execute in node red. tells me it can pass None…or something like that… so its not recording every single entity correctly

i also tried using

group.wled_devices_save_restore_settings

in the entity states but it does nothing also…
so how do you properly create a scene of all the entites that are in the group

the restore is

sequence:
  - action: scene.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: scene.led_light_current_leds_state
alias: LED - LIGHT - RESTORE STATE
description: ""

The template in your second example is missing outer quotes.

Rule #1 from Important Template Rules:

You must surround single-line templates with double quotes (") or single quotes (').

snapshot_entities: "{{ state_attr('group.wled_devices_save_restore_settings', 'entity_id') }}"

ah ok ya i added the qoutes and i dont get the error… and seems to be working… it didnt wanna work first few times i had to set them to power off presets then run the tests a few times seems like residual

so i hope it will hold

how do you know when you gotta use qoutes and when not

@123 so that one solved it… now my other one doesnt work i get

Entity IDs cannot be None for dictionary value @ data['snapshot_entities']
HomeAssistantError: Entity IDs cannot be None for dictionary value @ data['snapshot_entities']
    at p (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/common/errors/inputErrorHandler.js:1:1032)
    at m (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/common/errors/inputErrorHandler.js:1:1318)
    at C.#t (/opt/node_modules/node-red-contrib-home-assistant-websocket/dist/common/controllers/InputOutputController.js:1:1340)

in node red

my script is

sequence:
  - action: scene.create
    metadata: {}
    data:
      scene_id: incoming_call_current_leds_state
      snapshot_entities: "{{ state_attr('wled_devices_save_restore_settings', 'entity_id') }}"
  - action: select.select_option
    metadata: {}
    data:
      option: Incoming Call
    target:
      entity_id: |
        {{ state_attr('group.wled_devices_incoming_call_presets', 'entity_id') }}
  - delay:
      hours: 0
      minutes: 0
      seconds: 20
      milliseconds: 0
  - action: scene.turn_on
    metadata: {}
    data: {}
    target:
      entity_id: scene.incoming_call_current_leds_state
alias: LED - "INCOMING CALL" - CURRENT STATE/RESTORE
description: ""

what is wrong with this?

never mind i found it… i didnt have group. on front
ugh my dyslexia really sucks i didnt notice it

Glad to hear it solved the problem.

Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which indicates to others that the topic has been solved. This helps other users find answers to similar questions.

@123 ah ok did it work??? i checked it… and how do you know when to use quotations and what not to
so far ive used it mostly in templates when studio editor complains and i put quotes…
but how do you know when and when you dont need to?

Review Template Rule #1.

You must surround single-line templates with double quotes (") or single quotes (').

If you create a multiline template then you don’t need to wrap the template in quotes.

snapshot_entities: |
  {{ state_attr('group.wled_devices_save_restore_settings', 'entity_id') }}

The vertical bar symbol | indicates the template begins on the next line. You can also use the greater than symbol > instead of |.

@123 ah ok ill try to remember that for the future… always learning…