Author Topic: Help Needed - Rules (Network and Omni Pro Driver)  (Read 5503 times)

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Help Needed - Rules (Network and Omni Pro Driver)
« on: September 09, 2011, 02:28:31 pm »
I have a script as follows :-

command = EventArgs.Data;
system.log( "Raw Packet " + EventArgs.Data);
if (EventArgs.Data.Substring(0, 3) == "!00")
{
   if (EventArgs.Data.Substring(4, 7) == "POOLTMP")
   {
      //      system.log("POOLTMP found");
      if (EventArgs.Data.Substring(4, 11) == "POOLTMP = 1")
         pooltmp=EventArgs.Data.Substring(14, 3);
      //   system.log( "Pool Temperature " + EventArgs.Data.Substring(15, 3));
      else if (EventArgs.Data.Substring(4, 10) == "POOLTMP = ")
         pooltmp=EventArgs.Data.Substring(14, 2);
      system.log( "Pool Temperature " + pooltmp);
      omni.SetUnitLevel( 470, 10 );
      omni.SetUnitLevel(470, pooltmp);
   }
}

The script is reading data from a pool controller, and I am trying to set a flag on the omnipro with the current pool temp.

The script correctly reads the temp and it is displayed in the log, however, using the omni.setunitlevel seems to do nothing. I added omni.SetUnitLevel( 470, 10 );, but it doesn't set the flag on the omnipro, although it doesn't error, however, omni.SetUnitLevel(470, pooltmp); errors when it executes, so not sure what I am doing wrong here.

The error is:-

An error occurred while executing the script rule 'Pool Controller'.
ScriptEvaluatorException: No overload for method 'omni.SetUnitLevel' takes '2' arguments.

