Class AbstractPlugin
public abstract class AbstractPlugin : IPlugin, ActionTypeCollection.IActionTypeListener, TriggerTypeCollection.ITriggerTypeListener
Inheritance
Implements
Inherited Members
Namespace: HomeSeer.PluginSdk
Assembly: PluginSdk.dll
The base implementation of the IPlugin interface.
It includes default implementations for most of the IPlugin members and wraps others with convenience methods and objects that make it simpler to interface with the HomeSeer system.
Once the containing plugin application is started, initiate a connection to the HomeSeer system by calling Connect(String[]).
All plugins (the HSPI class) should derive from this class.
Basic Usage
Define a class in your plugin called HSPI
that inherits from AbstractPlugin
and implement the required members:
AbstractPlugin.Id
AbstractPlugin.Name
AbstractPlugin.Initialize()
AbstractPlugin.OnSettingChange(string, AbstractView, AbstractView)
AbstractPlugin.BeforeReturnStatus()
AbstractPlugin.PostBackProc(string, string, string, int)
public class HSPI : AbstractPlugin {
public override string Id { get; } = "PLUGINID";
public override string Name { get; } = "PLUGINNAME"
public HSPI() { }
protected override void Initialize() {
//Initialize the starting state of the plugin
Status = PluginStatus.Ok();
}
protected override bool OnSettingChange(string pageId, AbstractView currentView, AbstractView changedView) {
//React to changes to your plugin settings
}
protected override void BeforeReturnStatus() {
//Update the status of your plugin before it is returned to HomeSeer
}
public override string PostBackProc(string page, string data, string user, int userRights) {
//React to HTTP POST methods sent to feature pages owned by this plugin
}
}
Constructors
View SourceAbstractPlugin()
Default constructor that initializes the Action and Trigger type collections
Declaration
protected AbstractPlugin()
Fields
View Source_client
Declaration
static IScsServiceClient<IHsController> _client
Field Value
Type | Description |
---|---|
HSCF.Communication.ScsServices.Client.IScsServiceClient<IHsController> |
_isShutdown
Declaration
bool _isShutdown
Field Value
Type | Description |
---|---|
System.Boolean |
_logDebug
Declaration
bool _logDebug
Field Value
Type | Description |
---|---|
System.Boolean |
HomeSeerPort
Declaration
const int HomeSeerPort = 10400
Field Value
Type | Description |
---|---|
System.Int32 |
SettingsSectionName
Default section name for storing settings in an INI file
Declaration
protected const string SettingsSectionName = "Settings"
Field Value
Type | Description |
---|---|
System.String |
Properties
View SourceAccessLevel
Return the access level of this plug-in. Access level is the licensing mode. Use the integer value corresponding to the EAccessLevel for your plugin
Declaration
public virtual int AccessLevel { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ActionCount
The number of unique event actions the plugin supports
Declaration
public int ActionCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
ActionTypes
The collection of action types that this plugin hosts for HomeSeer
Declaration
protected ActionTypeCollection ActionTypes { get; set; }
Property Value
Type | Description |
---|---|
ActionTypeCollection |
HasSettings
Whether the plugin has settings pages or not.
If this is TRUE, you must return valid JUI data in GetJuiSettingsPages()
Declaration
public virtual bool HasSettings { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
The default implementation should be sufficient for all purposes; returning TRUE if the Settings property contains pages or FALSE if it doesn't.
Override this and always return TRUE if you plan on adding settings pages to the collection later
HomeSeerSystem
An instance of the HomeSeer system
Declaration
protected IHsController HomeSeerSystem { get; }
Property Value
Type | Description |
---|---|
IHsController |
Id
Unique ID for this plugin, needs to be unique for all plugins.
Do NOT use special characters or spaces in your plugin ID
Declaration
public abstract string Id { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The ID is used throughout the HomeSeer platform to target this plugin specifically via URL or internal code. It is recommended to use the name of your plugin, removing special characters and spaces, as the ID to make it easy to match them with one-another.
IpAddress
The IP Address that the HomeSeer system is located at
Declaration
protected string IpAddress { get; set; }
Property Value
Type | Description |
---|---|
System.String |
LogDebug
Used to enable/disable internal logging to the console
When it is TRUE, log messages from the PluginSdk code will be written to the Console
Declaration
protected bool LogDebug { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
The name of the plugin
Do NOT use special characters in your plugin name with the exception of "-", ".", and " " (space).
This is used to identify your plug-in to HomeSeer and your users. Keep the name to 16 characters or less.
Declaration
public abstract string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Settings
The collection of settings pages for the plugin. See SettingsCollection for more information.
Declaration
protected SettingsCollection Settings { get; set; }
Property Value
Type | Description |
---|---|
SettingsCollection |
SettingsFileName
The name of the settings INI file for the plugin.
It is recommended to use [PLUGIN-ID].ini where [PLUGIN-ID] is the ID of this plugin
Declaration
protected virtual string SettingsFileName { get; }
Property Value
Type | Description |
---|---|
System.String |
Status
The current status of the plugin.
Default state is OK
Declaration
protected virtual PluginStatus Status { get; set; }
Property Value
Type | Description |
---|---|
PluginStatus |
Remarks
This property is often queried by HomeSeer before interfacing with the plugin during normal operation of the system to determine if it should continue making calls or report to the user that the plugin may be inoperable. This is also queried when users navigate to the plugin management page.
See Also
View SourceSupportsConfigDevice
Whether this plugin supports a device configuration page for devices created/managed by it
TRUE will cause HomeSeer to call GetJuiDeviceConfigPage() for devices this plugin manages. FALSE means HomeSeer will not call GetJuiDeviceConfigPage() for any devices
Declaration
public virtual bool SupportsConfigDevice { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
SupportsConfigDeviceAll
Whether this plugin supports a device configuration page for all devices
TRUE will cause HomeSeer to call GetJuiDeviceConfigPage() for every device. FALSE means HomeSeer will not call GetJuiDeviceConfigPage() for all devices
Declaration
public virtual bool SupportsConfigDeviceAll { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
SupportsConfigFeature
Whether this plugin supports a feature configuration page for features created/managed by it
TRUE will cause HomeSeer to call GetJuiDeviceConfigPage() for features this plugin manages. FALSE means HomeSeer will not call GetJuiDeviceConfigPage() for any features
Declaration
public virtual bool SupportsConfigFeature { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Remarks
Setting this to TRUE allows you to display a unique page for each feature instead of using a single page for the device and all of its features.
TriggerCount
The number of unique event triggers the plugin supports
Declaration
public int TriggerCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
TriggerTypes
The collection of trigger types that this plugin hosts for HomeSeer
Declaration
protected TriggerTypeCollection TriggerTypes { get; set; }
Property Value
Type | Description |
---|---|
TriggerTypeCollection |
Methods
View SourceActionBuildUI(TrigActInfo)
Called by the HomeSeer system when an event is in edit mode and in need of HTML controls for the user.
Declaration
public string ActionBuildUI(TrigActInfo actInfo)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | actInfo | Object that contains information about the action like current selections. |
Returns
Type | Description |
---|---|
System.String | HTML controls that need to be displayed so the user can select the action parameters. |
ActionConfigured(TrigActInfo)
Called by the HomeSeer system to verify that the configuration is valid and can be saved
Declaration
public bool ActionConfigured(TrigActInfo actInfo)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | actInfo | Object describing the action. |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the given action is configured properly; FALSE if the action shouldn't be saved |
ActionFormatUI(TrigActInfo)
Called by the HomeSeer system when an event action is finished being configured and needs to be displayed in an easy to read format.
Declaration
public string ActionFormatUI(TrigActInfo actInfo)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | actInfo | Object that contains information about the current configuration of the trigger. |
Returns
Type | Description |
---|---|
System.String | HTML representing easy to read text describing the action |
ActionProcessPostUI(Dictionary<String, String>, TrigActInfo)
Called by the HomeSeer system to process selections when a user edits your event actions.
Declaration
public EventUpdateReturnData ActionProcessPostUI(Dictionary<string, string> postData, TrigActInfo actInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | postData | A collection of name value pairs that include the user's selections. |
TrigActInfo | actInfo |
Returns
Type | Description |
---|---|
EventUpdateReturnData | Object the holds the parsed information for the action. HomeSeer will save this information for you in the database. |
ActionReferencesDevice(TrigActInfo, Int32)
Called by the HomeSeer system to determine if a specified device is referenced by a certain action.
Declaration
public bool ActionReferencesDevice(TrigActInfo actInfo, int dvRef)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | actInfo | Object describing the action. |
System.Int32 | dvRef |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the action references the device; FALSE if it does not |
BeforeReturnStatus()
Called immediately before the plugin returns its Status to HomeSeer.
Use this to analyze the current state of the plugin and update the Status accordingly.
Declaration
protected abstract void BeforeReturnStatus()
See Also
View SourceConnect(Int32)
Declaration
void Connect(int attempts)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | attempts |
Connect(String[])
Attempt to establish a connection to the HomeSeer system
This connection will be maintained as long as the program is running or until ShutdownIO() is called.
Declaration
public void Connect(string[] args)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | args | Command line arguments included in the execution of the program |
GetActionNameByNumber(Int32)
Return the name of the action given an action number
The name of the action will be displayed in the HomeSeer events actions list.
Declaration
public string GetActionNameByNumber(int actionNum)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | actionNum | The number of the action to get the name for |
Returns
Type | Description |
---|---|
System.String | The name of the action associated with the action number |
GetJuiDeviceConfigPage(Int32)
Called by the HomeSeer software to obtain a HS-JUI device or feature configuration page for a specific device or feature
Declaration
public virtual string GetJuiDeviceConfigPage(int devOrFeatRef)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | devOrFeatRef | The device or feature reference to get the page for |
Returns
Type | Description |
---|---|
System.String | A JSON serialized Jui.Page |
GetJuiSettingsPages()
Called by the HomeSeer software to obtain a list of settings pages
Declaration
public string GetJuiSettingsPages()
Returns
Type | Description |
---|---|
System.String | A SettingsCollection serialized to a JSON string |
GetSubTriggerCount(Int32)
Returns the number of sub triggers the plugin supports for the specified trigger number
Declaration
public int GetSubTriggerCount(int triggerNum)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | triggerNum | The number of the trigger to check |
Returns
Type | Description |
---|---|
System.Int32 | The number of sub triggers the specified trigger number supports |
GetSubTriggerNameByNumber(Int32, Int32)
The name of the sub trigger with the specified number of the trigger with the specified number
Declaration
public string GetSubTriggerNameByNumber(int triggerNum, int subTriggerNum)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | triggerNum | The number of the trigger to check |
System.Int32 | subTriggerNum | The number of the sub trigger to check |
Returns
Type | Description |
---|---|
System.String | The name of the sub trigger |
GetTriggerNameByNumber(Int32)
Return the name of the given trigger based on the specified trigger number
Declaration
public string GetTriggerNameByNumber(int triggerNum)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | triggerNum | The trigger number to get the name for |
Returns
Type | Description |
---|---|
System.String | The name of the trigger |
HandleAction(TrigActInfo)
Called by the HomeSeer system when an event is triggered and the plugin needs to carry out a specific action.
Declaration
public bool HandleAction(TrigActInfo actInfo)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | actInfo | Object describing the trigger and action. |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the action was executed successfully; FALSE if there was an error |
HasJuiDeviceConfigPage(Int32)
Called by HomeSeer Core to determine if a device or feature configuration page is available for a particular device or feature. Only called if SupportsConfigDevice or SupportsConfigFeature or SupportsConfigDeviceAll is set to TRUE.
Declaration
public virtual bool HasJuiDeviceConfigPage(int devOrFeatRef)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | devOrFeatRef | The Ref of the device |
Returns
Type | Description |
---|---|
System.Boolean | True if there is a page available, false if not. Returning True will cause HomeSeer Core to call GetJuiDeviceConfigPage(Int32) for the device or feature |
Remarks
Default behavior is to show a configuration page for every device when SupportsConfigDevice or SupportsConfigFeature or SupportsConfigDeviceAll is set to true. Adjust this behavior if the plugin only shows a configuration page for some, but not all, devices.
HsEvent(Constants.HSEvent, Object[])
When you wish to have HomeSeer call back in to your plug-in or application when certain events
happen in the system, call the RegisterEventCB procedure and provide it with event you wish to monitor.
See RegisterEventCB for more information and an example and event types.
The parameters are passed in an array of objects. Each entry in the array is a parameter. The number of entries depends on the type of event and are described below. The event type is always present in the first entry or params(0).
Declaration
public virtual void HsEvent(Constants.HSEvent eventType, object[] params)
Parameters
Type | Name | Description |
---|---|---|
Constants.HSEvent | eventType | The type of event that has occurred |
System.Object[] | params | The data associated with the event |
Initialize()
Called by the HomeSeer system to initialize the plugin.
This is the primary entry point for all plugins. Start the plugin and get it ready for use.
Declaration
protected abstract void Initialize()
InitIO()
Called by HomeSeer to initialize the plugin.
Perform all initialization logic in Initialize()
Declaration
public bool InitIO()
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the plugin started successfully; FALSE if it did not You should opt for throwing an exception that contains a detailed messaged over returning FALSE whenever possible. |
IsTriggerConfigValid(TrigActInfo)
Given a TrigActInfo object, detect if this trigger is configured properly
Declaration
public bool IsTriggerConfigValid(TrigActInfo trigInfo)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | trigInfo | The trigger info to validate |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the trigger is configured properly, FALSE otherwise |
LoadSettingsFromIni()
Loads the plugin settings saved to INI to Settings and saves default values if none exist.
Declaration
protected void LoadSettingsFromIni()
OnDeviceConfigChange(Page, Int32)
Called when there are changes to the device or feature config page that need to be processed and saved
Declaration
protected virtual bool OnDeviceConfigChange(Page deviceConfigPage, int devOrFeatRef)
Parameters
Type | Name | Description |
---|---|---|
Page | deviceConfigPage | A JUI page containing only the new state of any changed views |
System.Int32 | devOrFeatRef | The reference of the device or feature the config page is for |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the save was successful; FALSE if it was not You should throw an exception including a detailed message whenever possible over returning FALSE |
OnSettingChange(String, AbstractView, AbstractView)
Called when there is a change to a setting that needs to be processed
Declaration
protected abstract bool OnSettingChange(string pageId, AbstractView currentView, AbstractView changedView)
Parameters
Type | Name | Description |
---|---|---|
System.String | pageId | The ID of the page the view is on |
AbstractView | currentView | The state of the setting before the change |
AbstractView | changedView | The state of the settings after the change |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the change should be saved, FALSE if it should not You should throw an exception including a detailed message whenever possible over returning FALSE |
OnSettingPageSave(Page)
Called when there are changes to settings that need to be processed for a specific page.
Declaration
protected virtual void OnSettingPageSave(Page pageDelta)
Parameters
Type | Name | Description |
---|---|---|
Page | pageDelta | The page with view changes to be processed |
Exceptions
Type | Condition |
---|---|
System.Collections.Generic.KeyNotFoundException | Thrown when a view change targets a view that doesn't exist on the page |
OnSettingsLoad()
Called right before the data held in Settings is serialized and sent to HomeSeer.
Use this if you need to process anything when the plugin settings are loaded. Otherwise, it is typically unnecessary to override this. The SettingsCollection class automatically takes care of the JSON serialization/deserialization process.
Declaration
protected virtual void OnSettingsLoad()
OnShutdown()
Called right before the plugin shuts down.
Declaration
protected virtual void OnShutdown()
OnStatusCheck()
Called by the HomeSeer system to determine the status of the plugin.
Declaration
public PluginStatus OnStatusCheck()
Returns
Type | Description |
---|---|
PluginStatus | A PluginStatus object describing the state of the plugin |
See Also
View SourcePluginFunction(String, Object[])
Called by the HomeSeer system to run a plugin function by name using reflection
Declaration
public virtual object PluginFunction(string procName, object[] params)
Parameters
Type | Name | Description |
---|---|---|
System.String | procName | The name of the method to execute |
System.Object[] | params | The parameters to execute the method with |
Returns
Type | Description |
---|---|
System.Object | The result of the method execution |
PluginPropertyGet(String)
Called by the HomeSeer system to get the value of a property by name using reflection
Declaration
public virtual object PluginPropertyGet(string propName)
Parameters
Type | Name | Description |
---|---|---|
System.String | propName | The name of the property |
Returns
Type | Description |
---|---|
System.Object | The value of the property |
PluginPropertySet(String, Object)
Called by the HomeSeer system to set the value of a property by name using reflection
Declaration
public virtual void PluginPropertySet(string propName, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | propName | The name of the property |
System.Object | value | The new value of the property |
PostBackProc(String, String, String, Int32)
Called by the HomeSeer system when a page owned by this plugin receives an HTTP POST request
Declaration
public virtual string PostBackProc(string page, string data, string user, int userRights)
Parameters
Type | Name | Description |
---|---|---|
System.String | page | The page that received the POST request |
System.String | data | The data included in the request |
System.String | user | The user responsible for initiating the request |
System.Int32 | userRights | The user's rights |
Returns
Type | Description |
---|---|
System.String | A string of data that is returned to the requester |
SaveJuiDeviceConfigPage(String, Int32)
Save updated values for a HS-JUI formatted device or feature config page
Declaration
public bool SaveJuiDeviceConfigPage(string pageContent, int devOrFeatRef)
Parameters
Type | Name | Description |
---|---|---|
System.String | pageContent | A JSON serialized Jui.Page describing what has changed about the page |
System.Int32 | devOrFeatRef | The reference of the device or feature the config page is for |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the save was successful; FALSE if it was unsuccessful. An exception should be thrown with details about the error if it was unsuccessful |
SaveJuiSettingsPages(String)
Called by the HomeSeer system when settings changes need to be saved
Declaration
public bool SaveJuiSettingsPages(string jsonString)
Parameters
Type | Name | Description |
---|---|---|
System.String | jsonString | A List of Jui.Pages containing views that have changed, serialized as JSON |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the save was successful; FALSE if it was unsuccessful. An exception should be thrown with details about the error if it was unsuccessful |
SetIOMulti(List<ControlEvent>)
Called by the HomeSeer system when a device that this plugin owns is controlled.
A plugin owns a device when its Interface property is set to the plugin ID.
Declaration
public virtual void SetIOMulti(List<ControlEvent> colSend)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<ControlEvent> | colSend |
Remarks
The default behavior is to clear the current status text and set the value on the target feature and then let HomeSeer assign the status text based on the configured StatusControls and StatusGraphics
ShutdownIO()
Called by the HomeSeer system to shutdown the plugin and its operations
Declaration
public void ShutdownIO()
SpeakIn(Int32, String, Boolean, String)
If your plug-in is registered as a Speak proxy plug-in, then when HomeSeer is asked to speak something. It will pass the speak information to your plug-in using this procedure. When your plug-in is ready to do the actual speaking, it should call SpeakProxy, and pass the information that it got from this procedure to SpeakProxy. It may be necessary or a feature of your plug-in to modify the text being spoken or the host/instance list provided in the host parameter - this is acceptable.
Declaration
public virtual void SpeakIn(int speechDevice, string spokenText, bool wait, string host)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | speechDevice | This is the device that is to be used for the speaking. In older versions of HomeSeer, this value was used to indicate the sound card to use, and if it was over 100, then it indicated that it was speaking for HomeSeer Phone (device - 100 = phone line), or the WAV audio device to use. Although this is still used for HomeSeer Phone, speaks for HomeSeer phone are never proxied and so values >= 100 should never been seen in the device parameter. Pass the device parameter unchanged to SpeakProxy. |
System.String | spokenText | This is the text to be spoken, or if it is a WAV file to be played, then the characters ":" will be found starting at position 2 of the string as playing a WAV file with the speak command in HomeSeer REQUIRES a fully qualified path and filename of the WAV file to play. |
System.Boolean | wait | This parameter tells HomeSeer whether to continue processing commands immediately or to wait until the speak command is finished - pass this parameter unchanged to SpeakProxy. |
System.String | host | This is a list of host:instances to speak or play the WAV file on. An empty string or a single asterisk (*) indicates all connected speaker clients on all hosts. Normally this parameter is passed to SpeakProxy unchanged. |
Remarks
PLEASE NOTE: Code related to the Speech components in HomeSeer were ported from the HS3 plugin API and have not been fully tested to verify full functionality from the new SDK. The Speech API may undergo significant changes in the near future. Please use with caution.
TriggerBuildUI(TrigActInfo)
Called by the HomeSeer system when an event is in edit mode and in need of HTML controls for the user.
Declaration
public string TriggerBuildUI(TrigActInfo trigInfo)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | trigInfo | Object that contains information about the current configuration of the trigger. |
Returns
Type | Description |
---|---|
System.String | HTML controls that need to be displayed so the user can select the trigger parameters. |
TriggerCanBeCondition(Int32)
Called by HomeSeer to determine if a given trigger can also be used as a condition
Declaration
public bool TriggerCanBeCondition(int triggerNum)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | triggerNum | The number of the trigger to check |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the given trigger can also be used as a condition, for the given trigger number. |
TriggerFormatUI(TrigActInfo)
Called by the HomeSeer system when an event trigger is finished being configured and needs to be displayed in an easy to read format.
Declaration
public string TriggerFormatUI(TrigActInfo trigInfo)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | trigInfo | Object that contains information about the current configuration of the trigger. |
Returns
Type | Description |
---|---|
System.String | HTML representing easy to read text describing the trigger |
TriggerProcessPostUI(Dictionary<String, String>, TrigActInfo)
Called by the HomeSeer system to process selections when a user edits your event triggers.
Declaration
public EventUpdateReturnData TriggerProcessPostUI(Dictionary<string, string> postData, TrigActInfo trigInfoIn)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | postData | A collection of name value pairs that include the user's selections. |
TrigActInfo | trigInfoIn | Object that contains information about the trigger. |
Returns
Type | Description |
---|---|
EventUpdateReturnData | Object the holds the parsed information for the trigger. HomeSeer will save this information for you in the database. |
TriggerReferencesDeviceOrFeature(TrigActInfo, Int32)
Called by the HomeSeer system to determine if a specified device is referenced by a certain trigger.
Declaration
public bool TriggerReferencesDeviceOrFeature(TrigActInfo trigInfo, int devOrFeatRef)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | trigInfo | Object describing the trigger. |
System.Int32 | devOrFeatRef | The reference ID of the device or feature to check |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the trigger references the device; FALSE if it does not |
TriggerTrue(TrigActInfo, Boolean)
Called by HomeSeer when a trigger needs to be evaluated as a condition
Declaration
public bool TriggerTrue(TrigActInfo trigInfo, bool isCondition = false)
Parameters
Type | Name | Description |
---|---|---|
TrigActInfo | trigInfo | Object describing the trigger |
System.Boolean | isCondition | TRUE if the trigger represents a condition, FALSE if it is a trigger |
Returns
Type | Description |
---|---|
System.Boolean | TRUE if the conditions are met; FALSE if they are not |
UpdateStatusNow(Int32)
Called by the HomeSeer system when it needs the current status for a device/feature owned by the plugin.
This should force the device/feature to update its current status on HomeSeer.
Declaration
public virtual EPollResponse UpdateStatusNow(int devOrFeatRef)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | devOrFeatRef | The reference ID of the device/feature to poll |
Returns
Type | Description |
---|---|
EPollResponse | An EPollResponse describing the result of the request |