52 Switch lights and glow from events
Use the dedicated runtime actions when you want a switch to change visible lighting. Editing a generic stored property is not always enough to rebuild a live material or light.
await Action("ToggleLight", {"entityId":"key_light"})
await SetGlow({"entityId":"lamp", "enabled":true})
await SetSceneBrightness({"sceneId":"lab",
"brightness":0.8})The example is GDScript inside a run function. ToggleLight is a supported action through Action even if it is not listed by the current shared selector. SetGlow and ToggleGlow have shared action fields. Author the object’s glow before toggling it; the toggle does not invent an emission setup for an object that has none.
| Action | Use |
|---|---|
| ToggleGlow | Reverse an authored object glow’s on/off state. |
| SetGlow | Choose on or off explicitly. Use this for reliable cleanup. |
| ToggleRGBString | Switch an authored decorative string. |
| SetSceneBrightness | Change the current or named room’s image brightness. |
| SetSceneTint | Apply a room tint with color and strength. |
An on/off variable can link a switch to a light, glow or RGB string. Use the same variable intentionally and test both the initial state and returning to the room.
