Announcement

Collapse
No announcement yet.

Introducing AK Smart Device plugin for HomeSeer

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

    #31
    Here is an example of one of my event for my occupancy device
    Attached Files

    Comment


      #32
      Thank guys for helping. I was going to suggest manual install @MattL0, but then it will be impossible to reproduce the problem. I'm still setting up Ubuntu VM...

      Comment


        #33
        Originally posted by alexbk66 View Post
        Thank guys for helping. I was going to suggest manual install @MattL0, but then it will be impossible to reproduce the problem. I'm still setting up Ubuntu VM...
        That’s why I waited ...But wanna test the plugin at the same time haha.

        But , if you send me the v1.0.0.2 I can test the install process

        Comment


          #34
          Originally posted by MattL0 View Post
          So, is it possible to impose a condition '' fire only when the target device doesn't have the targeted value''?
          It shouldn't. I check internally stored cached value:
          Code:
           
           if (this.ValueCached != state && state!=null)    this.Value = (double)state;
          And I update cached value on start-up and if configuration is changed

          Comment


            #35
            Originally posted by MattL0 View Post
            Here is an example of one of my event for my occupancy device
            Even if checking cached value doesn't work (don't know why it wouldn't) - you can use "enforced" trigger, if my help doc and youtube video not sufficient - I can provide more details.

            Comment


              #36
              And there's Feature Requests topic for that

              Comment


                #37
                I still can't get the bloody installer working on Linux. Problems (installer.txt) were:
                1. File name in capitals - INSTALLER.TXT
                2.Then forward slashes in file names.
                3 Then Windows line endings

                Now I get "Install of package AK Smart Device was successful" - but it only installs the exe file, no bin dependencies.
                Another possibility is that HS creates the folder in Updates3 "AK Smart Device1.0.0.2" - with spaces, so I guess they use "AssemblyTitle" from AssemblyInfo no idea why?
                So now after whole day wasted I really hate HomeSeer!

                Comment


                  #38
                  Update is "successful" - but no files are installed?
                  Feb-21 7:28:31 AM Updater Install/Update of package AK Smart Device was successful.
                  Feb-21 7:28:30 AM Updater Installing package AK Smart Device
                  Feb-21 7:28:30 AM Updater Using local file: AKSmartDevice_1_0_0_2.zip
                  Feb-21 7:28:30 AM Updater Downloading update: AK Smart Device
                  Feb-21 7:28:30 AM Updater Starting download of updates
                  Feb-21 7:28:24 AM Warning Using updater override file: updater_override.txt for updates!

                  Comment


                    #39
                    Originally posted by alexbk66 View Post
                    I still can't get the bloody installer working on Linux. Problems (installer.txt) were:
                    1. File name in capitals - INSTALLER.TXT
                    2.Then forward slashes in file names.
                    3 Then Windows line endings

                    Now I get "Install of package AK Smart Device was successful" - but it only installs the exe file, no bin dependencies.
                    Another possibility is that HS creates the folder in Updates3 "AK Smart Device1.0.0.2" - with spaces, so I guess they use "AssemblyTitle" from AssemblyInfo no idea why?
                    So now after whole day wasted I really hate HomeSeer!
                    1. file should be 'install.txt' lower case.
                    2. To ensure Windows/Linux compatibility also use lower case and no spaces. Use '-' or '_' if you really need a space. Or use camelCase if necessary
                    3. Keep names/paths/casing very consistent

                    HomeSeer has a builtin mechanism to convert the "" to "/" for paths so don't put too much focus on that but more on keeping naming/case consistent.

                    Sometimes the packaging of the plugin and getting that correct is harder than writing the plugin!!

                    Comment


                      #40
                      That's what I don't understand... Ok, lower case install.txt, no spaces, I even removed spaces for AssemblyInfo "AssemblyTitle", Linux line endings...

                      Code:
                      ,[CHECKVERSION],3.0.0.13
                      HSPI_AKSmartDevice.exe,.,0
                      HSPI_AKSmartDevice.exe.config,.,0
                      CommandLine.dll,./bin/AKSmartDevice,0
                      Hspi.dll,./bin/AKSmartDevice,0
                      AKSmartDeviceVer1.pdf,./Docs/AKSmartDevice,0
                      AKSmartDeviceVer1.htm,./html/AKSmartDevice,0
                      AKSmartDeviceVer1_files.zip,[UNZIPOVER],./html/AKSmartDevice
                      youtube.png,./html/AKSmartDevice,0
                      What I get in HS window printout:

                      Code:
                      12:56:12:4417:[Updater]->Downloading update: AKSmartDevice
                      12:56:12:4419:[Updater]->Using local file: AKSmartDevice_1_0_0_2.zip
                      12:56:12:4420:[Updater]->Installing package AKSmartDevice
                      UPDATER Read section: [CHECKVERSION]
                      12:56:12:8830:[Updater]->Install/Update of package AKSmartDevice was successful.
                      It doesn't seem to go past first line? Why???

                      Comment


                        #41
                        Majority of the install.txt's out there have MS style (CRLF) line terminators rather than Linux style (LF). You might try that.

                        Comment


                          #42
                          I notice in my install.txt that the first line is different from yours (also other lines...), maybe worth a try? Don't remember why - too long ago - , but do remember I had a struggle too wrapping my head around it

                          Code:
                          xxxx,[CHECKVERSION],3.0.0.96
                          JowiHue.pdf,.\Docs,0
                          JowiHue.pdf,.\html\jowihue,0
                          JowiHueImports.xml,.\Config,0
                          JowiHue.db,.\Data\JowiHue,16
                          JowiHue_images.zip,[UNZIPOVER],.\html\images\JowiHue
                          Newtonsoft.Json.dll,.\bin\JowiHue,0
                          WebSocket4Net.dll,.\bin\JowiHue,0
                          HSPI_JowiHue.exe,.,0
                          HSPI_JowiHue.exe.config,.,0
                          -- Wim

                          Plugins: JowiHue, RFXCOM, Sonos4, Jon00's Perfmon and Network monitor, EasyTrigger, Pushover 3P, rnbWeather, BLBackup, AK SmartDevice, Pushover, PHLocation, Zwave, GCalseer, SDJ-Health, Device History, BLGData

                          1210 devices/features ---- 392 events ----- 40 scripts

                          Comment


                            #43
                            I think w.vuyk is correct. This is direct from the SDK (https://homeseer.com/support/homesee.../default.htm):

                            Code:
                            xxxx,[CHECKVERSION],1.6.0.182
                            ignore the version, I just pulled the example directly from the SDK

                            Comment


                              #44
                              Originally posted by sirmeili View Post
                              I think w.vuyk is correct. This is direct from the SDK (https://homeseer.com/support/homesee.../default.htm):
                              Code:
                              xxxx,[CHECKVERSION],1.6.0.182
                              Documentation says "Parameter 1: ﴾not used﴿" - so it doesn't matter.

                              Anyways, I fixed the installer. The problem was using forward slashes in install.txt - HS doesn't understand forward slashes even on Linux?

                              And HS should display an error if it's confused, not just "Install was successful"!

                              Thank you everybody! It was bloody rough day (and night).

                              Comment


                                #45
                                Originally posted by MattL0 View Post
                                The plugin seems to have a high cpu time number
                                what command do you use to get this? I'm not Linux expert.

                                The plugin doesn't normally consume CPU, I designed (and profiled) the plugin with performance in mind. My Device class uses Observer Design Pattern - so each device subscribes to trigger devices notifications. When the trigger device value changes - I don't search in the loop for affected devices. The state change is directly propagated to all subscribed devices.

                                The subscription process happens when plugin starts (and when you update trigger configuration) - but it's done in backgroun using Task.Factory.
                                It's possible if you have many devices that initial update takes CPU because I iterate every device in the system to check which one is used by the plugin. But again it should happen in a thread - which is configurable - please check in log if you get "UpdateConfiguration: scheduled".

                                If you enable log (per device, there's no global setting) - you can see timing info (and subscriptions) in the log i.e. for RefID 20:
                                Feb-22 12:54:26 AK Smart Device [20]: Duration 'ConfigDevice Triggers': 36 ms. (14 ms.)
                                Feb-22 12:54:26 AK Smart Device Duration 'deviceutility': 22 ms.
                                Feb-22 12:54:26 AK Smart Device [20]: Duration 'UpdateConfiguration': 9 ms:
                                Feb-22 12:54:26 AK Smart Device [20]: 20: [Controlled] [AK Smart Device], timer: True, Value: 100, observers: [20]
                                Feb-22 12:54:26 AK Smart Device [20]: 38: [Screen] [AK PCUtils], timer: False, Value: 0, observers: [20]
                                Feb-22 12:54:26 AK Smart Device [20]: 14: [New Device1] [AK Smart Device], timer: False, Value: 53, observers: [20]
                                Feb-22 12:54:26 AK Smart Device [20]: 15: [New Device2] [AK Smart Device], timer: True, Value: 0, observers: [15]
                                Feb-22 12:54:26 AK Smart Device [20]: SubscribeTo: (Ref: 20) Controlled (On (Screen))
                                Feb-22 12:54:26 AK Smart Device [20]: SubscribeTo: (Ref: 38) Screen (Off)
                                Feb-22 12:54:26 AK Smart Device [20]: SubscribeTo: (Ref: 14) New Device1 (Value53)
                                Feb-22 12:54:26 AK Smart Device [20]: Device used by 'Controlled': 14 38 20
                                Feb-22 12:54:26 AK Smart Device [20]: UpdateConfiguration: started
                                Feb-22 12:54:26 AK Smart Device [20]: Duration 'ConfigDevicePost': 29 ms.
                                Feb-22 12:54:26 AK Smart Device [20]: UpdateConfiguration: scheduled

                                Comment

                                Working...
                                X