Creating Devices

To create a device in your plug-in, you can use the same hs commands that you use in scripts.  However, to create an I/O device which is typically owned by a plug-in, then there are some special commands you would use to accomplish this.

 

First, if you do not already have a house code for use with your plug-in devices, call GetNextFreeIOCode to obtain it.

 

Create at least one device so HomeSeer does not assign the house code to another plug-in.

 

When you create your device(s), keep the following in mind:

&h4000 = This device, when its status is changed, calls SetIO/SetIOEx in the plug-in that owns it.
&h8000 = This device, when its value is changed, should call SetIO/SetIOEx in the plug-in that owns it.