smart-nodes
Version:
192 lines (191 loc) • 10 kB
HTML
<script type="text/html" data-help-name="smart_dimmer-control">
<p>
This node controls a dimmable output.
The output is always <code>msg.payload = value</code>, where value is a decimal number between 0 and 100.
</p>
<p>
<b>Note:</b> Smart nodes use topics in the format <code>name#number</code>, so that different smart nodes can be
controlled with the same topic.<br />
This node only uses the <code>name</code> part. <code>#</code> and <code>number</code> are optional.
</p>
<p>
The following topics are accepted:
<table>
<thead>
<tr>
<th>Topic</th>
<th>Description</th>
<th>msg.payload === false is ignored</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>status</code></td>
<td>
Specifies the current status of the output via <code>msg.payload = value</code>, where value must be a
number between 0 and 100.<br />
If there is a change from 0% to greater than 0%, the time measurement is started for the stored or sent
time, if available. </td>
<td>No</td>
</tr>
<tr>
<td><code>on</code></td>
<td>Sets the output to 100% and starts the time measurement for the stored or sent time, if available.</td>
<td>Yes</td>
</tr>
<tr>
<td><code>off</code></td>
<td>Sets the output to 0%.</td>
<td>Yes</td>
</tr>
<tr>
<td><code>set</code></td>
<td>
Sets the output to the sent value <code>msg.payload = value</code>.<br />
If the value changes from 0% to greater than 0%, the time measurement is started for the stored or sent
time, if available. </td>
<td>No</td>
</tr>
<tr>
<td><code>set_permanent</code></td>
<td>
Sets the output to the sent value <code>msg.payload = value</code> without starting a time
measurement.<br />
</td>
<td>No</td>
</tr>
<tr>
<td><code>motion</code></td>
<td>
Sets the output with <code>msg.payload = true</code> to the last used value that was greater than 0%
without starting a time measurement.<br />
With <code>msg.payload = false</code> the time measurement is started for the stored or sent time, if
available.<br />
If no time is specified or stored, the output is set to 0%. </td>
<td>No</td>
</tr>
<tr>
<td><code>alarm</code></td>
<td>
Sets the current alarm state to the value of <code>msg.payload</code> and triggers the corresponding
action.<br />
<table>
<thead>
<tr>
<th>Setting</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>No action</td>
<td>Nothing happens</td>
</tr>
<tr>
<td>Switch on</td>
<td>The output is set to 100%.</td>
</tr>
<tr>
<td>Switch off</td>
<td>The output is set to 0%.</td>
</tr>
<tr>
<td>Percent</td>
<td>The output is set to the set percent.</td>
</tr>
<tr>
<td>Last state</td>
<td>The state before the alarm was set is restored.</td>
</tr>
<tr>
<td>Last sent state</td>
<td>The state that was last received, even while the alarm was active, is restored.</td>
</tr>
</tbody>
</table>
</td>
<td>No</td>
</tr>
<tr>
<td><code>dim</code></td>
<td>
The message <code>msg.payload = true</code> starts the dimming process. This alternates between up and down.<br />
<code>msg.payload = false</code> ends the dimming process again.<br />
With <code>msg.direction = true</code> or <code>msg.direction = "up"</code> the dimming direction can be set up.<br />
With <code>msg.direction = false</code> or <code>msg.direction = "down"</code> the dimming direction can be set down.<br />
If the percentage changes to greater than 0%, the time measurement is started for the stored or sent time, if available.
</td>
<td>No</td>
</tr>
<tr>
<td><code>toggle_dim</code></td>
<td>
When the button is pressed briefly, the output is set alternately to the last value that was greater than 0% and 0%.<br />
When the button is pressed for a long time, the dimming process is started. This alternates up and then down.<br />
The time measurement of the button press is based on <code>msg.payload = true</code>. As soon as the long press time is exceeded, the dimming process starts.<br />
If this time has not yet been reached when <code>msg.payload = false</code> is reached, the button was pressed briefly.<br />
With <code>msg.direction = true</code> or <code>msg.direction = "up"</code>, the dimming direction can be set to the up position.<br />
With <code>msg.direction = false</code> or <code>msg.direction = "down"</code>, the dimming direction can be set to the down position.<br />
If the percentage changes to greater than 0%, the time measurement is started for the stored or sent time, if available.
</td>
<td>No</td>
</tr>
<tr>
<td><code>toggle</code> (default)</td>
<td>
Sets the output alternately to the last value that was greater than 0% and 0%.<br />
When changing from 0% to greater than 0%, the time measurement is started for the stored or sent time,
if available.
</td>
<td>Yes</td>
</tr>
<tr>
<td><code>blink</code></td>
<td>
Briefly switches the output to 0% without interrupting the ongoing time measurement. This can be used to
provide visual feedback for a specific action.<br />
The default time is 0.5 seconds, but can be overridden using <code>msg.time_on</code>.
</td>
<td>Yes</td>
</tr>
</tbody>
</table>
</p>
<p>
This node has an adjustable maximum runtime before the output is automatically set back to 0%.
This time measurement is used as in the table above.
The set time can be overridden specifically.
Example: <code>msg = { "topic": "on", "time_on": 5000 }</code> or
<code>msg = { "topic": "on", "time_on": "5s" }</code><br />
This message sets the output to 100% for 5000 milliseconds / 5 seconds and then back to 0%.
The next message without <code>time_on</code> specification uses the preset time again.
If the time is set to 0, the light will <b>not</b> be switched off automatically.<br />
The following values can be used as the unit for the time:
<table>
<thead>
<tr>
<th>Unit</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>ms</code> (default)</td>
<td>Milliseconds</td>
</tr>
<tr>
<td><code>s</code> or <code>sec</code></td>
<td>Seconds</td>
</tr>
<tr>
<td><code>m</code> or <code>min</code></td>
<td>Mintun.</td>
</tr>
<tr>
<td><code>h</code></td>
<td>Hours</td>
</tr>
</tbody>
</table>
</p>
</script>