Announcement

Collapse
No announcement yet.

Scripting problems

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Scripting problems

    Hi there, and happy holidays to all of you.

    I'm new to homeseer and home automation, but have experience from industrial control systems and programming plc's. I also have some experience writing in C and C++, although I haven't practiced it for years.

    I'd like to harvest the power of scripting with homeseer, but I cant even get the simplest hs.writelog statement to work.

    I think I need help

    My system is HS3 Zee2 installed on a Rasberry pi II B.
    Razberry GPIO Z-wave controller, 6 connected devices functioning properly.
    Z-wave plugin activated.
    HStouch plugin activated.

    I have a simple C# testscript with very limited code, I've tried it in different versions with slightly different results. At first I copied a simple piece of code from the user manual to a testcript which I run manually from the event page.

    testscript.cs
    public Object Main(Object[] parm)

    {
    hs.writelog("CSHARP","From C# TestScript");
    return null;
    }
    Running this script crashes the system, I can no longer find the homeseer installation using find.homeseer.com, not from the internet and not from LAN. After restarting the Rasberry by pulling the power both z-wave and hstouch plugins are deactivated, but activating from plugin page brings them back to life.

    Adding a namespace for "System" by adding (using System without parentheses as the first line (before the "Main" function call) makes the script run, but now i get a error message in the log instead of the expected "CSHARP From C# TestScript" entry.

    Script like so:
    testscript.cs
    using System;

    public Object Main(Object[] parm)
    {
    hs.writelog("CSHARP","From C# TestScript");
    return null;
    }
    Error message:
    Compiling script /usr/local/HomeSeer/scripts/TestScript.cs: {interactive}(56,8): error CS1061: Type `Scheduler.hsapplication' does not contain a definition for `writelog' and no extension method `writelog' of type `Scheduler.hsapplication' could be found (are you missing a using directive or an assembly reference?) {interactive}(25,17): warning CS0414: The private field `Script.hs' is assigned but its value is never used
    I also tried adding more namespaces, like e.g:
    using Microsoft.VisualBasic;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Data;
    using System.Diagnostics;
    using HomeSeerAPI;

    Changing hs.writelog to hs.WriteLog makes no difference either.

    What am I doing wrong?

    My next step after getting writelog to work is trying to control a virtual device, then sending parameters and finally actual usage on real devices.

    Regards
    Frode

    #2
    Hi Frode,

    I believe your line return null; is causing the issue!
    can you try
    Return 0;

    Comment


      #3
      Is Linux case sensitive to external names?

      Try hs.WriteLog



      Total guess on my part, but it looks like it is complaining it has no routine writelog

      tenholde
      tenholde

      Comment


        #4
        Originally posted by russr999 View Post
        Hi Frode,

        I believe your line return null; is causing the issue!
        can you try
        Return 0;
        Originally posted by tenholde View Post
        Is Linux case sensitive to external names?

        Try hs.WriteLog



        Total guess on my part, but it looks like it is complaining it has no routine writelog

        tenholde

        Well, that was interesting!

        Changing both "return null;" to "return 0;" and "hs. writelog" to "hs.WriteLog" -> system crash, had to pull the power to restart.

        Changing only "return null;" to "return 0;" -> no change, same error message.

        Changing only "hs.writelog" to "hs.WriteLog" -> new mahoosivly long message:

        Compiling script /usr/local/HomeSeer/scripts/TestScript.cs: {interactive}(50,8): error CS0433: The imported type `object' is defined multiple times Internal(1,1): warning CS1685: The predefined type `System.Object' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.ValueType' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Attribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Int32' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.UInt32' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Int64' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.UInt64' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Single' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Double' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Char' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Int16' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Decimal' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Boolean' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.SByte' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Byte' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.UInt16' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.String' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Enum' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Delegate' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.MulticastDelegate' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Void' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Array' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Type' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.IEnumerator' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.IEnumerable' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.IDisposable' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.IntPtr' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.UIntPtr' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.RuntimeFieldHandle' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.RuntimeTypeHandle' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Exception' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.ParamArrayAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.OutAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.ObsoleteAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.DllImportAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.MethodImplAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.MarshalAsAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.InAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.IndexerNameAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Diagnostics.ConditionalAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.CLSCompliantAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Security.Permissions.SecurityAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.RequiredAttributeAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.GuidAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyCultureAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyVersionAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyAlgorithmIdAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyFlagsAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyFileVersionAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.ComImportAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.CoClassAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.AttributeUsageAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.OptionalAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Security.UnverifiableCodeAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.DefaultCharSetAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.TypeForwardedToAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.FixedBufferAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.CompilerGeneratedAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.InternalsVisibleToAttribute ' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.RuntimeCompatibilityAttribu te' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Diagnostics.DebuggerHiddenAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.UnsafeValueTypeAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.UnmanagedFunctionPointerAttr ibute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.ExtensionAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.DefaultMemberAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.DecimalConstantAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.StructLayoutAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.FieldOffsetAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.TypedReference' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.ArgIterator' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.Generic.IEnumerable' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.Generic.IList' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.Generic.ICollection' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Nullable' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Threading.Tasks.Task' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Threading.Tasks.Task' is defined multiple times. Using definition from `mscorlib.dll'
        All three tests were done with only namespace "using System;" define.

        I agree with tenholde that it seems hs.writelog is not defined, but which? I haven't found any descriptions of available namespace definitions or libraries in the user documentation.

        I'm lost!
        Frode

        Comment


          #5
          More info:

          Tried a vb script also, but no luck.

          Sub Main()
          hs.writelog "test av utskrift"
          End Sub
          I also tried:

          using System
          Sub Main (parms As Object)
          bla bla bla

          but no difference. In both cases I got these error messages in the log:

          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: 'End Namespace' without 'Namespace'.
          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: Not valid as identifier.
          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: Not valid as identifier.
          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: Not valid as identifier.
          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: Expected end of statement.
          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: Expected 'End'.
          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: Expected end of statement.
          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: Expected 'End'.
          Dec-28 9:45:17 AM Error Compiling script /usr/local/HomeSeer/scripts/CopySingleValue.vb: Expected end of statement.
          At least it didn't crash the system this time.

          What puzzles me is that I copied both the vb script and the C# script straight from the user documentation for HS3. Aren't they supposed to work "as is"?

          Apart from creating these scripts I have not messed with any files, neither linux files nor HS files. I installed the image as per instructions, added a Razberry Z-wave controller and 5 Z-wave devices, added some simple events to use these devices and a testevent to test scripting as described above and in previous posts in this thread.

          Just a thought: do I have to include or modify anything prior to creating a script? I haven't seen anything in the documentation suggesting this.

          cheers

          Comment


            #6
            According to me you have to include the HS DLL's and reference them before you can access methodes like hs.writelog

            You need one or more of these DLL's
            HomeSeerAPI.dll
            HSCF.dll
            Scheduler.dll

            Here's a code snippet with some details how to do it in HS3 with is in my opinion a giant leap backwards in development!

            Remark: You probaly won't need HSCF

            Code:
            [FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] // HS3 related
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSCF.Communication.Scs.Communication;
            [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSCF.Communication.Scs.Communication.EndPoints.Tcp;
            [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSCF.Communication.ScsServices.Client;
            [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HomeSeerAPI;
            [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Scheduler;
            [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Scheduler.Classes;
              
            [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] namespace[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] AZ_CallerID
             {
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Tools
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
            [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IHSApplication[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] hs = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]hsapplication[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]();
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]clsHSPI[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] _plugin;
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]const[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] IFACE_NAME = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"AZ_CallerID"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2];
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IScsServiceClient[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]<[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IHSApplication[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]> _client;
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IScsServiceClient[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]<[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IAppCallbackAPI[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]> _clientCallback;
              
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Tools()
             {
             }
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] 
             [FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Homeseer
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSConnect()
             {
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSLocation = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ConfigurationManager[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].AppSettings[[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"HSLocation"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]];
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSPort = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Convert[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].ToInt32([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ConfigurationManager[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].AppSettings[[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"HSPort"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]]);
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]try
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
             _plugin = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]clsHSPI[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]();
             _client = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ScsServiceClientBuilder[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].CreateClient<[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IHSApplication[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]>([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ScsTcpEndPoint[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](HSLocation, HSPort), _plugin);
             _clientCallback = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ScsServiceClientBuilder[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].CreateClient<[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IAppCallbackAPI[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]>([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ScsTcpEndPoint[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](HSLocation, HSPort), _plugin);
             _client.Connect();
             _clientCallback.Connect();
             hs = _client.ServiceProxy;
             hs.Connect(IFACE_NAME, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]""[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] 0;
             }
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]catch
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] 1;
             }
             }
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] 
             [FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]<summary>
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] Control a device
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]</summary>
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]<param name="strDeviceName"></param>
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]<param name="Action"></param>
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] DoDevice([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Value, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] strText)
             {
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]try
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]var[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] dvRef = hs.GetDeviceRef([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"ZMC-W77"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
             hs.SetDeviceString(dvRef, strText, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
             hs.SetDeviceValue(dvPhoneID, Value);
             }
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]catch
            [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
             [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Console[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].WriteLine([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"Device "[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] + dvPhoneID + [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]" isn't avaulable in HS3"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
             WriteToLog([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"Device "[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] + dvPhoneID + [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]" isn't avaulable in HS3"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
             }
             }
             .... Rest of your code
              
            [/SIZE][/FONT][/SIZE][/FONT]
            - Bram

            Send from my Commodore VIC-20

            Ashai_Rey____________________________________________________________ ________________
            HS3 Pro 3.0.0.534
            PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

            Comment


              #7
              Does just this

              Code:
              Sub Main(ByVal Parms As Object)
              hs.writelog("test", "av utskrift")
              End Sub
              Work?

              I think you have some VBScript and VB.net mixed up.

              Comment


                #8
                Originally posted by mrhappy View Post
                Does just this

                Code:
                Sub Main(ByVal Parms As Object)
                hs.writelog("test", "av utskrift")
                End Sub
                Work?

                I think you have some VBScript and VB.net mixed up.
                This sort of work, but only the latter text "av utskrift" was added to the log. But at least no error messages and possibly a step further.

                However, I only tried the vb to see if ANY script will run. C# is where I want to be. How do I relate this to the cs script I started with?

                Comment


                  #9
                  Originally posted by cortinaman View Post
                  This sort of work, but only the latter text "av utskrift" was added to the log. But at least no error messages and possibly a step further.

                  However, I only tried the vb to see if ANY script will run. C# is where I want to be. How do I relate this to the cs script I started with?
                  writelog needs two arguments which is why the title will be test and the message written to the log is av utskrift. I have no idea about C# sorry.

                  Comment


                    #10
                    Originally posted by AshaiRey View Post
                    According to me you have to include the HS DLL's and reference them before you can access methodes like hs.writelog

                    You need one or more of these DLL's
                    HomeSeerAPI.dll
                    HSCF.dll
                    Scheduler.dll

                    Here's a code snippet with some details how to do it in HS3 with is in my opinion a giant leap backwards in development!

                    Remark: You probaly won't need HSCF

                    Code:
                    [FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] // HS3 related
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSCF.Communication.Scs.Communication;
                    [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSCF.Communication.Scs.Communication.EndPoints.Tcp;
                    [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSCF.Communication.ScsServices.Client;
                    [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HomeSeerAPI;
                    [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Scheduler;
                    [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] using[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Scheduler.Classes;
                      
                    [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff] namespace[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] AZ_CallerID
                     {
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Tools
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
                    [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IHSApplication[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] hs = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]hsapplication[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]();
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]clsHSPI[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] _plugin;
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]const[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] IFACE_NAME = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"AZ_CallerID"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2];
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IScsServiceClient[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]<[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IHSApplication[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]> _client;
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IScsServiceClient[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]<[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IAppCallbackAPI[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]> _clientCallback;
                      
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Tools()
                     {
                     }
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] 
                     [FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]#region[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Homeseer
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSConnect()
                     {
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSLocation = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ConfigurationManager[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].AppSettings[[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"HSLocation"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]];
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] HSPort = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Convert[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].ToInt32([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ConfigurationManager[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].AppSettings[[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"HSPort"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]]);
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]try
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
                     _plugin = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]clsHSPI[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]();
                     _client = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ScsServiceClientBuilder[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].CreateClient<[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IHSApplication[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]>([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ScsTcpEndPoint[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](HSLocation, HSPort), _plugin);
                     _clientCallback = [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ScsServiceClientBuilder[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].CreateClient<[/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]IAppCallbackAPI[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]>([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]new[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]ScsTcpEndPoint[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2](HSLocation, HSPort), _plugin);
                     _client.Connect();
                     _clientCallback.Connect();
                     hs = _client.ServiceProxy;
                     hs.Connect(IFACE_NAME, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]""[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] 0;
                     }
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]catch
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] 1;
                     }
                     }
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT] 
                     [FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]<summary>
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] Control a device
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]</summary>
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]<param name="strDeviceName"></param>
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]///[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000][FONT=Consolas][SIZE=2][COLOR=#008000] [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080][FONT=Consolas][SIZE=2][COLOR=#808080]<param name="Action"></param>
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] DoDevice([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] Value, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]string[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] strText)
                     {
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]try
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]var[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] dvRef = hs.GetDeviceRef([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"ZMC-W77"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
                     hs.SetDeviceString(dvRef, strText, [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]true[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
                     hs.SetDeviceValue(dvPhoneID, Value);
                     }
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff][FONT=Consolas][SIZE=2][COLOR=#0000ff]catch
                    [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] {
                     [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af][FONT=Consolas][SIZE=2][COLOR=#2b91af]Console[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2].WriteLine([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"Device "[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] + dvPhoneID + [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]" isn't avaulable in HS3"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
                     WriteToLog([/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]"Device "[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2] + dvPhoneID + [/SIZE][/FONT][/SIZE][/FONT][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515][FONT=Consolas][SIZE=2][COLOR=#a31515]" isn't avaulable in HS3"[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Consolas][SIZE=2][FONT=Consolas][SIZE=2]);
                     }
                     }
                     .... Rest of your code
                      
                    [/SIZE][/FONT][/SIZE][/FONT]

                    Interesting, thank you.
                    I will need some time to investigate and digest this

                    When you say "include the HS DLL's and reference them", does this mean I have to add dll files to the HS installation, does not Zee2 for Rasberry pi 2 come with all required files to utilize C# scripting? Or does it mean I have to list applicable dll's in my scripts? Or both? Every script file or a common reference file?

                    Comment


                      #11
                      When i re-read your post i noticed that i was thinking in the wrong direction. I was assuming that you wanted to make a C# program that could interface with HS hence my remark to include and reference the DLL's

                      Although i am a C# developer i prefer to use vbscript when making scripts in HS. Using C# for something simple is such a hassle.

                      Oke back to your problem.
                      C# is Case sensitive (it's a delicate language, just like a woman. Be carefull how you say it)

                      I brought your example back to the bare minimum and made it void
                      This will write to the log both the heading and the message
                      Code:
                       public void Main(Object[] parm)
                       {
                         hs.WriteLog("CSHARP","From C# TestScript");
                      }
                      Hope this helps
                      - Bram

                      Send from my Commodore VIC-20

                      Ashai_Rey____________________________________________________________ ________________
                      HS3 Pro 3.0.0.534
                      PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

                      Comment


                        #12
                        Originally posted by AshaiRey View Post
                        ...
                        ...
                        ...
                        I brought your example back to the bare minimum and made it void
                        This will write to the log both the heading and the message
                        Code:
                         public void Main(Object[] parm)
                         {
                           hs.WriteLog("CSHARP","From C# TestScript");
                        }
                        Hope this helps
                        Thanks.
                        It helps with my understanding, but I did not get the expected result.

                        Looking at the difference between your minimum code and the example from the user manual I notice that the manual example tries to return an object while it actually returns '0'. It seems the manual is not updated, which in effect makes current SW a beta release?

                        Running your code as the complete contents of my testscript I got these log entries:
                        Dec-31 9:02:39 AM Error Compiling script /usr/local/HomeSeer/scripts/TestScript.cs: {interactive}(11,18): error CS0433: The imported type `object' is defined multiple times
                        Dec-31 9:02:39 AM Event Running script in background: /usr/local/HomeSeer/scripts/TestScript.cs("Main")
                        Dec-31 9:02:39 AM Event Event Trigger "System TestScript"
                        Dec-31 9:02:39 AM Event Event System TestScript triggered by the event page 'Run' button.
                        It seems something more is going on then just getting the script right. Why would the imported type 'object' be defined multiple times? This also appeared in the previous error messages in combination with various other information.

                        As mentioned, I purchased and installed the HS3 image made for Rasberry pi 2 B, I have not modified any of the files in the installation apart from the testscripts I mentioned in previous posts.

                        From the 'About' page:
                        HomeSeer Version: HS3 ZEE S2 Edition 3.0.0.208 (Linux)
                        Happy new year to you all
                        cortinaman

                        Comment


                          #13
                          I did test this on a windows machine running HS3. It seems that de Zee and Linux handle C# scripts differently.
                          I have only one suggestion left and that is to try Main() instead of Main(Object[] parm)
                          If that don't work than i afraid that i can help you further.
                          - Bram

                          Send from my Commodore VIC-20

                          Ashai_Rey____________________________________________________________ ________________
                          HS3 Pro 3.0.0.534
                          PIugins: ZMC audio | ZMC VR | ZMC IR | ZMC NDS | RFXcom | AZ scripts | Jon00 Scripts | BLBackup | FritzBox | Z-Wave | mcsMQTT | AK Ikea

                          Comment


                            #14
                            Originally posted by AshaiRey View Post
                            ...
                            ...
                            I have only one suggestion left and that is to try Main() instead of Main(Object[] parm)
                            ...
                            ...
                            -> System crash

                            I think for the meantime I will have to try vb scripting for a few select tasks and hope this C# problems will iron out later.

                            Hopefully someone who succeeded in C# scripting on linux Zee will discover this thread and chip in.

                            Thanks to all of you for your tips and hints, it's been helpful even if I didn't get where I wanted yet.

                            cheers
                            cortinaman

                            Comment


                              #15
                              Hello,

                              I am trying to get the C# example script from the HS3 manual working and I bumped into a 2 pages of error log after running it. Then I ran it second time and it worked. I ran it then multiple times and it worked. However, when I rebooted my Debian machine and restarted HS3 it crashed again with the same long error in the log.
                              It looks like it crashes on first run and it works after that.
                              Does anyone else get this type of error?


                              this is the log of the error:

                              Compiling script /home/user/Applications/HomeSeer/scripts/pump_test.cs: {interactive}(11,8): error CS0433: The imported type `object' is defined multiple times {interactive}(15,5): error CS0433: The imported type `string' is defined multiple times {interactive}(15,16): error CS0433: The imported type `System.DateTime' is defined multiple times {interactive}(19,5): error CS0433: The imported type `System.Console' is defined multiple times Internal(1,1): warning CS1685: The predefined type `System.Object' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.ValueType' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Attribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Int32' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.UInt32' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Int64' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.UInt64' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Single' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Double' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Char' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Int16' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Decimal' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Boolean' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.SByte' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Byte' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.UInt16' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.String' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Enum' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Delegate' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.MulticastDelegate' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Void' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Array' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Type' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.IEnumerator' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.IEnumerable' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.IDisposable' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.IntPtr' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.UIntPtr' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.RuntimeFieldHandle' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.RuntimeTypeHandle' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Exception' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.ParamArrayAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.OutAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.ObsoleteAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.DllImportAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.MethodImplAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.MarshalAsAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.InAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.IndexerNameAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Diagnostics.ConditionalAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.CLSCompliantAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Security.Permissions.SecurityAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.RequiredAttributeAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.GuidAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyCultureAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyVersionAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyAlgorithmIdAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyFlagsAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.AssemblyFileVersionAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.ComImportAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.CoClassAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.AttributeUsageAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.OptionalAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Security.UnverifiableCodeAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.DefaultCharSetAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.TypeForwardedToAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.FixedBufferAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.CompilerGeneratedAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.InternalsVisibleToAttribute ' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.RuntimeCompatibilityAttribu te' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Diagnostics.DebuggerHiddenAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.UnsafeValueTypeAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.UnmanagedFunctionPointerAttr ibute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.ExtensionAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Reflection.DefaultMemberAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.CompilerServices.DecimalConstantAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.StructLayoutAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Runtime.InteropServices.FieldOffsetAttribute' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.TypedReference' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.ArgIterator' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.Generic.IEnumerable' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.Generic.IList' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Collections.Generic.ICollection' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Nullable' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Threading.Tasks.Task' is defined multiple times. Using definition from `mscorlib.dll' Internal(1,1): warning CS1685: The predefined type `System.Threading.Tasks.Task' is defined multiple times. Using definition from `mscorlib.dll' Mar-04 11:36:17 PM Event Running script in background: /home/user/Applications/HomeSeer/scripts/pump_test.cs
                              The script I am trying to manually run is:

                              public Object Main(Object[] parm) {
                              hs.WriteLog("CSHARP","From C# script");
                              String s = DateTime.Now.ToString("ddd");
                              hs.WriteLog("C#","Day: " + s);
                              Console.WriteLine("hello");
                              return null;
                              }

                              it looks very simple and if that can't properly run we have minimal chance in getting anything complex to work.

                              Cheers,

                              Luka

                              Comment

                              Working...
                              X