Scene may have a runCustomScript action block which allow a custom script snippet to be executed/run as a response to some event. To associate such a custom script snippet with a scene, this snippet should be at first added/loaded into a controller by scene.scripts commands. Firmware manages such script snippets as anonymous plugins.
Anonymous plugins have the following differences (against ordinary plugins):
- plugin name is generated automatically and it’s guaranteed to be unique
- any async requests are prohibited (it’s impossible to use methods like zwave.subscribe(), core.subscribe(), http.request(), …)
- only one script is allowed
- no plugin meta-data, only code
After an anonymous plugin was associated with some scene(s) a reference counting mechanism is turned on for this anonymous plugin, so if a reference counter reaches 0 (all scenes which had associated the anonymous plugin were removed), the anonymous plugin will be removed.