node-red-contrib-denon
Version:
Node-RED nodes for communicating with a Denon AVR.
147 lines (137 loc) • 5.15 kB
HTML
<script type="text/x-red" data-template-name="denon-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> Denon 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> Denon Port</label>
<input type="text" id="node-config-input-port">
</div>
</script>
<script type="text/x-red" data-template-name="denon-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> Denon host</label>
<input type="text" id="node-input-controller">
</div>
<div class="form-row">
<label for="node-input-denoncommand"><i class="icon-bookmark"></i> Command</label>
<input type="text" id="node-input-denoncommand">
</div>
</script>
<script type="text/x-red" data-template-name="denon-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="denon-out">
<p>
Use this node to <b>send</b> commands to a Denon AVRs.<br/>
<b>msg.payload</b> must be a JavaScript object or a string
</p>
<p>
For example, simple string (command does not has arguments): <code>PWON</code> or <code>PWOFF</code>
</p>
<p>
If topic if filled, it will be handled as command nad payload will be an argument, for example msg object may contain fields:<br/>
<pre>{
"topic": "SetVolumeDB",
"payload" : -60.5
}</pre>
</p>
Or Javascript object (command + params):
<pre>{
"cmd": "SetVolumeDB",
"params": 0
}</pre>
<p>
<h2>Supported commands:</h2>
<ul>
<li>All from official <a href="https://github.com/estbeetoo/node-red-contrib-denon/blob/master/doc/AVR3312CI_AVR3312_PROTOCOL_V7.6.0.pdf">Denon AVR protocol</a></li>
<li>
SetVolumeDB<br/>
Params:
<code>volume</code>:
<ul>
<li>type: <b>float</b></li>
<li>range: from <b>-80.0</b> to <b>+1.0</b></li>
</ul>
</li>
</ul>
</p>
}</pre>
</p>
<p>Take a look at Denon AVR protocol: <a href="https://github.com/estbeetoo/node-red-contrib-denon/blob/master/doc/AVR3312CI_AVR3312_PROTOCOL_V7.6.0.pdf">DENON_PROTOCOL_V7.6.0.pdf</a></p
</script>
<script type="text/x-red" data-help-name="denon-in">
<p>
Use this node to <b>receive</b> data from Denon devices and inject it into the flow.<br/>
Denon data being injected as a Javascript object of structure:
<pre>{
topic: 'denon',
payload: 'PWON'
}</pre>
</p>
<p>Take a look at Denon AVR protocol for full list of device response: <a href="https://github.com/estbeetoo/node-red-contrib-denon/blob/master/doc/AVR3312CI_AVR3312_PROTOCOL_V7.6.0.pdf">DENON_PROTOCOL_V7.6.0.pdf</a></p>
</script>
<script type="text/javascript">
RED.nodes.registerType('denon-controller', {
category: 'config',
defaults: {
name: {value: ""},
host: {value: "127.0.0.1", required: true},
port: {value: 23, required: false, validate: RED.validators.number()}
},
label: function () {
return (this.name || 'denon' ) + "@" + this.host + ":" + this.port;
}
});
</script>
<script type="text/javascript">
RED.nodes.registerType('denon-out', {
category: 'output',
color: '#26b050',
defaults: {
name: {value: ""},
controller: {value: "", type: "denon-controller"},
unit_number: {value: "1", required: false},
output: {value: "1", required: false},
denoncommand: {value: ""}
},
inputs: 1,
outputs: 0,
align: 'right',
icon: "denon.png",
label: function () {
return (this.groupaddr || this.name || "denon");
}
});
</script>
<script type="text/javascript">
RED.nodes.registerType('denon-in', {
category: 'input',
color: '#26b050',
defaults: {
name: {value: ""},
controller: {value: "", type: "denon-controller"}
},
inputs: 0,
outputs: 1,
icon: "denon.png",
label: function () {
return (this.groupaddr || this.name || "denon");
}
});
</script>