set_debug($debug); $loginresults = $unifi_connection->login(); $site_settings = $unifi_connection->list_settings(); $super_mgmt_settings = []; $super_mgmt_settings_id = ''; if (!empty($site_settings)) { foreach($site_settings as $section) { echo 'section key: ' . $section->key . PHP_EOL; if ($section->key === 'super_mgmt') { $super_mgmt_settings = $section; $super_mgmt_settings_id = $section->_id; } } } /** * modify the super_mgmt settings, in this example we only modify the Live Chat settings * uncomment the required new value below: */ //$super_mgmt_settings->live_chat = 'disabled'; //$super_mgmt_settings->live_chat = 'enabled'; $super_mgmt_settings->live_chat = 'super-only'; /** * we echo the parameters which we will be passing to the UniFi controller API */ echo $super_mgmt_settings_id . PHP_EOL; echo json_encode($super_mgmt_settings, JSON_PRETTY_PRINT) . PHP_EOL . PHP_EOL; $update_results = $unifi_connection->set_super_mgmt_settings_base($super_mgmt_settings_id, $super_mgmt_settings); /** * provide feedback in json format */ echo json_encode($update_results, JSON_PRETTY_PRINT);