I get this error:
2023-05-20 23:58:22.420075 WARNING HASS: Error calling Home Assistant service default/scene/create
2023-05-20 23:58:22.421753 WARNING HASS: Code: 400, error: 400: Bad Request
Any help is much appreciated! I’ve been struggling with this all day and not gotten any further
Great you’re still here Unfortunately that does not solve the problem, I still get the same error if I remove the dot. I can call the service to turn on a light, so the problem must be how the data formatted.
I can’t find any documentation about how to use call_service, which would be really helpful. Which of the formatting options above did you use?
When using “call_service” the parameters need to be called the same as if you’d call the service in YAML. So instead of “entities” it’s “snapshot_entities”.
I really appreciate your help! I think snapshot_entities is if you want to take a snapshot of the current states and I want to create the scene just with code.
I got it solved now! I installed Node Red and created a call service node to create the scene - it also failed, but it provided details about what caused the problem and it was the “name” variable - apparently you can’t give the scene a name, instead it uses the scene_id for both name and entity_id.
What I’m trying to achieve is have a bunch of lists of RGB codes and then dynamically create scenes for all rooms in the house where each light will get a color randomly picked from the scene color list and the scene will be different every time the script runs.
I hope I don’t run into more trouble - else I will write again. Thanks!