Vladimir Bykov 5 months ago • updated by Ilya Markov (expert) 5 months ago 9

I am developing relay module, that can have 12, 8, 6, 4 or 2 channels.

Because there no way to create a subdevices by tempate in the script, I desided to create 12 subdevices in Studio and then after user chose of the number of channels delete unnecessary subdevices.


1. When I add new module i3Lite show me this dialog. I dont understand for what. Do you plan to leave this dialog in the system?

2. Subdevices doesn't delete

Is this a bug or I miss something?



in your case, you should add new subdevices via js. Youк module should find the dimmer and ask him about channels count and when your module receive channels count, the script must create the required number of subdevices

If I understand right, in script I must:

  1. Create subdevice
  2. Create widget for this subdevice
  3. Create item in this widget

But I didn't find method like .AddItem for widgets, only for popups.

May be you have an example with dinamic modules.

no, your should:

- Create widget with items in GUI

- create subdevice in js

- clone widget in js

- attach cloned widget to new subdevice

Kindly tell me which methods I should use to clone widget and to attach widget to the subdevice.

module.ClonePopup - for cloning popup

SubDevice.AddWidget - for adding widget to new subdevices

Here you can find all API and instructions


module.ClonePopup returns Object

SubDevice.AddWidget have only one input string parameter 'Name'

How can I do that?

widget object has property "Name"

So, method SubDevice.AddWidget(Name) search existing widget by Name and, if it is found, attach him to the subdevice. If doesn't find, create new widget.


no, if you enter the name of not existing widget, then the app will display nothing instead widget