function executeActionByValueID(command, index, valueID, valueFactor){ var value = document.getElementById(valueID).value * valueFactor; executeAction(command, index, value); } function switchZoneMode(autoMode, zone) { executeAction('switch_zone_mode' ,zone, (autoMode ? 'automatic' : 'manual')) }