Porting smartswitch plugin to openLuup

Hello,

here is a quickly modified version of SmartSwitch, made for openLuup.

Not tested on UI7.

Smart Switch Plugin_2.0_UI7_openLuup.zip (26.0 KB)

@vosmont,

What’s the changes in this new version? :wink:

Also, do you think it can be possible to change the AND to a OR when having more than 1 device in the Smartswitch ?

I tried installing the version from here

but get the dreaded JavaScript error in the settings panel:

an error occurred while displaying the javascript tab. devid: 0-279 err:deviceIdsJSON.replace is not a function

stack:ssc_getDeviceIdsSetting@J_SmartSwitchController1.js:116:32
ssc_removeUsedDevices@J_SmartSwitchController1.js:91:18
ssc_deviceSelectDropdown@J_SmartSwitchController1.js:138:12
ssc_showSettings@J_SmartSwitchController1.js:34:15
@http://0.0.0.0:3480/J_ALTUI_uimgr.js line 3022 > eval:1:17
_deviceDrawControlPanelJSTab@http://0.0.0.0:3480/J_ALTUI_uimgr.js:3022:17
_deviceDrawControlPanelOneTabContent@http://0.0.0.0:3480/J_ALTUI_uimgr.js:3717:36
_displayActiveDeviceTab@http://0.0.0.0:3480/J_ALTUI_uimgr.js:3744:40
pageControlPanel/<@http://0.0.0.0:3480/J_ALTUI_uimgr.js:7036:27
dispatch@http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:42571
add/v.handle@http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:40572
trigger@http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:70627
trigger/<@http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:71222
each@http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:2777
each@http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:1419
trigger@http://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js:2:71198
l@http://maxcdn.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js:6:55481
Yn

Any suggestions?

SmartSwitch.zip (20.1 KB)

@akbooer , this is my running version in case of!