more G-Labs products

Author Topic: Wizard script : disable random, reboot ?  (Read 1404 times)

December 08, 2014, 09:02:39 PM
Read 1404 times

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
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
Code: [Select]
HomeAutomation.ZWave.xx / Sensor.Generic / Equals / x.x * Program code
Code: [Select]
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

December 09, 2014, 07:29:01 AM
Reply #1

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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).

Code: [Select]

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
« Last Edit: December 09, 2014, 10:20:38 AM by mvdarend »

December 09, 2014, 03:56:44 PM
Reply #2

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
Hi,

Ok. So i probably need to transpose my wizard script in c# script  ...   ;)

Bye

December 09, 2014, 04:21:36 PM
Reply #3

mvdarend

  • *****
  • Information
  • Hero Member
  • Posts: 431
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

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

December 09, 2014, 04:32:02 PM
Reply #4

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
Yes, i use this method in my C# script now. Thanks.

December 12, 2014, 09:26:16 PM
Reply #5

nolio

  • *****
  • Information
  • Global Moderator
  • Posts: 544
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