-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmarantz_http.html
109 lines (100 loc) · 4.1 KB
/
marantz_http.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<script type="text/x-red" data-template-name="marantz-http-controller">
<div class="form-row">
<label for="node-config-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-config-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-config-input-host"><i class="icon-bookmark"></i> Host</label>
<input type="text" id="node-config-input-host">
</div>
<div class="form-row">
<label for="node-config-input-port"><i class="icon-bookmark"></i> Port</label>
<input type="text" id="node-config-input-port" placeholder="80">
</div>
</script>
<script type="text/x-red" data-template-name="marantz-http-out">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-controller"><i class="icon-bookmark"></i> Controller</label>
<input type="text" id="node-input-controller">
</div>
</script>
<script type="text/x-red" data-template-name="marantz-http-in">
<div class="form-row">
<label for="node-input-name"><i class="icon-tag"></i> Name</label>
<input type="text" id="node-input-name" placeholder="Name">
</div>
<div class="form-row">
<label for="node-input-controller"><i class="icon-bookmark"></i> Controller</label>
<input type="text" id="node-input-controller">
</div>
</script>
<script type="text/x-red" data-help-name="marantz-http-out">
<p>
Use this to <b>send</b> marantz-http packets to Marantz AVR device familiar with marantz-http protocol.<br/>
<b>msg.payload</b> must be a JavaScript object (with <b>cmd</b> and <b>value</b> fields) or a string.
Only integer percent value (0-100%) could be sent with volume topic.
The msg.topic field can also be used to fill the command, the value should be in payload.value or payload.cmd in that case
</p>
<p>
For example: <code>{"cmd": "power", "value": "on"}</code> or <code>{"cmd": "si", "value": "TUNER"}</code><br/>
Value for power cmd "power" is "on", "1", "off".<br/>
Value for select input cmd "si" is "TUNER", "SAT/CBL","BD","MPLAY", "GAME" and etc of protocol.<br/>
Value for surround mode cmd "sm" is "MOVIE", "MUSIC","GAME","DIRECT", "STEREO" and etc of protocol.
</p>
<p>
Please, take a look at full list of commands here: https://raw.githubusercontent.com/estbeetoo/marantz-http.js/master/marantz-http-commands.json
<p>
</script>
<script type="text/x-red" data-help-name="marantz-http-in">
<p>Use this to <b>inject</b> flows from marantz-http device<br/>
</script>
<script type="text/javascript">
RED.nodes.registerType('marantz-http-controller', {
category: 'config',
defaults: {
name: {value: ""},
host: {value: "127.0.0.1", required: true},
port: {value: 80, required: false, validate: RED.validators.number()}
},
label: function () {
return (this.name || 'marantz-http' ) + "@" + this.host + ":" + this.port;
}
});
</script>
<script type="text/javascript">
RED.nodes.registerType('marantz-http-out', {
category: 'output',
color: '#26b050',
defaults: {
name: {value: ""},
controller: {value: "", type: "marantz-http-controller"}
},
inputs: 1,
outputs: 0,
align: 'right',
icon: "bridge-dash.png",
label: function () {
return (this.groupaddr || this.name || "marantz-http");
}
});
</script>
<script type="text/javascript">
RED.nodes.registerType('marantz-http-in', {
category: 'input',
color: '#26b050',
defaults: {
name: {value: ""},
controller: {value: "", type: "marantz-http-controller"}
},
inputs: 0,
outputs: 1,
icon: "bridge-dash.png",
label: function () {
return (this.groupaddr || this.name || "marantz-http");
}
});
</script>