2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-04 05:16:45 +00:00

MYSENSORS MYSENSORS_DEVICE: cref patches (use id + enhanced formatting by drhirn)

git-svn-id: https://svn.fhem.de/fhem/trunk@24385 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2021-05-05 06:24:21 +00:00
parent 57892c3600
commit 45c01910a3
2 changed files with 221 additions and 183 deletions

View File

@ -1000,75 +1000,81 @@ __END__
=begin html
<a name="MYSENSORS"></a>
<a id="MYSENSORS"></a>
<h3>MYSENSORS</h3>
<p>connects fhem to <a href="http://MYSENSORS.org">MYSENSORS</a>.</p>
<p>A single MYSENSORS device can serve multiple <a href="#MYSENSORS_DEVICE">MYSENSORS_DEVICE</a> clients.<br>
Each <a href="#MYSENSORS_DEVICE">MYSENSORS_DEVICE</a> represents a mysensors node.</p>
<a id="MYSENSORS-define"></a>
<h4>Define</h4>
<p><code>define &lt;name&gt; MYSENSORS &lt;serial device&gt;|&lt;ip:port&gt;</code></p>
<p>Specifies the MYSENSORS device.</p>
<a id="MYSENSORS-set"></a>
<h4>Set</h4>
<ul>
<p>connects fhem to <a href="http://MYSENSORS.org">MYSENSORS</a>.</p>
<p>A single MYSENSORS device can serve multiple <a href="#MYSENSORS_DEVICE">MYSENSORS_DEVICE</a> clients.<br/>
Each <a href="#MYSENSORS_DEVICE">MYSENSORS_DEVICE</a> represents a mysensors node.<br/>
<a name="MYSENSORSdefine"></a>
<p><b>Define</b></p>
<ul>
<p><code>define &lt;name&gt; MYSENSORS &lt;serial device&gt|&lt;ip:port&gt;</code></p>
<p>Specifies the MYSENSORS device.</p>
</ul>
<a name="MYSENSORSset"></a>
<p><b>Set</b></p>
<ul>
<li>
<p><code>set &lt;name&gt; connect</code><br/>
(re-)connects the MYSENSORS-device to the MYSENSORS-gateway</p>
</li>
<li>
<p><code>set &lt;name&gt; disconnect</code><br/>
disconnects the MYSENSORS-device from the MYSENSORS-gateway</p>
</li>
<li>
<p><code>set &lt;name&gt; inclusion-mode on|off</code><br/>
turns the gateways inclusion-mode on or off</p>
</li>
</ul>
<a name="MYSENSORSattr"></a>
<p><b>Attributes</b></p>
<ul>
<li>
<p><code>attr &lt;name&gt; autocreate</code><br/>
enables auto-creation of MYSENSOR_DEVICE-devices on receival of presentation-messages</p>
</li>
<li>
<p><code>attr &lt;name&gt; requestAck</code><br/>
request acknowledge from nodes.<br/>
if set the Readings of nodes are updated not before requested acknowledge is received<br/>
if not set the Readings of nodes are updated immediatly (not awaiting the acknowledge).
May also be configured for individual nodes if not set for gateway.</p>
</li>
<li>
<p><code>attr &lt;name&gt; first-sensorid <&lt;number &lth; 255&gt;></code><br/>
configures the lowest node-id assigned to a mysensor-node on request (defaults to 20)</p>
</li>
<li>
<p><code>attr &lt;name&gt; OTA_firmwareConfig &lt;filename&gt;</code><br/>
specifies a configuration file for the <a href="https://www.mysensors.org/about/fota">FOTA</a>
(firmware over the air - wireless programming of the nodes) configuration. It must be stored
in the folder FHEM/firmware. The format of the configuration file is the following (csv):</p>
<p><code>#Type,Name,Version,File,Comments</code><br/>
<code>10,Blink,1,Blink.hex,blinking example</code><br/></p>
<p>The meaning of the columns is the following:</br>
<dl>
<dt><code>Type</code></dt>
<dd>a numeric value (range 0 .. 65536) - each node will be assigned a firmware type</dd>
<dt><code>Name</code></dt>
<dd>a short name for this type</dd>
<dt><code>Version</code></dt>
<dd>a numeric value (range 0 .. 65536) - the version of the firmware (may be different
to the value that is send during the node presentation)</dd>
<dt><code>File</code></dt>
<dd>the filename containing the firmware - must also be stored in the folder FHEM/firmware</dd>
<dt><code>Comments</code></dt>
<dd>a description / comment for the firmware</dd>
</dl></p>
</li>
</ul>
<li>
<p><a id="MYSENSORS-set-connect"></a><b>connect</b></p>
<p><code>set &lt;name&gt; connect</code></p>
<p>(re-)connects the MYSENSORS-device to the MYSENSORS-gateway</p>
</li>
<li>
<p><a id="MYSENSORS-set-disconnect"></a><b>disconnect</b></p>
<p><code>set &lt;name&gt; disconnect</code></p>
<p>disconnects the MYSENSORS-device from the MYSENSORS-gateway</p>
</li>
<li>
<p><a id="MYSENSORS-set-inclusion-mode"></a><b>inclusion-mode</b></p>
<p><code>set &lt;name&gt; inclusion-mode on|off</code></p>
<p>turns the gateways inclusion-mode on or off</p>
</li>
</ul>
<a id="MYSENSORS-attr"></a>
<h4>Attributes</h4>
<ul>
<li>
<p><a id="MYSENSORS-attr-autocreate"></a><b>autocreate</b></p>
<p><code>attr &lt;name&gt; autocreate</code></p>
<p>enables auto-creation of MYSENSOR_DEVICE-devices on receival of presentation-messages</p>
</li>
<li>
<p><a id="MYSENSORS-attr-requestack"></a><b>requestAck</b></p>
<p><code>attr &lt;name&gt; requestAck</code></p>
<p>request acknowledge from nodes.</p>
<p>if set the Readings of nodes are updated not before requested acknowledge is received<br>
if not set the Readings of nodes are updated immediatly (not awaiting the acknowledge).</p>
<p>May also be configured for individual nodes if not set for gateway.</p>
</li>
<li>
<p><a id="MYSENSORS-attr-first-sensorid"></a><b>first-sensorid</b></p>
<p><code>attr &lt;name&gt; first-sensorid &lt;number &lt;h;255&gt;&gt;</code></p>
<p>configures the lowest node-id assigned to a mysensor-node on request (defaults to 20)</p>
</li>
<li>
<p><a id="MYSENSORS-attr-ota_firmwareconfig"></a><b>OTA_firmwareConfig</b></p>
<p><code>attr &lt;name&gt; OTA_firmwareConfig &lt;filename&gt;</code></p>
<p>specifies a configuration file for the <a href="https://www.mysensors.org/about/fota">FOTA</a>
(firmware over the air - wireless programming of the nodes) configuration. It must be stored
in the folder FHEM/firmware. The format of the configuration file is the following (csv):</p>
<p><code>#Type,Name,Version,File,Comments</code><br/>
<code>10,Blink,1,Blink.hex,blinking example</code></p>
<p>The meaning of the columns is the following:</p>
<dl>
<dt><code>Type</code></dt>
<dd>a numeric value (range 0 .. 65536) - each node will be assigned a firmware type</dd>
<dt><code>Name</code></dt>
<dd>a short name for this type</dd>
<dt><code>Version</code></dt>
<dd>a numeric value (range 0 .. 65536) - the version of the firmware (may be different
to the value that is send during the node presentation)</dd>
<dt><code>File</code></dt>
<dd>the filename containing the firmware - must also be stored in the folder FHEM/firmware</dd>
<dt><code>Comments</code></dt>
<dd>a description / comment for the firmware</dd>
</dl>
</li>
</ul>
=end html