CodecoreTechnologies.Elve.DriverFramework.Scripting.ScriptEvaluatorException: No overload for method 'omni.SetUnitLevel' takes '2' arguments.
   at Common.ScriptEvaluator.ScriptEvaluator.evaluate(ScriptParser parser, ScriptVariableCollection variables, EvaluateFunctionDelegate evaluatefunction, ScriptObjectTypeInfoCollection objectInfos, ScriptFunctionInfoCollection scriptFunctionInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.Evaluate(ScriptParser parser, ScriptVariableCollection variables, EvaluateFunctionDelegate evaluatefunction, ScriptObjectTypeInfoCollection objectInfos, ScriptFunctionInfoCollection scriptFunctionInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.Evaluate(String s, ScriptPosition position, ScriptVariableCollection variables, EvaluateFunctionDelegate evaluatefunction, ScriptObjectTypeInfoCollection objectInfos, ScriptFunctionInfoCollection scriptFunctionInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.Evaluate(String s, ScriptVariableCollection variables, EvaluateFunctionDelegate evaluatefunction, ScriptObjectTypeInfoCollection objectInfos, ScriptFunctionInfoCollection scriptFunctionInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.Evaluate(String s, ScriptVariableCollection variables, EvaluateFunctionDelegate evaluatefunction, ScriptObjectTypeInfoCollection objectInfos)
   at Common.ScriptEvaluator.ScriptEvaluator.EvaluateNow(String s, ScriptVariableCollection variables, EvaluateFunctionDelegate evaluatefunction, ScriptObjectTypeInfoCollection objectInfos)
   at MasterService.ScriptRunner.RunNow(String scriptName, String script, ScriptVariableCollection extraScriptVariables, Boolean throwError)
Location in script: line 15, column 9.

         omni.SetUnitLevel(470, pooltmp);
        ^


Please help both with both of my problems
a) why is the omnipro not updating.
b) using variables in the omni command.

Many thanks
Paul

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #1 on: September 10, 2011, 02:25:44 pm »
Further Update

I've updated my copy of ELVE to the latest BETA, and found new option for SETFLAGLEVEL, however, it still doesn't look to update the Omnipro.

I have enabled logging on the HAI driver, and the log file, only logs received unsolicited packet and SystemEvent messages.

Any ideas?
Paul

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #2 on: September 10, 2011, 02:35:31 pm »
Further Update.

I've cured the script error, as the driver couldn't handle the variable being a string, changing it to a number stops it erroring, but still no update on the HAI.

Paul

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #3 on: September 10, 2011, 03:35:02 pm »
Further Update

I've tried different driver commands - I can do the following:-
turn lights on and off.
set light levels on lights
turn on and off flags

However, I cannot use setflaglevel or setunitlevel, script does not error, but no updates seen on the omnipro

This indicates nothing is wrong with the comms itself between ELVE and the omnipro

Paul

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #4 on: September 11, 2011, 04:13:07 pm »
I did find a bug in the Set Flag Level action. This should be fixed in the next beta.

I do not see an issue with the Set Unit Level action though. Can you please try Turn On Unit and Turn Off unit.  Thanks.
John Hughes
Codecore Technologies

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #5 on: September 11, 2011, 11:33:43 pm »
TurnOnUnit and TurnOffUnit work just fine.

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #6 on: September 12, 2011, 09:21:52 pm »
Thanks for the update.

I double checked the Set Unit Level action and it looks fine. Are you sure you are entering the correct unit id? Units 1-256 are for lighting, 393-511 are flags and most of the others are for various relay expansions.

It is normally easier to use the Set Light Level, Set Output Level, and Set Flag Level methods since they translate the given id to the appropriate unit it.
John Hughes
Codecore Technologies

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #7 on: September 12, 2011, 10:02:05 pm »
PS: The latest beta release includes a (hopeful) fix for the set flag level issue.
John Hughes
Codecore Technologies

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #8 on: September 12, 2011, 11:21:57 pm »
I've installed the new version, and setting units on flags with either setflaglevel or setunitlevel do not work.

Here is the script

//omni.SetFlagLevel(4, 100);
//omni.SetUnitLevel(396, 100);
omni.TurnOffFlag(4);
//omni.TurnOnFlag(4);
//omni.TurnOffUnit(396);
//omni.TurnOnUnit(396);

Unit 396 is the equivalent of flag 4.
Using the above examples TurnOffFlag does not work in addition to SetFlagLevel and SetUnitLevel.

Paul

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #9 on: September 13, 2011, 08:13:43 am »
Perhaps I misunderstood but I thought you were using TurnOffFlag earlier without any issues. The method has not changed in the driver so it's behavior should not have changed.

Quote
I've tried different driver commands - I can do the following:-
turn lights on and off.
set light levels on lights
turn on and off flags

The driver uses the HAI SDK which is not documented so it can be a guessing game. I will post on HAI's website and "hope" for a response. :/

I'll also get in touch with some other HAI users to see if they are seeing these same issues as they have not reported them in the past.
John Hughes
Codecore Technologies

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #10 on: September 13, 2011, 08:28:58 am »
Yes I thought it had worked before this version too, although I could have been mistaken.

The results posted earlier were attempted more than once just to confirm them.

Paul

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #11 on: September 13, 2011, 11:19:26 pm »
Hi John

I realize bugs like this can be difficult to fix, but do you estimate this issue could take days, weeks or even months to rectify. I've probably got about 35 days of my trial license left.

Paul

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #12 on: September 14, 2011, 12:10:02 pm »
It depends on how fast HAI is at getting back with me. In the past they have not been very quick and in some cases they have never replied.

Don't worry about the trial license... if the issue isn't fixed by the time your license expires I can extend your license duration... however I hope to get this resolved sooner than later.
John Hughes
Codecore Technologies

Paul_Sharrock

  • Jr. Member
  • **
  • Posts: 75
    • View Profile
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #13 on: September 14, 2011, 03:35:38 pm »
OK thanks

I know a couple of the guys at HAI, who may be able to help.
I had major issues with the stability of the system, and worked with them through various trial firmware updates to fix the issue.

I know I've raised a feature request for new HAI features, but there seems a lot missing from the driver from what I've seen so far..

Omnipro Events (New ELVE event)
Buttons / Task (New ELVE event)
User Names (Read)
Messages (Read, Writes etc)
User Settings (values, names and data types)

I would use events to know which user actually set/unset the alarm, as this currently doesn't look to be available. If this could be done with a new event then this could be better.

The system looks great, and will be a perfect fit for me once the issues and new features are implemented.

Paul

John Hughes

  • Administrator
  • Hero Member
  • *****
  • Posts: 2852
    • View Profile
    • Codecore Technologies
Re: Help Needed - Rules (Network and Omni Pro Driver)
« Reply #14 on: September 17, 2011, 01:20:58 pm »
I received a reply on the HAI forums regarding the flag level and have implemented the recommended change... which will be in the next beta.

I also posted a request for code samples for your requested features. I mentioned that there is no documentation for HAI's .NET SDK. :(
John Hughes
Codecore Technologies