This is a problem that's been bothering me for a while now, I can't seem to fix it...
I have a number of scripts that are initiated by a Z-wave wall switch. Depending on the time of day the hue lights get a different colour, so I've created C# scripts for them.
The scripts work fine after saving them (action -> update), they get an orange/yellow ball icon and run well.
The problem arises after a reboot of the server (I'm running a BananaPi now, but the problem was also there on a RasPi). After the reboot all of the scripts are disabled with a dark red ball icon. When I enable them again, they get a red ball icon, but the script runs OK.
When I open the script I get the following message:
Line 0, Column 0 (Trigger Code):
Object reference not set to an instance of an object.I think the problem lies with my Wall switch Trigger line, because all other scripts work (time based, weather based), only the wall switch scripts give me this problem.
Here is one of the the return codes I'm using the others vary only in
Switch name and
value:
return (Modules.WithName("Switch 1").Get().Parameter("Sensor.Generic").DecimalValue == 22);
After saving the script again with action -> update, the error goes away until the next reboot.
The script settings are:
- Program Type: C#
- Trigger Type: when condition evaluation switches to 'true'
I'm running version 1.00 beta r411
I've attached two images, one is the error message, the other is what the Automation windows looks like after a reboot.
Any help would be greatly appreciated.