protected override void Execute_HomeAutomationDefinition(HomeAutomationCommandContext context) { var interpreter = context.Interpreter; var networks = context.Networks; var port = context.ReadParameter("Port").Value; if (port.StartsWith("COM", StringComparison.InvariantCultureIgnoreCase)) { port = @"\\.\" + port; } interpreter.WriteEvent("Searching for Z-Wave network adapater at " + port + "..."); var network = new OpenZWaveNetwork(new HomeAutomationNetworkContext(context.Engine, context.ThreadPool), port); networks.Add(network); interpreter.WriteEvent("Done."); }