HomeGenie Forum
General Category => Troubleshooting and Support => Topic started by: nolio on December 08, 2014, 09:02:39 PM
-
Always (or nearly) after a restart of HomeGenie, some of my simple wizard script (nearly all) are disable (or they were enable before the restart).
And sometimes, without reboot, they are too disable.
I suspect that HG disable automatically because they consume too much ressources (CPU, RAM?).
This script are very simple one example :
* Trigger
HomeAutomation.ZWave.xx / Sensor.Generic / Equals / x.x
* Program code
HomeAutomation.HomeGenie.Automation.xx / Control.On / xxxxxxxx
Is it a similar problem in C# script and the trigger code is too much asked ?
But this wizard script doesn't seem to use huge CPU ...
Any idea ?
Bye
-
I had almost the same problem with my Z-wave switch scripts a while back. Only difference is that I wasn't using wizard scripts, so this may be of no use to you.
This is the answer I got from Gene:
Perhaps the module "Switch 1" is not yet available at startup as z-wave node discovery start after all automation programs are started.
So the code should first check that the module exists before trying reading module parameters (Sensor.Generic).
var wallSwitch = Modules.WithName("Switch 1").Get();
return (wallSwitch.WasFound && wallSwitch.Parameter("Sensor.Generic").DecimalValue == 22);
Here is the thread:
http://www.homegenie.it/forum/index.php?topic=356.msg2013 (http://www.homegenie.it/forum/index.php?topic=356.msg2013)
-
Hi,
Ok. So i probably need to transpose my wizard script in c# script ... ;)
Bye
-
If you're worried about using too many resources, you might find this post of interest:
http://www.homegenie.it/forum/index.php?topic=366.msg2424#msg2424 (http://www.homegenie.it/forum/index.php?topic=366.msg2424#msg2424)
It's what I eventually ended up doing for my Z-wave wall switches after MickEEs help.
Edit. Nevermind, I see that Gene already showed you this here:
http://www.homegenie.it/forum/index.php?topic=479.msg2772#msg2772 (http://www.homegenie.it/forum/index.php?topic=479.msg2772#msg2772)
-
Yes, i use this method in my C# script now. Thanks.
-
Hi,
After the transposition of wizard script to C# script, i confirm no more random disable, or disable after reboot.
And another good point, i reduce the number of my script :)
Bye