Call service > create scene with snapshot_entities

Dear all,

I would like to use the call service to create a scene with snapshot_entities.
But no matter how I structure the list I always get errors like:

HomeAssistantError: Entity ID - light.schalter_licht_flur_eg
- light.dimmer_spots_flur_og
- light.spot_treppe_dg is an invalid entity ID for dictionary value @ data['snapshot_entities']

Here is my current node:

[
    {
        "id": "9bf770b42cba94e3",
        "type": "api-call-service",
        "z": "1c8dfa09020c04d9",
        "name": "Create scene snapshot",
        "server": "b2e4926a.65b1d",
        "version": 5,
        "debugenabled": false,
        "domain": "scene",
        "service": "create",
        "areaId": [],
        "deviceId": [],
        "entityId": [],
        "data": "{\"scene_id\":\"snapshot_lights\",\"snapshot_entities\":\"- light.schalter_licht_flur_eg\\n- light.dimmer_spots_flur_og\\n- light.spot_treppe_dg\\n\"}",
        "dataType": "jsonata",
        "mergeContext": "",
        "mustacheAltTags": false,
        "outputProperties": [],
        "queue": "none",
        "x": 250,
        "y": 740,
        "wires": [
            []
        ]
    }
]

I use

node-red-contrib-home-assistant-websocket
0.62.3

Please, can somebody show me, what do i wrong.

TIA!

Best regards
Gerd

Switch the data section drop down from JExpression to JSON

Dear @Mikefila

thank you for your support!

I do it, but the error remains

HomeAssistantError: Entity ID - light.schalter_licht_flur_eg
- light.dimmer_spots_flur_og
- light.spot_treppe_dg is an invalid entity ID for dictionary value @ data['snapshot_entities']

The json-code is:

{"scene_id":"snapshot_lights","snapshot_entities":"- light.schalter_licht_flur_eg\n- light.dimmer_spots_flur_og\n- light.spot_treppe_dg\n"}

Use this format instead

{
    "scene_id": "snapshot_lights",
    "snapshot_entities": [
        "light.number1",
        "light.number2",
        "light.number3"
    ]
}
1 Like

Perfect!
It work’s

Thank you very much for your help

Best regards
Gerd