Author: HCA Central Version: 2 Added to Library: 10-Nov-23 HCAVersion needed: 16 Keywords: Example Extra Info Link: Here
Package Description: HCA lets you create "classes" which lets you implement how your own devices operate. This is used to support Hubitat and SmartThings managed devices, TPLinc, and others. If you have a new protocol to implement then you can create your own class and in the implementation do whatever is needed to implement, ON, OFF, Set-to-percent, and get-status.
The link is to a technical note that described this in detail. This package can be used as a starting point for a class.
After importing this class you can add devices of type "Example Dim Device" and then open the program notes viewer, enable the viewer for this program, and see the actions of the class when you control the device from the UI, a schedule, or program.
Program Description: Example Class program for a dimmable device.
It doesn't communicate with hardware, so the operations are fast. For ON and OFF there is a 2 second delay to simulate real device communication.
In the ON case, if the Device is called "Home - MyDevice", the class reports an error to show an example of error handling.
Example: The class program isn't invoked directly but is called by HCA itself to handle ON, OFF, Set-Percent, Change-Percent, and Get-Status for devices of this type.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
DeviceName | Value | HCA Device Name | |
Device Id | Value | Device Id | |
code | Value | Class actione code | |
data | Value | Class action data |