View File

@ -1339,125 +1339,157 @@ __END__
=begin html
<a name="MYSENSORS_DEVICE"></a>
<a id="MYSENSORS_DEVICE"></a>
<h3>MYSENSORS_DEVICE</h3>
<p>represents a mysensors sensor attached to a mysensor-node</p>
<p>requires a <a href="#MYSENSORS">MYSENSORS</a>-device as IODev</p>
<a id="MYSENSORS_DEVICE-define"></a>
<h4>Define</h4>
<p><code>define &lt;name&gt; MYSENSORS_DEVICE &lt;Sensor-type&gt; &lt;node-id&gt;</code>
<p>Specifies the MYSENSOR_DEVICE device.</p>
<a id="MYSENSORS_DEVICE-set"></a>
<h4>Set</h4>
<ul>
<p>represents a mysensors sensor attached to a mysensor-node</p>
<p>requires a <a href="#MYSENSORS">MYSENSORS</a>-device as IODev</p>
<a name="MYSENSORS_DEVICE define"></a>
<p><b>Define</b></p>
<ul>
<p><code>define &lt;name&gt; MYSENSORS_DEVICE &lt;Sensor-type&gt; &lt;node-id&gt;</code><br/>Specifies the MYSENSOR_DEVICE device.</p>
</ul>
<a name="MYSENSORS_DEVICEset"></a>
<p><b>Set</b></p>
<ul>
<b>AttrTemplate</b>
<li>Helps to easily configure your devices. Just get a list of all available attrTremplates by issuing
<ul>
<p><code>set &lt;name&gt; attrTemplate ?</code></p>
</ul>
Have a look at the descriptions and choose a suitable one. Then use the drop-down list and click "set" or issue a.<br>
<ul>
<p><code>set &lt;name&gt; attrTemplate A_02a_atmospheric_pressure</code></p>
</ul>
</li><br>
<b>clear</b>
<li>
<p><code>set &lt;name&gt; clear</code><br/>clears MySensors EEPROM area and reboot (i.e. "factory" reset) - requires MY_SPECIAL_DEBUG</p>
</li>
<b>flash</b>
<li>
<p><code>set &lt;name&gt; flash</code><br/>
Checks whether a newer firmware version is available. If a newer firmware version is
available the flash procedure is started. The sensor node must support FOTA for
this.</p>
</li>
<b>fwType</b>
<li>
<p><code>set &lt;name&gt; fwType &lt;value&gt;</code><br/>
assigns a firmware type to this node (must be a numeric value in the range 0 .. 65536).
Should be contained in the <a href="#MYSENSORSattrOTA_firmwareConfig">FOTA configuration
file</a>.</p>
</li>
<b>time</b>
<li>
<p><code>set &lt;name&gt; time</code><br/>sets time for nodes (that support it)</p>
</li>
<b>reboot</b>
<li>
<p><code>set &lt;name&gt; reboot</code><br/>reboots a node (requires a bootloader that supports it).<br/>Attention: Nodes that run the standard arduino-bootloader will enter a bootloop!<br/>Dis- and reconnect the nodes power to restart in this case.</p>
</li>
</ul>
<a name="MYSENSORS_DEVICEget"></a>
<p><b>Get</b></p>
<ul>
<li>
<p><code>get &lt;name&gt; Extended_DEBUG</code><br/>
requires MY_SPECIAL_DEBUG</p>
retrieves the CPU frequency, CPU voltage and free memory of the sensor</p>
</li>
</ul>
<ul>
<li>
<p><code>get &lt;name&gt; ReadingsFromComment</code><br/>
rebuild reding names from comments of presentation messages if available</p>
After issuing this get check the log for changes. </p>
</li>
</ul>
<ul>
<li>
<p><code>get &lt;name&gt; RSSI</code><br/>
requires MY_SIGNAL_REPORT_ENABLED, not supported by all transportation layers</p>
delievers a set of Signal Quality information.</p>
</li>
</ul>
<a name="MYSENSORS_DEVICEattr"></a>
<p><b>Attributes</b></p>
<ul>
<li>
<p><code>attr &lt;name&gt; config [&lt;M|I&gt;]</code><br/>configures metric (M) or inch (I). Defaults to 'M'</p>
</li>
<li>
<p><code>attr &lt;name&gt; OTA_autoUpdate [&lt;0|1&gt;]</code><br/>
specifies whether an automatic update of the sensor node should be performed (1) during startup of the
node or not (0). Defaults to 0</p>
</li>
<li>
<p><code>attr &lt;name&gt; setCommands [&lt;command:reading:value&gt;]*</code><br/>configures one or more commands that can be executed by set.<br/>e.g.: <code>attr &lt;name&gt; setCommands on:switch_1:on off:switch_1:off</code><br/>if list of commands contains both 'on' and 'off' <a href="#setExtensions">set extensions</a> are supported</p>
</li>
<li>
<p><code>attr &lt;name&gt; setReading_&lt;reading&gt; [&lt;value&gt;]*</code><br/>configures a reading that can be modified by set-command<br/>e.g.: <code>attr &lt;name&gt; setReading_switch_1 on,off</code></p>
</li>
<li>
<p><code>attr &lt;name&gt; setExtensionsEvent</code><br/>If set, the event will contain the command implemented by SetExtensions
(e.g. on-for-timer 10), else the executed command (e.g. on).
</li>
<li>
<p><code>attr &lt;name&gt; mapReading_&lt;reading&gt; &lt;childId&gt; &lt;readingtype&gt; [&lt;value&gt;:&lt;mappedvalue&gt;]*</code><br/>configures the reading-name for a given childId and sensortype<br/>e.g.: <code>attr xxx mapReading_aussentemperatur 123 temperature</code>
or <code>attr xxx mapReading_leftwindow 10 status 1:closed 0:open</code>. See also mapReadingType for setting defaults for types without predefined defaults</p>
</li>
<li>
<p><code>attr &lt;name&gt; requestAck</code><br/>request acknowledge from nodes.<br/>if set the Readings of nodes are updated not before requested acknowledge is received<br/>if not set the Readings of nodes are updated immediatly (not awaiting the acknowledge).<br/>May also be configured on the gateway for all nodes at once</p>
</li>
<li>
<p><code>attr &lt;name&gt; mapReadingType_&lt;reading&gt; &lt;new reading name&gt; [&lt;value&gt;:&lt;mappedvalue&gt;]*</code><br/>configures reading type names that should be used instead of technical names<br/>e.g.: <code>attr xxx mapReadingType_LIGHT switch 0:on 1:off</code>to be used for mysensor Variabletypes that have no predefined defaults (yet)</p>
</li>
<li>
<p><code>attr &lt;name&gt; OTA_BL_Type &lt;either Optiboot or MYSBootloader&gt;*</code><br/>For other bootloaders than Optiboot V3.0 OTA updates will only work if bootloader type is specified - MYSBootloader will reboot node if firmware update is started, so make sure, node will really recover</p>
</li>
<li>
<p><code>attr &lt;name&gt; OTA_Chan76_IODev </code><br/>As MYSBootloader per default uses nRF24 channel 76, you may specify a different IODev for OTA data using channel 76</p>
</li>
<li>
<p><code>attr &lt;name&gt; timeoutAck &lt;time in seconds&gt;*</code><br/>configures timeout to set device state to NACK in case not all requested acks are received</p>
</li>
<li>
<p><code>attr &lt;name&gt; timeoutAlive &lt;time in seconds&gt;*</code><br/>configures timeout to set device state to alive or dead. If messages from node are received within timout spec, state will be alive, otherwise dead. If state is NACK (in case timeoutAck is also set), state will only be changed to alive, if there are no outstanding messages to be sent.</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-set-update"></a><b>AttrTemplate</b></p>
<p>Helps to easily configure your devices. Just get a list of all available attrTremplates by issuing<br>
<code>set &lt;name&gt; attrTemplate ?</code></p>
<p>Have a look at the descriptions and choose a suitable one. Then use the drop-down list and click "set" or use<br>
<code>set &lt;name&gt; attrTemplate A_02a_atmospheric_pressure</code></p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-set-clear"></a><b>clear</b></p>
<p><code>set &lt;name&gt; clear</code></p>
<p>clears MySensors EEPROM area and reboot (i.e. &quot;factory&quot; reset) - requires MY_SPECIAL_DEBUG</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-set-flash"></a><b>flash</b></p>
<p><code>set &lt;name&gt; flash</code></p>
<p>Checks whether a newer firmware version is available. If a newer firmware version is
available the flash procedure is started. The sensor node must support FOTA for
this.</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-set-fwType"></a><b>fwType</b></p>
<p><code>set &lt;name&gt; fwType &lt;value&gt;</code></p>
<p>assigns a firmware type to this node (must be a numeric value in the range 0 .. 65536).<br>
Should be contained in the <a href="#MYSENSORS-attr-ota_firmwareconfig">FOTA configuration file</a>.</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-set-time"></a><b>time</b></p>
<p><code>set &lt;name&gt; time</code></p>
<p>sets time for nodes (that support it)</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-set-reboot"></a><b>reboot</b></p>
<p><code>set &lt;name&gt; reboot</code></p>
<p>reboots a node (requires a bootloader that supports it).<br/>Attention: Nodes that run the standard arduino-bootloader will enter a bootloop!<br/>Dis- and reconnect the nodes power to restart in this case.</p>
</li>
</ul>
<a id="MYSENSORS_DEVICE-get"></a>
<h4>Get</h4>
<ul>
<li>
<p><a id="MYSENSORS_DEVICE-get-extended_debug"></a><b>Extended_DEBUG</b></p>
<p><code>get &lt;name&gt; Extended_DEBUG</code></p>
<p>requires MY_SPECIAL_DEBUG<br>
retrieves the CPU frequency, CPU voltage and free memory of the sensor</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-get-readingsfromcomment"></a><b>ReadingsFromComment</b></p>
<p><code>get &lt;name&gt; ReadingsFromComment</code></p>
<p>rebuild reding names from comments of presentation messages if available<br>
After issuing this get check the log for changes.</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-get-rssi"></a><b>RSSI</b></p>
<p><code>get &lt;name&gt; RSSI</code></p>
<p>requires MY_SIGNAL_REPORT_ENABLED, not supported by all transportation layers<br>
delievers a set of Signal Quality information.</p>
</li>
</ul>
<a id="MYSENSORS_DEVICE-attr"></a>
<h4>Attributes</h4>
<ul>
<li>
<p><a id="MYSENSORS_DEVICE-attr-config"></a><b>config</b></p>
<p><code>attr &lt;name&gt; config [&lt;M|I&gt;]</code></p>
<p>configures metric (M) or inch (I). Defaults to 'M'</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-ota_autoUpdate"></a><b>OTA_autoUpdate</b></p>
<p><code>attr &lt;name&gt; OTA_autoUpdate [&lt;0|1&gt;]</code></p>
<p>specifies whether an automatic update of the sensor node should be performed (1) during startup of the node or not (0). Defaults to 0</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-setcommands"></a><b>setCommands</b></p>
<p><code>attr &lt;name&gt; setCommands [&lt;command:reading:value&gt;]*</code></p>
<p>configures one or more commands that can be executed by set.</p>
<p>e.g.:<br>
<code>attr &lt;name&gt; setCommands on:switch_1:on off:switch_1:off</code></p>
<p>if list of commands contains both 'on' and 'off' <a href="#setExtensions">set extensions</a> are supported</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-setreading"></a><b>setReading_&lt;reading&gt;</b></p>
<p><code>attr &lt;name&gt; setReading_&lt;reading&gt; [&lt;value&gt;]*</code></p>
<p>configures a reading that can be modified by set-command</p>
<p>e.g.:<br>
<code>attr &lt;name&gt; setReading_switch_1 on,off</code></p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-setextensionsevent"></a><b>setExtensionsEvent</b></p>
<p><code>attr &lt;name&gt; setExtensionsEvent</code></p>
<p>If set, the event will contain the command implemented by SetExtensions (e.g. on-for-timer 10), else the executed command (e.g. on).</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-mapreading"></a><b>mapReading_&lt;reading&gt;</b></p>
<p><code>attr &lt;name&gt; mapReading_&lt;reading&gt; &lt;childId&gt; &lt;readingtype&gt; [&lt;value&gt;:&lt;mappedvalue&gt;]*</code></p>
<p>configures the reading-name for a given childId and sensortype</p>
<p>e.g.:<br>
<code>attr xxx mapReading_aussentemperatur 123 temperature</code><br>
<code>attr xxx mapReading_leftwindow 10 status 1:closed 0:open</code></p>
<p>See also mapReadingType for setting defaults for types without predefined defaults</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-requestack"></a><b>requestAck</b></p>
<p><code>attr &lt;name&gt; requestAck</code></p>
<p>request acknowledge from nodes.<br>
if set the Readings of nodes are updated not before requested acknowledge is received<br>
if not set the Readings of nodes are updated immediatly (not awaiting the acknowledge).<br>
May also be configured on the gateway for all nodes at once</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-mapreadingtype"></a><b>mapReadingType_&lt;reading&gt;</b></p>
<p><code>attr &lt;name&gt; mapReadingType_&lt;reading&gt; &lt;new reading name&gt; [&lt;value&gt;:&lt;mappedvalue&gt;]*</code></p>
<p>configures reading type names that should be used instead of technical names</p>
<p>e.g.:<br>
<code>attr xxx mapReadingType_LIGHT switch 0:on 1:off</code></p>
<p>to be used for mysensor Variabletypes that have no predefined defaults (yet)</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-ota_bl_type"></a><b>OTA_BL_Type</b></p>
<p><code>attr &lt;name&gt; OTA_BL_Type &lt;either Optiboot or MYSBootloader&gt;*</code></p>
<p>For other bootloaders than Optiboot V3.0 OTA updates will only work if bootloader type is specified - MYSBootloader will reboot node if firmware update is started, so make sure, node will really recover</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-ota_chan76_iodev"></a><b>OTA_Chan76_IODev</b></p>
<p><code>attr &lt;name&gt; OTA_Chan76_IODev </code></p>
<p>As MYSBootloader per default uses nRF24 channel 76, you may specify a different IODev for OTA data using channel 76</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-timeoutack"></a><b>timeoutAck</b></p>
<p><code>attr &lt;name&gt; timeoutAck &lt;time in seconds&gt;*</code></p>
<p>configures timeout to set device state to NACK in case not all requested acks are received</p>
</li>
<li>
<p><a id="MYSENSORS_DEVICE-attr-timeoutalive"></a><b>timeoutAlive</b></p>
<p><code>attr &lt;name&gt; timeoutAlive &lt;time in seconds&gt;*</code></p>
<p>configures timeout to set device state to alive or dead. If messages from node are received within timout spec, state will be alive, otherwise dead. If state is NACK (in case timeoutAck is also set), state will only be changed to alive, if there are no outstanding messages to be sent.</p>
</li>
</ul>
=end html