2013-10-26 17:44:23 +02:00
2019-11-25 15:30:42 +01:00
< script type = "text/html" data-template-name = "wake on lan" >
2013-10-26 17:44:23 +02:00
< div class = "form-row" >
2019-11-25 15:30:42 +01:00
< label for = "node-input-mac" style = "width:120px;" > < i class = "fa fa-address-card-o" > < / i > MAC Address< / label >
2014-08-19 12:41:29 +02:00
< input type = "text" id = "node-input-mac" placeholder = "e.g. DE:AD:BE:EF:FE:ED" >
2013-10-26 17:44:23 +02:00
< / div >
2016-11-13 10:51:31 +01:00
< div class = "form-row" >
2019-11-25 15:30:42 +01:00
< label for = "node-input-host" style = "width:120px;" > < i class = "fa fa-globe" > < / i > Target Address< / label >
2018-12-09 12:01:18 +01:00
< input type = "text" id = "node-input-host" placeholder = "e.g. 192.168.1.255 or 10.255.255.255" >
2016-11-13 10:51:31 +01:00
< / div >
2019-11-25 15:17:36 +01:00
< div class = "form-row" >
2019-11-25 15:30:42 +01:00
< label for = "node-input-udpport" style = "width:120px;" > < i class = "fa fa-random" > < / i > Target UDP Port< / label >
2019-11-25 15:17:36 +01:00
< input type = "number" id = "node-input-udpport" placeholder = "9" >
< / div >
2021-07-19 18:23:48 +02:00
< div class = "form-row" >
< label for = "node-input-numpackets" style = "width:120px;" > < i class = "fa fa-envelope" > < / i > Number of Packets< / label >
< input type = "number" id = "node-input-numpackets" placeholder = "3" >
< / div >
< div class = "form-row" >
< label for = "node-input-interval" style = "width:120px;" > < i class = "fa fa-clock-o" > < / i > Interval Between Packets (ms)< / label >
< input type = "number" id = "node-input-interval" placeholder = "100" >
< / div >
2013-10-26 17:44:23 +02:00
< div class = "form-row" >
2019-11-25 15:30:42 +01:00
< label for = "node-input-name" style = "width:120px;" > < i class = "fa fa-tag" > < / i > Name< / label >
2013-10-26 17:44:23 +02:00
< input type = "text" id = "node-input-name" placeholder = "Name" >
< / div >
2019-11-25 15:30:42 +01:00
< div class = "form-tips" > Tip: leave blank if you want to use < code > msg.mac< / code > or < code > msg.host< / code > to dynamically set target information.< / div >
2013-10-26 17:44:23 +02:00
< / script >
2019-11-25 15:30:42 +01:00
< script type = "text/html" data-help-name = "wake on lan" >
2013-10-26 17:44:23 +02:00
< p > Sends a Wake-On-LAN magic packet to the mac address specified.< / p >
2016-03-02 14:26:19 +01:00
< p > You may instead set < code > msg.mac< / code > to dynamically set the target device mac to wake up.< / p >
2018-12-09 12:01:18 +01:00
< p > The address of the target machine can optionally be set using < code > msg.host< / code > < / p >
2021-07-19 18:23:48 +02:00
< p > You can likewise set the destination UDP port, number of packets sent, and interval between packets using < code > msg.udpport< / code > , < code > msg.numpackets< / code > , < code > msg.interval< / code > .< / p >
2018-12-09 12:01:18 +01:00
< p > Setting the target address to the broadcast address of the subnet that the target machine is attached to works best.
For a class C address this is usually just the first three parts of the ip address followed by 255. eg 192.168.1.255.< / p >
2021-07-19 18:23:48 +02:00
< p > You can specify the target UDP port (default 9), number of packets sent (default 3), and interval between packets (default 100ms).< / p >
2013-10-26 17:44:23 +02:00
< / script >
< script type = "text/javascript" >
RED.nodes.registerType('wake on lan',{
2015-03-04 20:57:22 +01:00
category: 'network-output',
2013-10-26 17:44:23 +02:00
color:"#999966",
defaults: {
mac: {value:""},
2016-11-13 10:51:31 +01:00
host: {value:""},
2019-11-25 15:17:36 +01:00
udpport: {value:9, validate:RED.validators.number()},
2021-07-19 18:23:48 +02:00
numpackets: {value:3},
interval: {value:100},
2013-10-26 17:44:23 +02:00
name: {value:""}
},
inputs:1,
outputs:0,
icon: "light.png",
align: "right",
label: function() {
2014-08-19 12:41:29 +02:00
return this.name ? this.name : (this.mac ? "WOL: "+this.mac : "Wake on Lan") ;
2013-10-26 17:44:23 +02:00
},
labelStyle: function() {
return this.name?"node_label_italic":"";
}
});
< / script >