From 45c01910a3cb012a70c16208ff437784cc4f8900 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Wed, 5 May 2021 06:24:21 +0000 Subject: [PATCH] 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 --- fhem/FHEM/00_MYSENSORS.pm | 140 ++++++++-------- fhem/FHEM/10_MYSENSORS_DEVICE.pm | 264 +++++++++++++++++-------------- 2 files changed, 221 insertions(+), 183 deletions(-) diff --git a/fhem/FHEM/00_MYSENSORS.pm b/fhem/FHEM/00_MYSENSORS.pm index 790847510..be0026959 100644 --- a/fhem/FHEM/00_MYSENSORS.pm +++ b/fhem/FHEM/00_MYSENSORS.pm @@ -1000,75 +1000,81 @@ __END__ =begin html - +
connects fhem to MYSENSORS.
+A single MYSENSORS device can serve multiple MYSENSORS_DEVICE clients.
+ Each MYSENSORS_DEVICE represents a mysensors node.
define <name> MYSENSORS <serial device>|<ip:port>
Specifies the MYSENSORS device.
+ + +connects fhem to MYSENSORS.
-A single MYSENSORS device can serve multiple MYSENSORS_DEVICE clients.
- Each MYSENSORS_DEVICE represents a mysensors node.
-
-
Define
-define <name> MYSENSORS <serial device>|<ip:port>
Specifies the MYSENSORS device.
-Set
-set <name> connect
- (re-)connects the MYSENSORS-device to the MYSENSORS-gateway
set <name> disconnect
- disconnects the MYSENSORS-device from the MYSENSORS-gateway
set <name> inclusion-mode on|off
- turns the gateways inclusion-mode on or off
Attributes
-attr <name> autocreate
- enables auto-creation of MYSENSOR_DEVICE-devices on receival of presentation-messages
attr <name> requestAck
- request acknowledge from nodes.
- if set the Readings of nodes are updated not before requested acknowledge is received
- 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.
attr <name> first-sensorid <<number <h; 255>>
- configures the lowest node-id assigned to a mysensor-node on request (defaults to 20)
attr <name> OTA_firmwareConfig <filename>
- specifies a configuration file for the FOTA
- (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):
#Type,Name,Version,File,Comments
- 10,Blink,1,Blink.hex,blinking example
The meaning of the columns is the following: -
Type
Name
Version
File
Comments
set <name> connect
(re-)connects the MYSENSORS-device to the MYSENSORS-gateway
+set <name> disconnect
disconnects the MYSENSORS-device from the MYSENSORS-gateway
+set <name> inclusion-mode on|off
turns the gateways inclusion-mode on or off
+attr <name> autocreate
enables auto-creation of MYSENSOR_DEVICE-devices on receival of presentation-messages
+attr <name> requestAck
request acknowledge from nodes.
+if set the Readings of nodes are updated not before requested acknowledge is received
+ 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.
+attr <name> first-sensorid <number <h;255>>
configures the lowest node-id assigned to a mysensor-node on request (defaults to 20)
+attr <name> OTA_firmwareConfig <filename>
specifies a configuration file for the FOTA + (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):
+#Type,Name,Version,File,Comments
+ 10,Blink,1,Blink.hex,blinking example
The meaning of the columns is the following:
+Type
Name
Version
File
Comments
represents a mysensors sensor attached to a mysensor-node
-requires a MYSENSORS-device as IODev
- -Define
-define <name> MYSENSORS_DEVICE <Sensor-type> <node-id>
Specifies the MYSENSOR_DEVICE device.
Set
-set <name> attrTemplate ?
set <name> attrTemplate A_02a_atmospheric_pressure
set <name> clear
clears MySensors EEPROM area and reboot (i.e. "factory" reset) - requires MY_SPECIAL_DEBUG
set <name> flash
- 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.
set <name> fwType <value>
- assigns a firmware type to this node (must be a numeric value in the range 0 .. 65536).
- Should be contained in the FOTA configuration
- file.
set <name> time
sets time for nodes (that support it)
set <name> reboot
reboots a node (requires a bootloader that supports it).
Attention: Nodes that run the standard arduino-bootloader will enter a bootloop!
Dis- and reconnect the nodes power to restart in this case.
represents a mysensors sensor attached to a mysensor-node
+requires a MYSENSORS-device as IODev
-Get
-get <name> Extended_DEBUG
- requires MY_SPECIAL_DEBUG
get <name> ReadingsFromComment
- rebuild reding names from comments of presentation messages if available
get <name> RSSI
- requires MY_SIGNAL_REPORT_ENABLED, not supported by all transportation layers
Attributes
-attr <name> config [<M|I>]
configures metric (M) or inch (I). Defaults to 'M'
attr <name> OTA_autoUpdate [<0|1>]
- specifies whether an automatic update of the sensor node should be performed (1) during startup of the
- node or not (0). Defaults to 0
attr <name> setCommands [<command:reading:value>]*
configures one or more commands that can be executed by set.
e.g.: attr <name> setCommands on:switch_1:on off:switch_1:off
if list of commands contains both 'on' and 'off' set extensions are supported
attr <name> setReading_<reading> [<value>]*
configures a reading that can be modified by set-command
e.g.: attr <name> setReading_switch_1 on,off
attr <name> setExtensionsEvent
If set, the event will contain the command implemented by SetExtensions
- (e.g. on-for-timer 10), else the executed command (e.g. on).
-
attr <name> mapReading_<reading> <childId> <readingtype> [<value>:<mappedvalue>]*
configures the reading-name for a given childId and sensortype
e.g.: attr xxx mapReading_aussentemperatur 123 temperature
- or attr xxx mapReading_leftwindow 10 status 1:closed 0:open
. See also mapReadingType for setting defaults for types without predefined defaults
attr <name> requestAck
request acknowledge from nodes.
if set the Readings of nodes are updated not before requested acknowledge is received
if not set the Readings of nodes are updated immediatly (not awaiting the acknowledge).
May also be configured on the gateway for all nodes at once
attr <name> mapReadingType_<reading> <new reading name> [<value>:<mappedvalue>]*
configures reading type names that should be used instead of technical names
e.g.: attr xxx mapReadingType_LIGHT switch 0:on 1:off
to be used for mysensor Variabletypes that have no predefined defaults (yet)
attr <name> OTA_BL_Type <either Optiboot or MYSBootloader>*
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
attr <name> OTA_Chan76_IODev
As MYSBootloader per default uses nRF24 channel 76, you may specify a different IODev for OTA data using channel 76
attr <name> timeoutAck <time in seconds>*
configures timeout to set device state to NACK in case not all requested acks are received
attr <name> timeoutAlive <time in seconds>*
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.
define <name> MYSENSORS_DEVICE <Sensor-type> <node-id>
+
Specifies the MYSENSOR_DEVICE device.
+ + +Helps to easily configure your devices. Just get a list of all available attrTremplates by issuing
+ set <name> attrTemplate ?
Have a look at the descriptions and choose a suitable one. Then use the drop-down list and click "set" or use
+ set <name> attrTemplate A_02a_atmospheric_pressure
set <name> clear
clears MySensors EEPROM area and reboot (i.e. "factory" reset) - requires MY_SPECIAL_DEBUG
+set <name> flash
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.
+set <name> fwType <value>
assigns a firmware type to this node (must be a numeric value in the range 0 .. 65536).
+ Should be contained in the FOTA configuration file.
set <name> time
sets time for nodes (that support it)
+set <name> reboot
reboots a node (requires a bootloader that supports it).
Attention: Nodes that run the standard arduino-bootloader will enter a bootloop!
Dis- and reconnect the nodes power to restart in this case.
get <name> Extended_DEBUG
requires MY_SPECIAL_DEBUG
+ retrieves the CPU frequency, CPU voltage and free memory of the sensor
get <name> ReadingsFromComment
rebuild reding names from comments of presentation messages if available
+ After issuing this get check the log for changes.
get <name> RSSI
requires MY_SIGNAL_REPORT_ENABLED, not supported by all transportation layers
+ delievers a set of Signal Quality information.
attr <name> config [<M|I>]
configures metric (M) or inch (I). Defaults to 'M'
+attr <name> OTA_autoUpdate [<0|1>]
specifies whether an automatic update of the sensor node should be performed (1) during startup of the node or not (0). Defaults to 0
+attr <name> setCommands [<command:reading:value>]*
configures one or more commands that can be executed by set.
+e.g.:
+ attr <name> setCommands on:switch_1:on off:switch_1:off
if list of commands contains both 'on' and 'off' set extensions are supported
+attr <name> setReading_<reading> [<value>]*
configures a reading that can be modified by set-command
+e.g.:
+ attr <name> setReading_switch_1 on,off
attr <name> setExtensionsEvent
If set, the event will contain the command implemented by SetExtensions (e.g. on-for-timer 10), else the executed command (e.g. on).
+attr <name> mapReading_<reading> <childId> <readingtype> [<value>:<mappedvalue>]*
configures the reading-name for a given childId and sensortype
+e.g.:
+ attr xxx mapReading_aussentemperatur 123 temperature
+ attr xxx mapReading_leftwindow 10 status 1:closed 0:open
See also mapReadingType for setting defaults for types without predefined defaults
+attr <name> requestAck
request acknowledge from nodes.
+ if set the Readings of nodes are updated not before requested acknowledge is received
+ if not set the Readings of nodes are updated immediatly (not awaiting the acknowledge).
+ May also be configured on the gateway for all nodes at once
attr <name> mapReadingType_<reading> <new reading name> [<value>:<mappedvalue>]*
configures reading type names that should be used instead of technical names
+e.g.:
+ attr xxx mapReadingType_LIGHT switch 0:on 1:off
to be used for mysensor Variabletypes that have no predefined defaults (yet)
+attr <name> OTA_BL_Type <either Optiboot or MYSBootloader>*
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
+attr <name> OTA_Chan76_IODev
As MYSBootloader per default uses nRF24 channel 76, you may specify a different IODev for OTA data using channel 76
+attr <name> timeoutAck <time in seconds>*
configures timeout to set device state to NACK in case not all requested acks are received
+attr <name> timeoutAlive <time in seconds>*
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.
+