Controlling multiple KMTronic Relays Boards by Node-RED
Node-RED Example
https://github.com/kmtronic-ltd/node-red-example/
This is a node-red flow for controlling a couple of a KMTronic TCP Web Switch including and a Temperature Monitor
Node-Red https://nodered.org/
This flow requires from the Pallet Manager
Dashboard - node-red-dashboard
Every HTTP request will have to be edited with the IP address of your KMTronic WEB Switch (not UDP switch). Change 192.168.110.206,212 and 202 to the address of your KMTronic board/boards. If you don't have more than one board you can remove the rest.
Switch 6 is a PTT switch and by pressing it, it will toggle on Switch 6 for 1 second - you can delete it if not required
In the initial setup of your KMtronic switch turn off any authentication.
Credits Michael Walker
Control KMtronic USB relays using AutoHotkey script
info.kmtronic.com/software/AutoHotkey/kmtronic-autohotkey.zip
Q Light Controller Plus DMX
Connect DMX adapter to PC.
If Windows ask for drivers download and install from here:
http://www.ftdichip.com/Drivers/D2XX.htm
If drivers are installed correctly you must see "USB Serial Converter" in Device Manager
Download and install Q Light Controller Plus from
Run Q Light Controller Plus and click on + button to add a fixture
When you are ready with adding the correct fixture go to Inputs/Outputs
Find DMX USB -> KMTronic DMX Interface and check the tick on Output
Now you can go to Simple Desk to manualy control the fixture
You can find this in our eBay shop.
Control KMtronic WEB Relays by Arduino
/*
Web client
Circuit:
* Ethernet shield attached to pins 10, 11, 12, 13
created 18 Dec 2009
by David A. Mellis
modified 9 Apr 2012
by Tom Igoe, based on work by Adrian McEwen
*/
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address for your controller below.
// Newer Ethernet shields have a MAC address printed on a sticker on the shield
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
// if you don't want to use DNS (and reduce your sketch size)
// use the numeric IP instead of the name for the server:
IPAddress server(192,168,1,199); // numeric IP for Google (no DNS)
// Set the static IP address to use if the DHCP fails to assign
IPAddress ip(192, 168, 1, 177);
// Initialize the Ethernet client library
// with the IP address and port of the server
// that you want to connect to (port 80 is default for HTTP):
EthernetClient client;
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
// start the Ethernet connection:
if (Ethernet.begin(mac) == 0) {
Serial.println("Failed to configure Ethernet using DHCP");
// try to congifure using IP address instead of DHCP:
Ethernet.begin(mac, ip);
}
// give the Ethernet shield a second to initialize:
delay(1000);
Serial.println("connecting...");
// if you get a connection, report back via serial:
if (client.connect(server, 80)) {
Serial.println("connected");
// Make a HTTP request:
client.println("GET /FF0101 HTTP/1.1");
client.println("Host: 192.168.1.206");
client.println("Authorization: Basic YWRtaW46YWRtaW4=");
client.println("Connection: close");
client.println();
} else {
// if you didn't get a connection to the server:
Serial.println("connection failed");
}
}
void loop() {
// if there are incoming bytes available
// from the server, read them and print them:
if (client.available()) {
char c = client.read();
Serial.print(c);
}
// if the server's disconnected, stop the client:
if (!client.connected()) {
Serial.println();
Serial.println("disconnecting.");
client.stop();
// do nothing forevermore:
while (true);
}
}
Domoticz Home Automation System
Domoticz is a very light weight home automation system that lets you monitor and configure miscellaneous devices, including lights, switches, various sensors/meters like temperature, rainfall, wind, ultraviolet (UV) radiation, electricity usage/production, gas consumption, water consumption and many more. Notifications/alerts can be sent to any mobile device.
Free / Open Source
Linux / Windows / Embedded Devices
Supported by Domoticz
LAN Ethernet IP 8 channels WEB Relay board
RS485 8 channels Relay board
Domoticz lua script to convert XML output from KMTronic DS1820 LAN module
info.kmtronic.com/domoticz-lua-script-to-convert-xml-output-from-kmtronic-ds1820-lan-module.html
Control4 drivers for KMtronic products
Home Automation and Smart Home Systems
www.control4.com
A home automation system from Control4
can turn your home into a smart home.
Control4 KMtronic Web Temperature Monitor Driver by Soft.Kiwi
Driver features
Support for up to 4 DS18B20 sensors.
Connection to the free Yatun software thermostat driver.
Integration of the temperature measure as a Control4 variable.
Driver Manual:
http://c4.soft.kiwi/documents/Manual_KMtronic_Temperature_v1.0.pdf
More information:
http://c4.soft.kiwi/kmtronic.html
Control4 KMtronic Web Temperature Monitor Driver by Soft.Kiwi
Driver features
Relay integration as connections with trigger and toggle functions.
Support for multiple relay boards connected to the same C4 control unit.
8 TCP/IP controlled relays (250VAC/10A or 125VAC/15A).
Driver Manual:
http://c4.soft.kiwi/documents/Manual_KMtronic_Realys_v1.0.pdf
More information:
http://c4.soft.kiwi/kmtronic.html
KMtronic RS232 Relay Board Control4 Driver License by T4Control
Driver features
This driver allows you to control the 8 relay device from KMTronic in the Control4 System. With bindings for the 8 relays, simply connect to the Generic Relay driver you want to use and from the Control4 UI you will be able to open and close each zone.
- Free 24 hour trial period - no license key needed!
- 8 relay bindings for individual control
- Easy to use, simply connect via RS232 or IP
- Relay state variables for enhanced programming capabilities
This driver allow you to control the 8 relay device from KMTronic
All the relay control is done by executing commands.
Use the Programming tab on Composer to execute the commands.
Compatibility:
--------------
KMTronic LAN Board:
+ compatible with all Control4 controllers
KMTronic RS232 Board:
+ compatible with HC-250 and IO Extenders
+ Problems reported on HC-800 controllers.
Properties:
-----------
- Connection Type: shows the current control port (SERIAL or IP). This is set by connecting the RS232 port. If the port is not connected the driver is set on IP mode.
- Web Address: url of the LAN board. Format: http://BOARD-IP (LAN BOARD ONLY)
- Login: credential to access board web page (LAN BOARD ONLY)
- Password: credential to access board web page (LAN BOARD ONLY)
- Pool Interval (s): interval in seconds to pool the current relays state. 0 seconds disable the pooling (LAN BOARD ONLY)
- Normal state of the relays: set the state CLOSED or OPENED for the relay when it has no power on it.
- Debug Mode: set to print and send the information to the developer in order to troubleshoot
Commands:
---------
- UPDATE_STATUS: get current relays state (LAN BOARD ONLY)
- ALL_RELAYS_COMMAND: change the state of the 8 relays at same time.
Usage Instructions:
--------------------
1) Connect the RS232 to use serial port (Serial boards model) or do not connect for IP boards.
2) Connect the relays to this driver
3) Control the relays via programming or MyHome application
Variables:
----------
- RELAY1_STATE to RELAY8_STATE: current relay state (CLOSED or OPENED)
Developer:
----------
T4Control Inc.
www.t4control.com
More information:
https://www.houselogix.com/shop/kmtronic-8-relay-board-control4-driver-license
Setting UDP RF433MHz Relays
UDP RF433MHz Transmitter
1. Open UDP RF433MHz Transmitter "PIN Configuration" menu
2. Enter your PIN code (in example 1234) and ckick Save
3. Turn OFF (up) all DIP Switches RF433MHz Relay board (PIN SET MODE)
4. Download and run UDP Test software
http://info.kmtronic.com/kmtronic-udp-test-software.html
5. Enter IP, Port, Command FF0101, click on Open and next Send
Software must receive reply from board
6. Turn ON (down) DIP Switch '1' RF433MHz Relay board
7. Click on Send again and Relay1 will turn ON
Software will receive reply from board that Relay1
RF 433MHz Relays commands
ON Command | OFF Command | ||||||
DEC | HEX | DEC | HEX | ||||
Relay Board ID:01 | Relay 1 | Channel 1 | 255 1 1 | FF 01 01 | 255 1 0 | FF 01 00 | |
Relay 2 | Channel 2 | 255 2 1 | FF 02 01 | 255 2 0 | FF 02 00 | ||
Relay 3 | Channel 3 | 255 3 1 | FF 03 01 | 255 3 0 | FF 03 00 | ||
Relay 4 | Channel 4 | 255 4 1 | FF 04 01 | 255 4 0 | FF 04 00 | ||
Relay 5 | Channel 5 | 255 5 1 | FF 05 01 | 255 5 0 | FF 05 00 | ||
Relay 6 | Channel 6 | 255 6 1 | FF 06 01 | 255 6 0 | FF 06 00 | ||
Relay 7 | Channel 7 | 255 7 1 | FF 07 01 | 255 7 0 | FF 07 00 | ||
Relay 8 | Channel 8 | 255 8 1 | FF 08 01 | 255 8 0 | FF 08 00 | ||
Relay Board ID:02 | Relay 1 | Channel 9 | 255 9 1 | FF 09 01 | 255 9 0 | FF 09 00 | |
Relay 2 | Channel 10 | 255 10 1 | FF 0A 01 | 255 10 0 | FF 0A 00 | ||
Relay 3 | Channel 11 | 255 11 1 | FF 0B 01 | 255 11 0 | FF 0B 00 | ||
Relay 4 | Channel 12 | 255 12 1 | FF 0C 01 | 255 12 0 | FF 0C 00 | ||
Relay 5 | Channel 13 | 255 13 1 | FF 0D 01 | 255 13 0 | FF 0D 00 | ||
Relay 6 | Channel 14 | 255 14 1 | FF 0E 01 | 255 14 0 | FF 0E 00 | ||
Relay 7 | Channel 15 | 255 15 1 | FF 0F 01 | 255 15 0 | FF 0F 00 | ||
Relay 8 | Channel 16 | 255 16 1 | FF 10 01 | 255 16 0 | FF 10 00 | ||
Relay Board ID:03 | Relay 1 | Channel 17 | 255 17 1 | FF 11 01 | 255 17 0 | FF 11 00 | |
Relay 2 | Channel 18 | 255 18 1 | FF 12 01 | 255 18 0 | FF 12 00 | ||
Relay 3 | Channel 19 | 255 19 1 | FF 13 01 | 255 19 0 | FF 13 00 | ||
Relay 4 | Channel 20 | 255 20 1 | FF 14 01 | 255 20 0 | FF 14 00 | ||
Relay 5 | Channel 21 | 255 21 1 | FF 15 01 | 255 21 0 | FF 15 00 | ||
Relay 6 | Channel 22 | 255 22 1 | FF 16 01 | 255 22 0 | FF 16 00 | ||
Relay 7 | Channel 23 | 255 23 1 | FF 17 01 | 255 23 0 | FF 17 00 | ||
Relay 8 | Channel 24 | 255 24 1 | FF 18 01 | 255 24 0 | FF 18 00 | ||
Relay Board ID:04 | Relay 1 | Channel 25 | 255 25 1 | FF 19 01 | 255 25 0 | FF 19 00 | |
Relay 2 | Channel 26 | 255 26 1 | FF 1A 01 | 255 26 0 | FF 1A 00 | ||
Relay 3 | Channel 27 | 255 27 1 | FF 1B 01 | 255 27 0 | FF 1B 00 | ||
Relay 4 | Channel 28 | 255 28 1 | FF 1C 01 | 255 28 0 | FF 1C 00 | ||
Relay 5 | Channel 29 | 255 29 1 | FF 1D 01 | 255 29 0 | FF 1D 00 | ||
Relay 6 | Channel 30 | 255 30 1 | FF 1E 01 | 255 30 0 | FF 1E 00 | ||
Relay 7 | Channel 31 | 255 31 1 | FF 1F 01 | 255 31 0 | FF 1F 00 | ||
Relay 8 | Channel 32 | 255 32 1 | FF 20 01 | 255 32 0 | FF 20 00 | ||
Relay Board ID:05 | Relay 1 | Channel 33 | 255 33 1 | FF 21 01 | 255 33 0 | FF 21 00 | |
Relay 2 | Channel 34 | 255 34 1 | FF 22 01 | 255 34 0 | FF 22 00 | ||
Relay 3 | Channel 35 | 255 35 1 | FF 23 01 | 255 35 0 | FF 23 00 | ||
Relay 4 | Channel 36 | 255 36 1 | FF 24 01 | 255 36 0 | FF 24 00 | ||
Relay 5 | Channel 37 | 255 37 1 | FF 25 01 | 255 37 0 | FF 25 00 | ||
Relay 6 | Channel 38 | 255 38 1 | FF 26 01 | 255 38 0 | FF 26 00 | ||
Relay 7 | Channel 39 | 255 39 1 | FF 27 01 | 255 39 0 | FF 27 00 | ||
Relay Board ID:06 | Relay 8 | Channel 40 | 255 40 1 | FF 28 01 | 255 40 0 | FF 28 00 | |
Relay 1 | Channel 41 | 255 41 1 | FF 29 01 | 255 41 0 | FF 29 00 | ||
Relay 2 | Channel 42 | 255 42 1 | FF 2A 01 | 255 42 0 | FF 2A 00 | ||
Relay 3 | Channel 43 | 255 43 1 | FF 2B 01 | 255 43 0 | FF 2B 00 | ||
Relay 4 | Channel 44 | 255 44 1 | FF 2C 01 | 255 44 0 | FF 2C 00 | ||
Relay 5 | Channel 45 | 255 45 1 | FF 2D 01 | 255 45 0 | FF 2D 00 | ||
Relay 6 | Channel 46 | 255 46 1 | FF 2E 01 | 255 46 0 | FF 2E 00 | ||
Relay 7 | Channel 47 | 255 47 1 | FF 2F 01 | 255 47 0 | FF 2F 00 | ||
Relay 8 | Channel 48 | 255 48 1 | FF 30 01 | 255 48 0 | FF 30 00 |
Binary Commands
Relay Board ID:01 FF B1 xx
FF B1 xx - Set the status of the relays in HEX format where (xx) is the last byte corresponding for each relay.
For example:
FF B1 FF β All relay ON
FF B1 00 β All relay OFF
FF B1 10 β only (5) relay ON all others OFF and so onβ¦.
> FF B1 xx xx xx xx xx xx xx xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF
First byte is status first relay, Eight byte is status eight relay..
Relay Board ID:02 FF B2 xx
Relay Board ID:03 FF B3 xx
Relay Board ID:04 FF B4 xx
Relay Board ID:05 FF B5 xx
Relay Board ID:06 FF B6 xx
Status read commands
Relay Board ID:01
FF A1 00 - Status request command
> FF A1 xx xx xx xx xx xx xx xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF
First byte is status first relay, Eight byte is status eight relay
Relay Board ID:02
FF A2 00 - Status request command
> FF A2 xx xx xx xx xx xx xx xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF
First byte is status first relay, Eight byte is status eight relay
Relay Board ID:03
FF A3 00 - Status request command
> FF A3 xx xx xx xx xx xx xx xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF
First byte is status first relay, Eight byte is status eight relay
Relay Board ID:04
FF A4 00 - Status request command
> FF A4 xx xx xx xx xx xx xx xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF
First byte is status first relay, Eight byte is status eight relay
Relay Board ID:05
FF A5 00 - Status request command
> FF A5 xx xx xx xx xx xx xx xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF
First byte is status first relay, Eight byte is status eight relay
Relay Board ID:06
FF A6 00 - Status request command
> FF A6 xx xx xx xx xx xx xx xx - Reply from relay where xx is status: 01 - Relay is ON, 00 - Relay is OFF
First byte is status first relay, Eight byte is status eight relay
Dip Switch (Address) Calculators
http://www.sabretechnology.co.uk/downloads/dipcalc.swf
http://www.chauvetlighting.com/chauvet-dip-switch-calculator/
http://www.thedmxwiki.com/dmx_definitions/dip_switches
http://www.xledlighting.co.uk/led-technology/dmx-dip-switch-calculator/
First time installation
Procedure
1. Connect power and LAN cable to router.
2. Open any Internet explorer and type: 192.168.1.199 and press ENTER
If your lockal IP Network is 192.168.1.xxx you will see new window with request for USER and PASSWORD.
3. IF NOT....
Download this software and RUN.
http://www.info.kmtronic.com/software/Web_8_Relay/kmtronic_findboard.zip
4. Change Board IP address, Gateway IP address and click Save Config.
5. Open Explorer and type NEW IP address and and press ENTER.
-------
Or execute in Command prompt next command:
route add 192.168.1.0 -p mask 255.255.255.0 192.168.1.199
Next open Explorer and type IP 192.168.1.199 address and and press ENTER
IF NOT:
1. Execute in Command prompt next command "ping 192.168.1.199":
ping 192.168.1.199
2. If you using FRITZ!Box router:
FRITZ!Box modems require RJ-45 REVERSE POLARITY CAT5 CABLE!
PHP Scripts: Control KMtronic LAN WEB Relay board via PHP
http://www.info.kmtronic.com/km-web-eight-relay-box.html
PHP code for STATUS Read WEB Relay board connected to IP: 192.168.1.199 PORT:80 USER: admin PASSWORD: admin
Create a new file. <?php $url = "http://192.168.1.199:80/status.xml"; $username = "admin"; $password = "admin"; //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); //execute post $result = curl_exec($ch); print $result;
Save the file as web_8relay_status.php and run. ( $ php web_8relay_status.php )
Result: $ php web_8_relay_status.php 0 0 0 0 0 0 0 0 0
PHP code for CONTROL WEB Relay board connected to IP: 192.168.1.199 PORT:80 USER: admin PASSWORD: admin
COMMANDS: FF0801 // TURN ON Relay 8
Create a new file. <?php $url = "http://192.168.1.199:80/FF0101"; // TURN ON Relay 1 $username = "admin"; $password = "admin"; //open connection $ch = curl_init(); //set the url, number of POST vars, POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_USERPWD, "$username:$password"); //execute post $result = curl_exec($ch); print $result; ?> Save the file as web_relay_1_on.php and run. ( $ php web_relay_1_on.php ) |