No announcement yet.

Acceptable plugin startup time and returning an appropriate OnStatusCheck message

  • Filter
  • Time
  • Show
Clear All
new posts

    Acceptable plugin startup time and returning an appropriate OnStatusCheck message

    on a clean startup, my plugin may take up to 5-10 seconds if all goes well.

    hs4 doesn't seem to like that and sometimes posts an error message on the plugin tile on the plugins/manage page (instead of calling OnStatusCheck and getting my status)

    i tried starting on my own thread but that seemed to cause problems registering feature pages. maybe i should try this again

    what are you guys doing to make the OnStatusCheck return message useful?

    HS3 Pro
    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| Ultra1Wire3 | RFXCOM | NetCAM | HS MyQ | BLRadar | BLDenon | Jon00 Charting | Jon00 Links
    Platform: HP h8-1360t, Windows Server 2012 R2, i7-3.4GHz, 16GB memory

    First thing I do, is start a very short timer and do just the basic house keeping items that take no time, then immediately return to HS4. When the timer expires, I do all the heavy lifting such as discovering players (up to 30 seconds), create all the devices, check for inconsistencies etc. If anything goes wrong during that extended intialization period, I change the status and provide a warning or error.


      I register all pages (RegisterDeviceIncPage and RegisterFeaturePage), check for valid DotNet/Mono version, and if that is OK I start a new thread. Finally I set the status to PluginStatus.Ok.

      That is all my Initialize sub contains. Usually returns within a few milliseconds. If anything goes horribly wrong later I set the status to something like PluginStatus.Fatal.


        +1 For initialising plugin in a thread. I'm using Task.Factory.StartNew

        Click image for larger version

Name:	2022-05-16 (4).png
Views:	58
Size:	20.3 KB
ID:	1545582