Announcement

Collapse
No announcement yet.

HS3 Plugin Samples

Collapse
This is a sticky topic.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • I don't think so. I have the compiler set for any CPU. The computer I'm using as a development is 32-bit, running XP, while the target is a 64-bit. I do have Scheduler, Homeseerapi and HSCF are all
    copying local.

    Originally posted by beerygaz View Post
    Are you compiling for a 64-bit CPU? Scheduler.dll is 32-bit. Also, in your project references, do you have 'copy locall' set to true?
    Don

    Comment


    • Originally posted by donstephens View Post
      I don't think so. I have the compiler set for any CPU. The computer I'm using as a development is 32-bit, running XP, while the target is a 64-bit. I do have Scheduler, Homeseerapi and HSCF are all
      copying local.
      I had problems with CPU set for any. I have mine set for x86 on all my projects.

      I tend to have the output path local to my compiler and then run the PI from my compiler when I debug. Once I'm happy with a version I copy it manually to the HS3 directory and run it from there.
      Nicolai L

      Comment


      • If you're mixing CP architecture between release and debug platforms, especially when the HS3 assemblies are 32-bit only then you will run into issues.

        Try forcing 32-bit and try again?
        Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

        Comment


        • Why not?

          Will give it a go.
          Don

          Comment


          • i try to find out whitch sample is the best basis for my plugin.
            The problem is that i only can get the SAMPLE BASIC to work just a litlebit (Can't get furder at stap "Connected, waiting to be initialized..."
            The other 2 compile also fine, but when startup Homeseer the plugin get grayed out.

            I can't get the finger on the hotspot.
            Does anyone get the same bump? or even nicer a solution?

            *EDIT*
            Just select at PROJECT > COMPILE > TARGET CPU > X86
            Found in early post's
            Last edited by maikelwijnen; July 14th, 2014, 10:32 AM.

            Comment


            • Denon plugin

              Have you registered your plugin? There is no Com port selected.

              Comment


              • Hello
                I searched how to run code every minute in a plugin
                I searched the forum and samples plugins but I have not found
                thanks

                Comment


                • Originally posted by Aqua-Passion View Post
                  Hello
                  I searched how to run code every minute in a plugin
                  I searched the forum and samples plugins but I have not found
                  thanks
                  you just need to build a timer class
                  Mark

                  HS3 Pro 3.0.0.435
                  Hardware: Insteon Serial PLM | AD2USB for Vista Alarm | HAI Omnistat2 | 1-Wire HA7E | RFXrec433 | Dahua Cameras | LiftMaster Internet Gateway
                  Plugins: Insteon (mine) | Vista Alarm (mine) | Omnistat 3 (by Kirby) | Ultra1Wire3 | RFXCOM | NetCAM | MyQ | BLRadar | BLDenon | Jon00 Charting
                  Platform: HP h8-1360t, Windows Server 2012 R2, i7-3.4GHz, 16GB memory

                  Comment


                  • In your InitIO spawn a new thread which loops forever with Thread.Sleep(60000) in the loop.

                    If you want more accurate than that then look into using something like the Quartz .net library.


                    Sent from my iPad using Tapatalk Hd
                    Author of Highpeak Plugins | SMS-Gateway Plugin | Blue Iris Plugin | Paradox (Beta) Plugin | Modbus Plugin | Yamaha Plugin

                    Comment


                    • I had not thought so simple :-p
                      Thanks you very much for your help

                      Comment


                      • I have a strange thing with "HSPI_SAMPLE_BASIC"
                        when I enable it cpu go to about 40% it's ok
                        then i disable it , cpu go to 80%
                        re enable it , cpu load stay at 80 %
                        re disable it , cpu load go to 98 -100 %
                        someone else has the problem?

                        Comment


                        • I have the same thing with the "HSPI_SAMPLE" plugin

                          Comment


                          • Has anyone tried the sample_basic on their linux install as is. I have tried it on mine and for some reason when I fire it up and go to set an event triggered on recieve command (and select a value from the dropdown list of the SAMPLE-BASIC plugin, I get an error as per the below:

                            Exception deserializing message: Object reference not set to an instance of an object.

                            Has anyone seen this error with the sample plugin, and if so how did you resolve this error as I believe this is the same error I am seeing with my plugins and my Linux build but I have no idea what is causing it.

                            Many thanks!
                            HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

                            Facebook | Twitter | Flickr | Google+ | Website | YouTube

                            Comment


                            • I'm struggling with trying to serialize an action in buildUI. In the below example from Rick near the bottom it shows returning stringMultiReturn (which I guess is trigactioninfo with my serialized object tacked on to it). But I get the error Ret cannot be converted to type string. What am I doing wrong?


                              Originally posted by Rick Tinker View Post
                              For simplicity I will refer to just Triggers, but it is the same whether triggers or actions.

                              If DataIn is nothing or an array of 0 bytes, then you never gave anything to HS to store in DataOut, so I would expect deserialize to fail.

                              Here is how it works: When somebody changes something in TriggerBuildUI it causes TriggerProcessPostUI to be called. Let's say the user configured a trigger by entering into fields you put on the UI the values 'Widget' and 12345. You need to save those values because it is your trigger, so you have two ways you can do it. You can create YOUR own storage mechanism and use the information in strTrigActInfo such as the UID, the evRef, trigger number and sub trigger number as an index... or you can have HS3 store those values for you. To have HS3 store the values, you create some sort of object that is serializeable to hold the values the user entered, like this:
                              Code:
                              <Serializable()> _
                              Friend Class MyTriggerData
                                  Friend ProductName As String = ""
                                  Friend ProductSKU As Integer
                              End Class
                              Then, you put those values in the object like this:
                              Code:
                                      Dim MyData As New MyTriggerData
                                      MyData.ProductName = "Widget"
                                      MyData.ProductSKU = 12345
                              Then you serialize that object like this:
                              Code:
                                      Dim bteArray() As Byte = Nothing
                                      If Not SerializeObject(MyData, bteArray) Then Throw New Exception("Dag Nabbit, another error.")
                              Then you put the serialized object into the DataOut parameter of strMultiReturn like this:
                              Code:
                                      Dim Ret As New strMultiReturn
                                      Ret.sResult = ""                ' Empty return indicates success!
                                      Ret.TrigActInfo = TrigInfoIn    ' Trig info does not change, just pass through what we received...
                                      Ret.DataOut = bteArray
                              
                                      Return Ret

                              And now, each time BuildUI, TriggerFormatUI, and TriggerProcessPostUI are called, the DataIN will be populated with that byte array you stored. In TriggerProcessPostUI you can update/change it by again passing it as DataOut, but in the other functions you would deserialize it just so that you have the data to use in the function.

                              Make sense?

                              FYI... One other twist to deserialization which is commented in the procedure... In order for deserialization to know that the structure or object that the data is going into matches where it came from, you have to pass a non-null object TO deserialization, even though the purpose of calling that is to get an object back filled with information.

                              So you would think that you could call it like this:
                              Code:
                                      Dim MyData As MyTriggerData
                                      If Not DeSerializeObject(TrigInfoIn.DataIn, MyData) Then Throw New Exception("Oh Poo!")
                              but the way you REALLY need to call it is like this:
                              Code:
                                      Dim MyData As New MyTriggerData
                                      If Not DeSerializeObject(TrigInfoIn.DataIn, MyData) Then Throw New Exception("Oh Poo!")
                              If it ain't broke, don't fix it!

                              Comment


                              • I'm struggling with trying to serialize an action in buildUI. In the below example from Rick near the bottom it shows returning stringMultiReturn (which I guess is trigactioninfo with my serialized object tacked on to it). But I get the error Ret cannot be converted to type string. What am I doing wrong?
                                Where is your code?

                                Comment

                                Working...
                                X