374 lines
12 KiB
HTML
374 lines
12 KiB
HTML
<!-- The Read Node -->
|
|
<script type="text/x-red" data-template-name="xiaomi-actions read">
|
|
<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>
|
|
</script>
|
|
|
|
<script type="text/x-red" data-help-name="xiaomi-actions read">
|
|
<p>Ask the gateway to read the report of the input device.</p>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>sid
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd>Device <code>sid</code> to ask the report.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<p class="node-ports">
|
|
Message to connect to a gateway out node.
|
|
</p>
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
RED.nodes.registerType('xiaomi-actions read',{
|
|
category: 'xiaomi actions',
|
|
color: '#64C4CD',
|
|
defaults: {
|
|
name: {value:""}
|
|
},
|
|
inputs:1,
|
|
outputs:1,
|
|
paletteLabel: "read",
|
|
icon: "function.png",
|
|
label: function() {
|
|
return this.name||"read";
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
<!-- The get ids Node -->
|
|
<script type="text/x-red" data-template-name="xiaomi-actions get_id_list">
|
|
<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>
|
|
</script>
|
|
|
|
<script type="text/x-red" data-help-name="xiaomi-actions get_id_list">
|
|
<p>Ask the gateway to the list of devices ids.</p>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Message to connect to a gateway out node.</li>
|
|
</ol>
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
RED.nodes.registerType('xiaomi-actions get_id_list',{
|
|
category: 'xiaomi actions',
|
|
color: '#64C4CD',
|
|
defaults: {
|
|
name: {value:""}
|
|
},
|
|
inputs:1,
|
|
outputs:1,
|
|
paletteLabel: "get id list",
|
|
icon: "function.png",
|
|
label: function() {
|
|
return this.name||"get id list";
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
<!-- The Single click Node -->
|
|
<script type="text/x-red" data-template-name="xiaomi-actions click">
|
|
<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>
|
|
</script>
|
|
|
|
<script type="text/x-red" data-help-name="xiaomi-actions click">
|
|
<p>
|
|
Virtual single click for switch.
|
|
Note: a gateway input node must be present and have receive a message to get gateway tokens and be able to do the action.
|
|
</p>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>sid
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd>Device <code>sid</code> to ask the report.</dd>
|
|
<dt>gateway
|
|
<span class="property-type">xiaomi-configurator</span>
|
|
</dt>
|
|
<dd>Device <code>sid</code> to ask the report.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Message to connect to a gateway out node.</li>
|
|
</ol>
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
RED.nodes.registerType('xiaomi-actions click',{
|
|
category: 'xiaomi actions',
|
|
color: '#64C4CD',
|
|
defaults: {
|
|
name: {value:""}
|
|
},
|
|
inputs:1,
|
|
outputs:1,
|
|
paletteLabel: "click",
|
|
icon: "function.png",
|
|
label: function() {
|
|
return this.name||"click";
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
<!-- The Double click Node -->
|
|
<script type="text/x-red" data-template-name="xiaomi-actions double_click">
|
|
<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>
|
|
</script>
|
|
|
|
<script type="text/x-red" data-help-name="xiaomi-actions double_click">
|
|
<p>
|
|
Virtual double click for switch.
|
|
Note: a gateway input node must be present and have receive a message to get gateway tokens and be able to do the action.
|
|
</p>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>sid
|
|
<span class="property-type">string</span>
|
|
</dt>
|
|
<dd>Device <code>sid</code> to ask the report.</dd>
|
|
<dt>gateway
|
|
<span class="property-type">xiaomi-configurator</span>
|
|
</dt>
|
|
<dd>Device <code>sid</code> to ask the report.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Message to connect to a gateway out node.</li>
|
|
</ol>
|
|
</script>
|
|
|
|
<script type="text/javascript">
|
|
RED.nodes.registerType('xiaomi-actions double_click',{
|
|
category: 'xiaomi actions',
|
|
color: '#64C4CD',
|
|
defaults: {
|
|
name: {value:""}
|
|
},
|
|
inputs:1,
|
|
outputs:1,
|
|
paletteLabel: "double click",
|
|
icon: "function.png",
|
|
label: function() {
|
|
return this.name||"double click";
|
|
}
|
|
});
|
|
</script>
|
|
|
|
|
|
<!-- The Gateway light Node -->
|
|
<script type="text/javascript">
|
|
RED.nodes.registerType('xiaomi-actions gateway_light', {
|
|
category: 'xiaomi actions',
|
|
color: '#64C4CD',
|
|
defaults: {
|
|
gateway: {value:"", type:"xiaomi-configurator"},
|
|
name: {value: ""}
|
|
},
|
|
inputs: 1,
|
|
outputs: 1,
|
|
paletteLabel: "set light",
|
|
icon: "light-icon.png",
|
|
label: function () {
|
|
return this.name || "set light";
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script type="text/x-red" data-template-name="xiaomi-actions gateway_light">
|
|
<div class="form-row">
|
|
<label for="node-input-gateway"><i class="icon-tag"></i> Gateway</label>
|
|
<input type="text" id="node-input-gateway" placeholder="xiaomi gateway">
|
|
</div>
|
|
<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>
|
|
</script>
|
|
|
|
<script type="text/x-red" data-help-name="xiaomi-actions gateway_light">
|
|
<p>Change the light of the gateway.
|
|
Note: a gateway input node must be present and have receive a message to get gateway tokens and be able to do the action.
|
|
</p>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>brightness
|
|
<span class="property-type">number</span>
|
|
</dt>
|
|
<dd>The brightness value between <code>0</code> and <code>100</code>.</dd>
|
|
<dt>color
|
|
<span class="property-type">object</span>
|
|
</dt>
|
|
<dd>The color itself. This object must contain the followinf properties:
|
|
<ul>
|
|
<li>
|
|
<code>red</code> - amout of red, between <code>0</code> and <code>255</code>
|
|
</li>
|
|
<li>
|
|
<code>green</code> - amout of green, between <code>0</code> and <code>255</code>
|
|
</li>
|
|
<li>
|
|
<code>blue</code> - amout of blue, between <code>0</code> and <code>255</code>
|
|
</li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Message to connect to a gateway out node.</li>
|
|
</ol>
|
|
</script>
|
|
|
|
|
|
<!-- The Gateway sound Node -->
|
|
<script type="text/javascript">
|
|
RED.nodes.registerType('xiaomi-actions gateway_sound', {
|
|
category: 'xiaomi actions',
|
|
color: '#64C4CD',
|
|
defaults: {
|
|
gateway: {value:"", type:"xiaomi-configurator"},
|
|
name: {value: ""},
|
|
mid: {value: ""},
|
|
volume: {value: ""}
|
|
},
|
|
inputs: 1,
|
|
outputs: 1,
|
|
paletteLabel: "play sound",
|
|
icon: "function.png",
|
|
label: function () {
|
|
return this.name || "play sound";
|
|
}
|
|
});
|
|
</script>
|
|
|
|
<script type="text/x-red" data-template-name="xiaomi-actions gateway_sound">
|
|
<div class="form-row">
|
|
<label for="node-input-gateway"><i class="icon-tag"></i> Gateway</label>
|
|
<input type="text" id="node-input-gateway" placeholder="xiaomi gateway">
|
|
</div>
|
|
<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-mid"><i class="icon-tag"></i> Sound</label>
|
|
<select id="node-input-mid">
|
|
<option value="0">Police car tone 1</option>
|
|
<option value="1">Police car tone 2</option>
|
|
<option value="2">Safety incident sound</option>
|
|
<option value="3">Missile countdown</option>
|
|
<option value="4">Ghost cry</option>
|
|
<option value="5">Sniper rifle</option>
|
|
<option value="6">Battle sound</option>
|
|
<option value="7">Air raid alarm</option>
|
|
<option value="8">Barking</option>
|
|
<option value="10">Doorbell tone</option>
|
|
<option value="11">Door knocking tone</option>
|
|
<option value="12">Funny tone</option>
|
|
<option value="13">Alarm clock tone</option>
|
|
<option value="20">MiMix</option>
|
|
<option value="21">Enthusisatic</option>
|
|
<option value="22">GuitarClassic</option>
|
|
<option value="23">IceWorldPiano</option>
|
|
<option value="24">LeisureTime</option>
|
|
<option value="25">ChildHood</option>
|
|
<option value="26">MorningStreamLet</option>
|
|
<option value="27">MusicBox</option>
|
|
<option value="28">Orange</option>
|
|
<option value="29">Thinker</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-row">
|
|
<label for="node-input-volume"><i class="icon-tag"></i> Volume</label>
|
|
<input type="range" id="node-input-volume" min="0" max="100">
|
|
</div>
|
|
</script>
|
|
|
|
<script type="text/x-red" data-help-name="xiaomi-actions gateway_sound">
|
|
<p>Play a sound on the gateway.
|
|
Note: a gateway input node must be present and have receive a message to get gateway tokens and be able to do the action.
|
|
</p>
|
|
|
|
<h3>Inputs</h3>
|
|
<dl class="message-properties">
|
|
<dt>mid
|
|
<span class="property-type">number</span>
|
|
</dt>
|
|
<dd>Music ID (user define sounds start from <code>1001</code>, <code>1000</code> means stop).</dd>
|
|
<dt>volume
|
|
<span class="property-type">number</span>
|
|
</dt>
|
|
<dd>Playing volume, between <code>0</code> and <code>100</code>.</dd>
|
|
</dl>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Message to connect to a gateway out node.</li>
|
|
</ol>
|
|
</script>
|
|
|
|
|
|
<!-- The Gateway stop sound Node -->
|
|
<script type="text/javascript">
|
|
RED.nodes.registerType('xiaomi-actions gateway_stop_sound',{
|
|
category: 'xiaomi actions',
|
|
color: '#64C4CD',
|
|
defaults: {
|
|
gateway: {value:"", type:"xiaomi-configurator"},
|
|
name: {value:""}
|
|
},
|
|
inputs:1,
|
|
outputs:1,
|
|
paletteLabel: "stop sound",
|
|
icon: "function.png",
|
|
label: function() {
|
|
return this.name||"stop sound";
|
|
}
|
|
});
|
|
</script>
|
|
<script type="text/x-red" data-template-name="xiaomi-actions gateway_stop_sound">
|
|
<div class="form-row">
|
|
<label for="node-input-gateway"><i class="icon-tag"></i> Gateway</label>
|
|
<input type="text" id="node-input-gateway" placeholder="xiaomi gateway">
|
|
</div>
|
|
<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>
|
|
</script>
|
|
|
|
<script type="text/x-red" data-help-name="xiaomi-actions gateway_stop_sound">
|
|
<p>
|
|
Stop current playing sound on the gateway.
|
|
Note: a gateway input node must be present and have receive a message to get gateway tokens and be able to do the action.
|
|
</p>
|
|
|
|
<h3>Outputs</h3>
|
|
<ol class="node-ports">
|
|
<li>Message to connect to a gateway out node.</li>
|
|
</ol>
|
|
</script>
|