HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: kevin1 on July 01, 2015, 02:47:15 AM
-
The MotionDetect module started causing runtime problems this evening for some reason...
Program.AddVirtualModules("HomeAutomation.ArduinoGarage", "DoorWindow", "homegenie/generic/doorwindow", 1, 2);
Program.AddVirtualModules("HomeAutomation.ArduinoGarage", "Sensor", "homegenie/generic/sensor", 3, 3);
Program.AddVirtualModules("HomeAutomation.ArduinoGarage", "Sensor.MotionDetect", "homegenie/generic/sensor", 4, 4);
Program.AddInputField("ArduinoIP", "192.168.1.71", "Arduino Garage IP Address");
Here is the error when I try to run the code which has been working fine for a couple weeks...
TC: at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult) at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase) at HomeGenie.Automation.Scripting.ProgramHelper.AddVirtualModules(String domain, String type, String widget, Int32 startAddress, Int32 endAddress) at HomeGenie.Automation.Scripting.ScriptingInstance.b__10() at HomeGenie.Automation.Scripting.ProgramHelper.Setup(Action functionBlock) Runtime
Error
8:45:37 PM Block popup from this source
Error
×
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at HomeGenie.Automation.Scripting.ProgramHelper.AddVirtualModules(String domain, String type, String widget, Int32 startAddress, Int32 endAddress)
at HomeGenie.Automation.Scripting.ScriptingInstance.b__10()
at HomeGenie.Automation.Scripting.ProgramHelper.Setup(Action functionBlock)
I have restarted and commented out lines until I narrowed it down to the line referenced above.
-
Fixed it I guess, deleted ".MotionDetect", compile, runs ok, add ".MotionDetect" back, compile, runs ok ???
-
Sometimes a recompile is necessary after an update. Sometimes it's required without an update too though. I can't explain either. :o
-
Its happening again >:(
My MotionDetect arduino sensor modules have been working fine for weeks. Last night I rebooted my PC and getting runtime errors :-[
Requested value 'Sensor.MotionDetect' was not found.
Error
×
at System.Enum.TryParseEnum(Type enumType, String value, Boolean ignoreCase, EnumResult& parseResult)
at System.Enum.Parse(Type enumType, String value, Boolean ignoreCase)
at HomeGenie.Automation.Scripting.ProgramHelper.AddVirtualModules(String domain, String type, String widget, Int32 startAddress, Int32 endAddress)
at HomeGenie.Automation.Scripting.ScriptingInstance.b__15()
at HomeGenie.Automation.Scripting.ProgramHelper.Setup(Action functionBlock)
Tried recompiling the files with minor edits. Tried restarting HG.
Commenting this out seems to fix the runtime problem ???
//Program.AddVirtualModules("HomeAutomation.ArduinoGarage", "Sensor.MotionDetect", "homegenie/generic/sensor", 4, 4);
-
Sensor.MotionDetect is not a module type but rather a module property name.
Allowed module types are listed here:
https://github.com/genielabs/HomeGenie/blob/master/MigFiles/MIG/MIGInterface.cs#L145
Cheers,
g.
-
Thanks Gene. I am definitely confused on the details. So DoorWindow is a module type, and Sensor.DoorWindow is a property, shoudn't it be DoorWindow.Status or something?
-
So what am I mixing up to cause my ArduinoGarage module to show as a feature under IpCamera :-\ :o ??? :'(
I added this to IpCamera triggers to enable motion detection notification via webapi:
Program.AddFeature("Media.IpCamera", "HomeGenie.SecuritySensor", "Use as Security Sensor");
ArduinoGarage program has this:
Program.Setup(()=>{
Program.AddVirtualModules("HomeAutomation.ArduinoGarage", "DoorWindow", "homegenie/generic/doorwindow", 1, 2);
Program.AddVirtualModules("HomeAutomation.ArduinoGarage", "Sensor", "homegenie/generic/sensor", 3, 3);
Program.AddVirtualModules("HomeAutomation.ArduinoGarage", "Sensor", "homegenie/generic/sensor", 4, 4);
Program.AddFeature("Sensor,DoorWindow", "HomeGenie.SecuritySensor", "Use as Security Sensor");
Program.AddInputField("ArduinoIP", "192.168.1.71", "Arduino Garage IP Address");
Program.Parameter("Temperature").Value = "-1";
Program.Parameter("Humidity").Value = "-1";
Program.Parameter("Luminance").Value = "-1";
Program.Parameter("Door1").Value = "-1";
Program.Parameter("Door2").Value = "-1";
Program.Parameter("MotionDetect").Value = "-1";
});
return true; // execute "Code To Run"
Screenshot showing problem below...