From 2451fdeef18973dbd870001da9a6d5fba4263312 Mon Sep 17 00:00:00 2001 From: Angeloxx92 <48996402+Angeloxx92@users.noreply.github.com> Date: Mon, 29 Apr 2019 16:39:59 +0200 Subject: [PATCH 1/7] Update EEP.xml Added D2-01-09 --- enocean/protocol/EEP.xml | 170 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) diff --git a/enocean/protocol/EEP.xml b/enocean/protocol/EEP.xml index f447fb1..49a6033 100644 --- a/enocean/protocol/EEP.xml +++ b/enocean/protocol/EEP.xml @@ -7,6 +7,7 @@ + @@ -1151,6 +1152,7 @@ + @@ -1165,6 +1167,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From b59e3ee1af2966aa9ee212f2789c3481bc6ad68d Mon Sep 17 00:00:00 2001 From: Angeloxx92 <48996402+Angeloxx92@users.noreply.github.com> Date: Mon, 29 Apr 2019 16:42:09 +0200 Subject: [PATCH 2/7] Update EEP.xml --- enocean/protocol/EEP.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/enocean/protocol/EEP.xml b/enocean/protocol/EEP.xml index 49a6033..990fda9 100644 --- a/enocean/protocol/EEP.xml +++ b/enocean/protocol/EEP.xml @@ -1226,7 +1226,7 @@ - + @@ -1256,7 +1256,7 @@ - + @@ -1300,7 +1300,7 @@ - + @@ -1314,7 +1314,7 @@ - + From 2aec10ffe8d08a4c5244f0f4b9b6109488592352 Mon Sep 17 00:00:00 2001 From: Angeloxx92 <48996402+Angeloxx92@users.noreply.github.com> Date: Wed, 1 May 2019 16:31:17 +0200 Subject: [PATCH 3/7] Added self.command Added self.command inside packet class and added a way to store inside self.command the command of every VDL packet received --- enocean/protocol/packet.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/enocean/protocol/packet.py b/enocean/protocol/packet.py index 63e70b0..702f068 100644 --- a/enocean/protocol/packet.py +++ b/enocean/protocol/packet.py @@ -25,7 +25,7 @@ def __init__(self, packet_type, data=None, optional=None): self.rorg_func = None self.rorg_type = None self.rorg_manufacturer = None - + self.command = None #save here the command of every VDL packet look at the example self.received = None if not isinstance(data, list) or data is None: @@ -326,7 +326,9 @@ def parse(self): self.learn = True self.rorg = self.data[0] - + #parse the command of the VDL packet + if self.rorg== RORG.VLD: + self.command = enocean.utils.from_bitarray(self._bit_data[4:8]) #in this way i'll store the command of the packet # parse learn bit and FUNC/TYPE, if applicable if self.rorg == RORG.BS1: self.learn = not self._bit_data[DB0.BIT_3] From 06412443ebc92e4554083057ff4a88338697d641 Mon Sep 17 00:00:00 2001 From: Angeloxx92 <48996402+Angeloxx92@users.noreply.github.com> Date: Thu, 2 May 2019 11:03:53 +0200 Subject: [PATCH 4/7] Update SUPPORTED_PROFILES.md --- SUPPORTED_PROFILES.md | 145 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 145 insertions(+) diff --git a/SUPPORTED_PROFILES.md b/SUPPORTED_PROFILES.md index 51d01f2..bd9e60a 100644 --- a/SUPPORTED_PROFILES.md +++ b/SUPPORTED_PROFILES.md @@ -2,6 +2,15 @@ All profiles (should) correspond to the official [EEP](http://www.enocean-alliance.org/eep/) by EnOcean. ### RPS Telegram (0xF6) +##### RORG 0xF6 - FUNC 0x01 - TYPE 0x01 - Push Button + +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|PB |Status of the push button |enum |0 - Released | +| | | |1 - Pressed | + + + ##### RORG 0xF6 - FUNC 0x02 - TYPE 0x02 - Light and Blind Control - Application Style 2 |shortcut|description |type |values | @@ -300,6 +309,37 @@ All profiles (should) correspond to the official [EEP](http://www.enocean-allian |TMP |Temperature (linear) |value |255.0-0.0 ↔ 0.0-40.0 °C | +##### RORG 0xA5 - FUNC 0x10 - TYPE 0x05 - Temperature Sensor, Set Point and Occupancy Control + +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|SP |Set Point (linear) |value |0.0-255.0 ↔ 0.0-255.0 % | +|TMP |Temperature (linear) |value |255.0-0.0 ↔ 0.0-40.0 °C | +|OCC |Occupancy Button |enum |0 - Button pressed | +| | | |1 - Button released | + + +##### RORG 0xA5 - FUNC 0x10 - TYPE 0x06 - Temperature Sensor, Set Point and Day/Night Control + +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|SP |Set Point (linear) |value |0.0-255.0 ↔ 0.0-255.0 % | +|TMP |Temperature (linear) |value |255.0-0.0 ↔ 0.0-40.0 °C | +|SLSW |Slide switch |enum |0 - Position I / Night / Off | +| | | |1 - Position O / Day / On | + + +##### RORG 0xA5 - FUNC 0x10 - TYPE 0x10 - Temperature and Humidity Sensor, Set Point and Occupancy Control + +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|SP |Set Point (linear) |value |0.0-255.0 ↔ 0.0-255.0 | +|HUM |Rel. Humidity (linear) |value |0.0-250.0 ↔ 0.0-100.0 % | +|TMP |Temperature (linear) |value |0.0-250.0 ↔ 0.0-40.0 °C | +|OCC |Occupancy Button |enum |0 - Button pressed | +| | | |1 - Button released | + + ##### RORG 0xA5 - FUNC 0x10 - TYPE 0x12 - Temperature and Humidity Sensor and Set Point |shortcut|description |type |values | @@ -497,14 +537,119 @@ All profiles (should) correspond to the official [EEP](http://www.enocean-allian | | | |2 - Dim to new output level - dim timer 2 | | | | |3 - Dim to new output level - dim timer 3 | | | | |4 - Stop dimming | +| | | |5-7 - Not used | +|IO |I/O channel |enum |0-29 - Output channel {value} (to load) | +| | | |30 - All output channels supported by the device | +| | | |31 - Input channel (from mains supply) | +|OV |Output value |enum |0 - Output value 0% or OFF | +| | | |1-100 - Output value {value}% or ON | +| | | |101-126 - Not used | +| | | |127 - output value not valid / not set | + + +##### RORG 0xD2 - FUNC 0x01 - TYPE 0x09 - Electronic switch with Local Control + +###### command: 1 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|CMD |command identifier |enum |0-13 - Command ID {value} | +|DV |Dim value |enum |0 - Switch to new output value | +| | | |1 - Dim to new output level - dim timer 1 | +| | | |2 - Dim to new output level - dim timer 2 | +| | | |3 - Dim to new output level - dim timer 3 | +| | | |4 - Stop dimming | +| | | |5-7 - Not used | |IO |I/O channel |enum |0-29 - Output channel {value} (to load) | | | | |30 - All output channels supported by the device | | | | |31 - Input channel (from mains supply) | |OV |Output value |enum |0 - Output value 0% or OFF | | | | |1-100 - Output value {value}% or ON | | | | |101-126 - Not used | +| | | |127 - Output value not valid / not set | + +###### command: 3 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|CMD |command identifier |enum |0-13 - Command ID {value} | +|IO |I/O channel |enum |0-29 - Output channel {value} (to load) | +| | | |30 - All output channels supported by the device | +| | | |31 - Input channel (from mains supply) | + +###### command: 4 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|PF |Power Failure |enum |0 - Power Failure Detection disabled/not supported | +| | | |1 - Power Failure Detection enabled | +|PFD |Power Failure Detection |enum |0 - Power Failure Detection not detected/not supported/disabled | +| | | |1 - Power Failure Detection Detected | +|CMD |command identifier |enum |0-13 - Command ID {value} | +|OC |Over current switch off |enum |0 - Over current switch off: ready / not supported | +| | | |1 - Over current switch off: executed | +|EL |Error level |enum |0 - Error level 0: hardware OK | +| | | |1 - Error level 1: hardware warning | +| | | |2 - Error level 2: hardware failure | +| | | |3 - Error level not supported | +|IO |I/O channel |enum |0-29 - Output channel {value} (to load) | +| | | |30 - Not applicable, do not use | +| | | |31 - Input channel (from mains supply) | +|LC |Local control |enum |0 - Local control disabled / not supported | +| | | |1 - Local control enabled | +|OV |Output value |enum |0 - Output value 0% or OFF | +| | | |1-100 - Output value {value}% or ON | +| | | |101-126 - Not used | | | | |127 - output value not valid / not set | +###### command: 5 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|CMD |command identifier |enum |0-13 - Command ID {value} | +|RM |Report measurement |enum |0 - Report measurement: query only | +| | | |1 - Report measurement: query / auto reporting | +|RE |Reset measurement |enum |0 - Report measurement: not active | +| | | |1 - Report measurement: trigger signal | +|e/p |Measurement mode |enum |0 - Energy measurement | +| | | |1 - Power measurement | +|IO |I/O channel |enum |0-29 - Output channel {value} (to load) | +| | | |30 - All output channels supported by the device | +| | | |31 - Input channel (from mains supply) | +|MD_LSB |Measurement delta to be reported(LSB) |enum |0-4095 - N/A | +|UN |Unit |enum |0 - Energy[Ws] | +| | | |1 - Energy[Wh] | +| | | |2 - Energy[KWh] | +| | | |3 - Power[W] | +| | | |4 - Power[KW] | +| | | |5-7 - Not used | +|MD_MSB |Measurement delta to be reported(MSB) |enum |0-4095 - N/A | +|MAT |Maximum time between two subsequent actuator messages|enum |1-255 - Measurement Response messages[10s] | +| | | |0 - Reserved | +|MIT |Minimum time between two subsequent actuator messages|enum |1-255 - Measurement Response messages[s] | +| | | |0 - Reserved | + +###### command: 6 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|CMD |command identifier |enum |0-13 - Command ID {value} | +|qu |Query |enum |0 - Query energy | +| | | |1 - Query power | +|IO |I/O channel |enum |0-29 - Output channel {value} (to load) | +| | | |30 - All output channels supported by the device | +| | | |31 - Input channel (from mains supply) | + +###### command: 7 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|CMD |command indentifier |enum |0-13 - Command ID {value} | +|UN |Unit |enum |0 - Energy[Ws] | +| | | |1 - Energy[Wh] | +| | | |2 - Energy[KWh] | +| | | |3 - Power[W] | +| | | |4 - Power[KW] | +| | | |5-7 - Not used | +|IO |I/O channel |enum |0-29 - Output channel {value} (to load) | +| | | |30 - Not applicable, do not use | +| | | |31 - Input channel (from mains supply) | +|MV |Measurement value(4 bytes) |enum |0-4294967295 - DB3 = MSB / DB0 = LSB | + ##### RORG 0xD2 - FUNC 0x05 - TYPE 0x00 - Type 0x00 From 05b1f91188dd86ba0c091808e95940bd462bd167 Mon Sep 17 00:00:00 2001 From: Angeloxx92 <48996402+Angeloxx92@users.noreply.github.com> Date: Thu, 2 May 2019 12:47:13 +0200 Subject: [PATCH 5/7] added example in this example is shown the way to parse the VDL packet with the correct command (work's with all of the vdl packet's that have commands) --- examples/example_plug_D2-01-09.py | 53 +++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 examples/example_plug_D2-01-09.py diff --git a/examples/example_plug_D2-01-09.py b/examples/example_plug_D2-01-09.py new file mode 100644 index 0000000..f2557a5 --- /dev/null +++ b/examples/example_plug_D2-01-09.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- +from enocean.consolelogger import init_logging +import enocean.utils +from enocean.communicators.serialcommunicator import SerialCommunicator +from enocean.protocol.packet import RadioPacket +from enocean.protocol.constants import PACKET, RORG +import sys +import traceback + +try: + import queue +except ImportError: + import Queue as queue + + +def assemble_radio_packet(transmitter_id): #i'm sending as an example an Actuator Status Query to the plug + return RadioPacket.create(rorg=RORG.VLD, rorg_func=0x01, rorg_type=0x09, command=3, destination=[0x01, 0x87, 0xBC, 0x25], sender=communicator.base_id, IO=0x1E) + #this is my plug_id +#init_logging() +communicator = SerialCommunicator(port=u'/dev/ttyUSB0', callback=None) +communicator.start() +print('The Base ID of your module is %s.' % enocean.utils.to_hex_string(communicator.base_id)) + +if communicator.base_id is not None: + print('Sending example package.') + communicator.send(assemble_radio_packet(communicator.base_id)) + +# endless loop receiving radio packets +while communicator.is_alive(): + try: + # Loop to empty the queue... + packet = communicator.receive.get(block=True, timeout=1) + + if packet.packet_type == PACKET.RADIO and packet.rorg == RORG.VLD: + # in this way i'll parse the correct command of the radio packet sent by the plug + packet.select_eep(0x01, 0x09, command=packet.command) + # parse it + packet.parse_eep() + for k in packet.parsed: + print('%s: %s\n' % (k, packet.parsed[k])) + + + except queue.Empty: + continue + except KeyboardInterrupt: + break + except Exception: + traceback.print_exc(file=sys.stdout) + break + +if communicator.is_alive(): + communicator.stop() From b0c716c8799b09cfacd46889533835e39b481c30 Mon Sep 17 00:00:00 2001 From: Angeloxx92 <48996402+Angeloxx92@users.noreply.github.com> Date: Tue, 7 May 2019 08:50:29 +0200 Subject: [PATCH 6/7] Update EEP.xml Fixed D2-01-01: Added CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 Added also: D2-01-00 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 D2-01-01 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 D2-01-02 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 D2-01-03 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 D2-01-04 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 D2-01-05 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 D2-01-06 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 D2-01-07 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 D2-01-08 : CMD 0x01, 0x03, 0x04,0x05,0x06,0x07 --- enocean/protocol/EEP.xml | 1449 +++++++++++++++++++++++++++++++++++++- 1 file changed, 1441 insertions(+), 8 deletions(-) diff --git a/enocean/protocol/EEP.xml b/enocean/protocol/EEP.xml index 990fda9..f407788 100644 --- a/enocean/protocol/EEP.xml +++ b/enocean/protocol/EEP.xml @@ -1088,15 +1088,15 @@ - - + + - + - - - + + + @@ -1104,6 +1104,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1113,7 +1147,7 @@ - + @@ -1142,8 +1176,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -1159,6 +1289,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1166,6 +1344,1261 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 6db9043b9ef95e7544a95b6cb8f75868f441f331 Mon Sep 17 00:00:00 2001 From: Angeloxx92 <48996402+Angeloxx92@users.noreply.github.com> Date: Tue, 7 May 2019 09:03:04 +0200 Subject: [PATCH 7/7] Update EEP.xml --- enocean/protocol/EEP.xml | 1449 +------------------------------------- 1 file changed, 8 insertions(+), 1441 deletions(-) diff --git a/enocean/protocol/EEP.xml b/enocean/protocol/EEP.xml index f407788..990fda9 100644 --- a/enocean/protocol/EEP.xml +++ b/enocean/protocol/EEP.xml @@ -1088,15 +1088,15 @@ - - + + - + - - - + + + @@ -1104,40 +1104,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1147,7 +1113,7 @@ - + @@ -1176,104 +1142,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -1289,54 +1159,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1344,1261 +1166,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -