Environment
HomeSeer
OS
Windows
HS Version
v4.2.21.0
Development
PSDK Version
v1.4.3.0, v1.4.4.0 and v1.5.0.0
Language
C#
IDE
VS2022
Dev OS
Windows
Problem
Excessive Calls to OnNewTrigger/OnInstantiateTrigger for AbstractTriggerType and AbstractTriggerType2
Description
I've observed a strange and potentially problematic behavior with AbstractTriggerType and AbstractTriggerType2. The OnNewTrigger and OnInstantiateTrigger methods are being called an unusually high number of times during plugin initialization and when interacting with the Events page—for example, when configuring or viewing event actions.
To find number of calls at the time of plugin initialization, I logged the number of times OnInstantiateTrigger was invoked and consistently found it being called 844 times, regardless of how many times I restarted. This number appear to correlate with the number of devices + features in my system which is also 844.
For AbstractTriggerType, this excessive invocation only seems to occur when the trigger’s ConfigPage does not include any input elements. Or at least that is what I can deduce because, I had a ConfigPage with only a LabelView and the excessive invocation was consistent. However, as soon as I added an InputView, the excessive invocation stopped. With AbstractTriggerType2, the problem occurs unconditionally, regardless of the content in the config page.
To rule out interference from other parts of my plugin, I created a minimal version that includes only the trigger definitions, and the issue still persists. This behavior is particularly problematic for AbstractTriggerType2 because it requires rendering the entire configuration page with each call to OnInstantiateTrigger, which involves making multiple DB and HomeSeerSystem calls. As a result, the repeated calls introduce significant overhead and make AbstractTriggerType2 difficult to use in practical scenarios.
While I’ve also noticed a similar pattern with AbstractActionType, I haven’t explored it in detail yet, so this report focuses specifically on the triggers. Based on these findings, I believe this is likely a bug and would appreciate it if the team could investigate further.
Screenshots
AbstractTriggerType - With only LabelView


AbstractTriggerType - With an InputView


AbstractTriggerType2


Device Count

Expected Behavior
The methods should not be called soo many times.
Steps to Reproduce
- Create a fresh plugin with two triggers, one which implements
AbstractTriggerType and one which implements AbstractTriggerType2. In the ConfigPage of triggers keep only a LabelView with simple text.
- Start remote debugging for the plugin, go the Events page and create two events using each of the triggers.
- Once configured, add debugger or a console log to the AbstractTriggerType's
OnNewTrigger method and AbstractTriggerType2's OnInstantiateTrigger method.
- Restart the remote debugging for the plugin and you will see the debugger will hit continuously or many console logs being printed for both the triggers.
- Now, deleted the configured events and remove the debugger/console log. Instead of having a simple LabelView in the ConfigPage, add an InputView to the ConfigPage for both of the Triggers.
- Restart remote debugging for the plugin to reflect the changes, again configure two events as done previously and add debugger/console log as per previous steps.
- Restart remote debugging again. You will see that the debugger will not hit/console log will not be printed for
AbstractTriggerType but for the AbstractTriggerType2 it will same behavior as previous one.
Logs
Not Applicable
Environment
HomeSeer
OS
Windows
HS Version
v4.2.21.0
Development
PSDK Version
v1.4.3.0, v1.4.4.0 and v1.5.0.0
Language
C#
IDE
VS2022
Dev OS
Windows
Problem
Excessive Calls to OnNewTrigger/OnInstantiateTrigger for AbstractTriggerType and AbstractTriggerType2
Description
I've observed a strange and potentially problematic behavior with
AbstractTriggerTypeandAbstractTriggerType2. TheOnNewTriggerandOnInstantiateTriggermethods are being called an unusually high number of times during plugin initialization and when interacting with the Events page—for example, when configuring or viewing event actions.To find number of calls at the time of plugin initialization, I logged the number of times
OnInstantiateTriggerwas invoked and consistently found it being called 844 times, regardless of how many times I restarted. This number appear to correlate with the number of devices + features in my system which is also 844.For
AbstractTriggerType, this excessive invocation only seems to occur when the trigger’s ConfigPage does not include any input elements. Or at least that is what I can deduce because, I had a ConfigPage with only a LabelView and the excessive invocation was consistent. However, as soon as I added an InputView, the excessive invocation stopped. WithAbstractTriggerType2, the problem occurs unconditionally, regardless of the content in the config page.To rule out interference from other parts of my plugin, I created a minimal version that includes only the trigger definitions, and the issue still persists. This behavior is particularly problematic for
AbstractTriggerType2because it requires rendering the entire configuration page with each call toOnInstantiateTrigger, which involves making multiple DB and HomeSeerSystem calls. As a result, the repeated calls introduce significant overhead and makeAbstractTriggerType2difficult to use in practical scenarios.While I’ve also noticed a similar pattern with
AbstractActionType, I haven’t explored it in detail yet, so this report focuses specifically on the triggers. Based on these findings, I believe this is likely a bug and would appreciate it if the team could investigate further.Screenshots
AbstractTriggerType - With only LabelView
AbstractTriggerType - With an InputView
AbstractTriggerType2
Device Count
Expected Behavior
The methods should not be called soo many times.
Steps to Reproduce
AbstractTriggerTypeand one which implementsAbstractTriggerType2. In the ConfigPage of triggers keep only a LabelView with simple text.OnNewTriggermethod and AbstractTriggerType2'sOnInstantiateTriggermethod.AbstractTriggerTypebut for theAbstractTriggerType2it will same behavior as previous one.Logs
Not Applicable