Announcement

Collapse
No announcement yet.

HomeSeer Newbie C# Developement Question

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

  • HomeSeer Newbie C# Developement Question

    All,
    I have a C# utility dll that I wrote years ago in VS2010 that is used to determine which Jewish holiday if any, a date may be. There are various calendar conversion functions in there as well. This is important for scheduling purposes as depending on the calendar we would need to do different functions.

    I am absolutely new to HomeSeer and am not sure how to integrate this into the current framework. Can my C# dll simply be referenced by a script, in which case all i would need to do is feed it the date and do whatever in my script to set local variables? Do I need to convert this to a plugin, in which case is it as simple as using the C# plugin template to generate the framework and then just combine it with my existing code?

    How complicated can a C# script be? should I rewrite this as a C# script?

    FYI I am running the Linux version of HomeSeer on a RaspberryPi3 running Raspbian 8.0

    Any and all help is appreciated.


    Thanks
    Aaron

  • #2
    Hi Aaron, you should be able to reference it in a script, although I've only done this in Windows using dll's that are properly registered, so not sure if it would work under Raspbian. Was the dll compiled for Windows?

    Cheers
    Al
    HS 3.0.0.532: 1963 Devices 1141 Events
    Z-Wave 3.0.1.261: 122 Nodes on one Z-Net

    Comment


    • #3
      The dll was compiled in visual studios with compile set for any processor.

      Is there any documentation or examples that you can point me to?

      Thanks in advance....

      Comment


      • #4
        Looking at my scripts, I have only done this in vbscript, so you would need to change to vb.net or c# to work under linux. Here's a short snippet of a script that uses an external dll using the CreateObject method:

        Code:
        sub main()
        ' Requirements: Homeseer
        ' FreePop ActiveX Control (http://www.harm.net/freePOP/FreePOP_Full.zip)
        
        	Dim FreePOP
        	Set FreePOP = CreateObject("FreePOPControl.FreePOP")
        	FreePOP.POPTimeout = 20
        	FreePOP.POPPort = 110
        How complex are the functions to calculate the days? It might be easier to create functions in a script that do those calculations rather than trying to reference the dll.

        Cheers
        Al
        HS 3.0.0.532: 1963 Devices 1141 Events
        Z-Wave 3.0.1.261: 122 Nodes on one Z-Net

        Comment


        • #5
          This link may help: http://stackoverflow.com/questions/2...from-resources
          HS 3.0.0.532: 1963 Devices 1141 Events
          Z-Wave 3.0.1.261: 122 Nodes on one Z-Net

          Comment


          • #6
            You should be able to use the ScriptingReferences line in the settings.ini file and import it in a script, I know nothing about C# though in terms of how to do this. I would try a vb.net script first then you at least would know the referencing worked.
            My Plugins:

            Pushover 3P | DoorBird 3P | Current Cost 3P | Velleman K8055 3P | LAMetric 3P | Garadget 3P | Hive 3P |
            Yeelight 3P | Nanoleaf 3P

            Comment


            • #7
              I currently pass a date to one function that returns an array of values if a holiday exists for a particular day. That function calls a number of others which is why it would be a bit complex to put into a script. My intent is to call this function and then set a variable to true such as IsHolidayX and when implementing events check the second values. I will look into all suggestions and let you know what works.

              Thanks to all for their advice

              Comment

              Working...
              X