i did a little optimization referring to the toggle switch function
function swi(room){
socket.emit('call', {
id: 'executeAction-1',
action: 'executeAction',
params: {
actionString: 'toggle ' + room
}
});
}
so you have to add the name of the switch you wanna toggle also in the html
<button class="btn btn-default btn-lg fullwidth uibutton" onclick="swi(Roomname)" id="RoomName">Room Name</button>
so you don’t have to add a whole new function for EVERY Switch you wanna toggle.
The same work can be done with the Button Press function
Besides that, this script is a great work and it saved me a lot of time for setting up my own interface.