Enocean devices management
LinkIO products support controls from Enocean BLE Energy Harvesting switches and sensors (See PTM 215B ). Enocean protocol is compatible with BLE 4.0. Telegrams are standard advertising BLE frames (with Manufacturer Specific data field).
In order to be controlled by a switch, a BLE actuator device needs to receive and be able to decode the Enocean telegrams. Consequently each device needs to store the switch identity in order to perform an action (feature control). This operation is called Enocean commissioning, described below.
Enocean PTM215B switch identification
A PTM215B switch is identified by the following parameters :
Its BLE MAC address (6 bytes)
A Security key (16 bytes)
Switch control
Each switch press/release is identified by an Id : A0, A1 or A0, A1, B0, B1. We must assign an Id to a feature control during the commissioning process. In order to simplify configuration, A0 & B0 are assigned to ON/UP operation, A1 & B1 are assigned to OFF/DOWN operation.
Note
The tilt/angle control for the roller shutter needs to be specified !
Enocean commissioning through serial and MESH
One Enocean device can be added or removed from the devices list of each product to control, through serial commands (in the controller) and propagated through the BLE MESH to the product. Each product can store up to 3 devices. One Enocean devices may be stored into several products, in order to provide the “one switch/multi products” control.
The commissioning information are the following :
The device UUID where to store the Enocean identities
The Enocean BLE MAC address (6 bytes)
The Enocean Security key (16 bytes)
Binding data (currently 4 bytes)
Commissioning binding data
The binding data is an array of couples associating Switch ids (A/right: 0, B/left : 1) to a product feature index (some product may have several features to contol, see products description sections) The bits [7..4] of the first couple byte indicate the key control mode (0: up-on/down-off, 1: up/down-toggle).
Byte index |
Meaning |
|---|---|
n bits [3..0] |
Switch selection A/left: 0, B/right: 1 |
n bits [7..4] |
0: up-on/down-off, 1: up/down-toggle |
n+1 |
Feature_idx |
Example 1 : 1 double switch controls 2 features in the same product
On/off actions:
Byte index |
Value |
Meaning |
|---|---|---|
0 |
0x00 |
A/left switch control (on/off) |
1 |
0x01 |
Feature_idx[1] |
2 |
0x01 |
B/right switch control (on/off) |
3 |
0x02 |
Feature_idx[2] |
Toggle actions:
Byte index |
Value |
Meaning |
|---|---|---|
0 |
0x10 |
A/left switch control (toggle) |
1 |
0x01 |
Feature_idx[1] |
2 |
0x11 |
B/right switch control (toggle) |
3 |
0x02 |
Feature_idx[2] |
Example 2 : 1 double switch controls 2 different Products
Here the left switch controls product UUD1/feature[1] and the right switch controls product UUD2/feature[1]. 2 different commissioning operations on products UUID1 and UUID2 should be performed :
Binding data for UUID1 :
Byte index |
Value |
Meaning |
|---|---|---|
0 |
0x00 |
A/left switch control (on/off) |
1 |
0x01 |
Feature_idx[1] |
2 |
0xff |
Unused |
3 |
0xff |
Unused |
Binding data for UUID2 :
Byte index |
Value |
Meaning |
|---|---|---|
0 |
0x01 |
B/right switch control (on/off) |
1 |
0x01 |
Feature_idx[1] |
2 |
0xff |
Unused |
3 |
0xff |
Unused |
Data Persistance
The Enocean data are stored in product NVS. The data are erased by a Factory Reset operation.
Zephyr mesh shell
models msg send-vnd-rsp command may be used to provision the Enocean switches :
mesh models msg send-vnd-rsp <elem addr> <Model ID> [Company ID] <addr> <opcode> <payload>
Mesh Opcodes
Enocean configuration is performed through the Enocean devices management.
ENOCEAN_OPCODE_SET = 0xC8, /**< Set a new entry or update an existing entry (Acknowledged). */
ENOCEAN_OPCODE_GET = 0xC9, /**< Get an entry . */
ENOCEAN_OPCODE_DELETE = 0xCA, /**< Delete one entry (Acknowledged). */
ENOCEAN_OPCODE_SET_STATUS = 0xCB, /**< Status message sent as reply to a @ref ENOCEAN_OPCODE_SET. */
ENOCEAN_OPCODE_GET_STATUS = 0xCD, /**< Status message sent as reply to a @ref ENOCEAN_OPCODE_GET. */
ENOCEAN_OPCODE_DELETE_STATUS = 0xCE /**< Status message sent as reply to a @ref ENOCEAN_OPCODE_DELETE. */
Set a new entry or update an existing entry
# opcode = ENOCEAN_OPCODE_SET
# given mac_address=E2:15:00:00:7E:22
# given security_key=F7FEC2549EA4A95B7C52AD49497E8F69
# given binding=[0, 1]
# payload=<mac_address><security_key><binding>
# payload=227E000015E2F7FEC2549EA4A95B7C52AD49497E8F6900010101
=> mesh models msg send-vnd-rsp 1 0x0009 0x04AA 3 0xC8 227E000015E2F7FEC2549EA4A95B7C52AD49497E8F6900010101
# answer with opcode ENOCEAN_OPCODE_SET_STATUS = 0xCB
# payload = <status code>
L: [19:19:59.714,569] <inf> model: from 0x0003 dst 0x0002 rssi -24 element 1, model 0x04aa op 0xcb04aa len 1: 00
Get an entry
# opcode = ENOCEAN_OPCODE_GET
# given mac_address=E2:15:00:00:7E:22
# payload=<mac_address>
# payload=227E000015E2
=> mesh models msg send-vnd-rsp 1 0x0009 0x04AA 3 0xC9 227E000015E2
# answer with opcode ENOCEAN_OPCODE_GET_STATUS = 0xCD
# payload = <status code><mac_address><security_key><binding>
L: [19:20:01.468,536] <inf> model: from 0x0003 dst 0x0002 rssi -23 element 1, model 0x04aa op 0xcd04aa len 39: 00227e000015e2f7fec2549ea4a95b7c52ad49497e8f6900010101f80320e2490020f1ffffff00
Delete one entry
# opcode = ENOCEAN_OPCODE_DELETE
# given mac_address=E2:15:00:00:7E:22
# payload=<mac_address>
# payload=227E000015E2
=> mesh models msg send-vnd-rsp 1 0x0009 0x04AA 3 0xCA 227E000015E2
# answer with opcode ENOCEAN_OPCODE_DELETE_STATUS = 0xCE
# payload = <status code>
L: [20:01:47.145,935] <inf> model: from 0x0003 dst 0x0002 rssi -24 element 1, model 0x04aa op 0xce04aa len 1: 00
Delete all entries
To delete all entries, send the delete command with mac_address=00:00:00:00:00:00
=> mesh models msg send-vnd-rsp 1 0x0009 0x04AA 3 0xCA 000000000000
L: [21:11:03.267,913] <inf> model: from 0x0003 dst 0x0002 rssi -27 element 1, model 0x04aa op 0xce04aa len 1: 00
STM550B Multi-sensor management
To be Completed. The BLE telegram from the Multi-sensor will be directly decoded by the Gateway BLE controller module.
Enocean STM550B multi-sensor identification
A STM550B multi-sensor is identified by the following parameters
Its BLE MAC address (6 bytes)
A Security key (16 bytes)
TBC