Integration Protocol (AMX, Lutron, Crestron, Control4, Clipsal)
TapHome system is able to integrate with other systems through simple ASCII integration protocol. This enables other systems to get information and control TapHome devices.
Supported communication layers
- RS485
- TCP/IP
- UDP/IP
Protocol description
Protocol supports following commands: HELP, LIST, GET, SET, ACTION, HEADER, AUTOSEND
Every command must be terminated with CRLF (0x0D 0x0A, \r\n) characters.
Command HELP
Command HELP<\r><\n> will display basic information about supported commands. HEADER [ON/OFF] switch header information on or off.<\r><\n>
LIST display all exposed devices.<\r><\n>
GET [ID] get device with ID values.<\r><\n>
SET [ID ST VAL1 .. VALN] set device with ID status ST and values VAL1 to VALN.<\r><\n>
ACTION [ID NUM VAL] Perform on device with ID action number NUM with value VAL.<\r><\n>
PUSHALL [ON/OFF] switch push all devices change on or off.<\r><\n>
Command HEADER
Command HEADER<\r><\n> switch between two possible data output. If header is ON there are send description information together with data. In case header is off it are send only data. HEADER without parameters send information about actual switch state. HEADER ON will switch on header information. HEADER OFF will switch off header information.
Command LIST
Command LIST displays all exposed devices.
Displayed are following information:
Device ID is numerical device ID.
Device Type is text description of device type (Blind, Switch, ...).
Device Name as set in TapHome system.
Device Status as text information
LIST<\r><\n> command example output:
ID:137,Type:Blind,Name:Virtual blind,Status:OK<\r><\n>
ID:51,Type:Switch,Name:Ex Switch,Status:OK<\r><\n>
ID:2,Type:MultiValueSwitch,Name:Heating & Cooling,Status:OK<\r><\n>
ID:205,Type:PushButton,Name:Push button,Status:OK<\r><\n>
ID:242,Type:Dimmer,Name:Analog output,Status:OK<\r><\n>
ID:68,Type:Thermostat,Name:Thermostat 1,Status:UnknownError<\r><\n>
ID:145,Type:Variable,Name:KNXVariable,Status:OK<\r><\n>
ID:143,Type:Variable,Name:Sun azimuth,Status:OK<\r><\n>
Command GET
Command GET need one parameter - device ID. It returns device status and values as numbers. Example output of command GET 137<\r><\n>
ID:137,DeviceStatus:0,BlindsLevel:41,BlindsSlope:41<\r><\n>
Example when header is off:
137,0,41,41<\r><\n>
Command SET
Command SET need at least three parameters. First it is device ID, then new device status to be set and then at least one value to be set. For devices with more than one value all values should follow - for example blind require both parameters to be send - new level and new angle.
Example of output of command SET 137 0 35 80<\r><\n> with and then without header information:
ID:137,DeviceStatus:0,BlindsLevel:35,BlindsSlope:80<\r><\n>
137,0,35,80<\r><\n>
Command ACTION
Command action will execute action on device ID with send value. Actions are defined only for blinds. There are three actions number for blinds:
0 blind stop
1 adjust level from actual position +-value
2 adjust blind angle from actual position +-value
Example output of command ACTION 137 1 -20<\r><\n>:
ID:137,AdjustBlindsLevel:-20<\r><\n>
Command PUSHALL
Command PUSHALL will enable sending of all devices changes. Information are send in same format as response to command GET. Please note that when used on RS485 line there can be possible conflict on the bus which resolve to data mismatch. So we suggest to use this command only in full duplex lines / like RS232 or RS422. There is possible to switch it on also on RS485 line in systems where no SET command or ACTION commands will be used - this means only in monitoring systems. In RS485 lines where it is required SET and ACTION commands we suggest to use periodic pooling through command GET instead of automatic monitoring.
Address mode
When unique interface ID is set, than it is possible to use all command in address mode. In this mode the address header proceeding the command itself. Address headers is sequence!InterfaceID: where InterfaceID is set in interface configuration. Each answer line is than also proceeded with the same header. Only interface with correct address will answer - incorrect addressing can not be recognized by answer.
Example of address mode request with command !2:LIST<\r>:
klad_adresa;
For exposing devices in Integration protocol first go to Expose devices and choose Add new interface. From offered interfaces choose one of Integration protocol RS485, Integration protocol TCP or Integration protocol UDP:
After adding interface according to type fill other parameters. Set unique Interface ID for each interface if you want to use address mode.
Choose terminal for communication and fill communication parameters for RS485. Set all serial line parameters as required by connected client.
Set TCP port of slave interface:
Set UDP port of slave interface:
Then use Add device to add your devices in the exposed devices:
Choose device from list of offered devices. Please note that already added devices are shadowed.
After adding device it is displayed in list of devices for Integration protocol interface:
Click on device to display information about it, change automatically generated device ID, or delete device from exposed devices.
Debugging RS485 communication
For RS485 connections, it is possible to connect USB RS485 adapter to your PC. Requests and responses will be visible in console application.
Standard USB to RS485 converter
http://sk.farnell.com/ftdi/usb-rs485-we-1800-bt/cable-usb-rs485-serial-converter/dp/1740357
Note: this converter is not galvanically isolated, so you should connect GND of the converter with GND of Core.
Terminal software for Windows
How to set HTerm terminal
Note: If you want to see changes of TapHome devices in the console, use "PUSHALL ON" command.
For debugging TCP communication it is possible to use putty (https://putty.org/) terminal. Please use following settings for TCP connection:
First set the Connection type to Raw, then fill the IP address of Core and port set in exposed TCP Integration protocol settings.