I’m bulk creating imported scenes via the REST API, here’s an example payload:
Endpoint: http://myhass:8123/api/services/scene/create
{
"scene_id": "example_scene",
"entities": {
"light.hutch": {
"state": "on",
"kelvin": 3000,
"brightness": 134
},
"light.spiral": {
"state": "on",
"kelvin": 3500,
"brightness": 198
},
"light.pedestal": {
"state": "on",
"kelvin": 3000,
"brightness": 183
},
"light.crate": {
"state": "on",
"kelvin": 3500,
"brightness": 255
}
}
}
The scene is saved (though not editable via the interface and does not appear in the scenes.yaml
file). It still works, though.
However upon host reboot everything is gone. I have the following questions:
- Is there a way to persist these scenes directly to the
scenes.yaml
via the REST API? - Can I assign a unique ID and a friendly name via the API? Apparently the
scene_id
property will not accept spaces, etc.