diff --git a/.gitignore b/.gitignore index 654e540..2bb1c65 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,5 @@ man MANIFEST dist pip-selfcheck.json + +.vscode/ diff --git a/SUPPORTED_PROFILES.md b/SUPPORTED_PROFILES.md index 036a426..5a25637 100644 --- a/SUPPORTED_PROFILES.md +++ b/SUPPORTED_PROFILES.md @@ -35,18 +35,6 @@ All profiles (should) correspond to the official [EEP](http://www.enocean-allian -##### RORG 0xF6 - FUNC 0x05 - TYPE 0x01 - Liquid Leakage Sensor (mechanic harvester) - -|shortcut|description |type |values | -|--------|--------------------------------------------------|--------|---- | -|WAS |Water Sensor |enum |0-16 - not specified | -| | | |17 - Water detected | -| | | |18-255 - not specified | -|T21 |T21 |status | | -|NU |NU |status | | - - - ##### RORG 0xF6 - FUNC 0x10 - TYPE 0x00 - Window Handle |shortcut|description |type |values | @@ -270,6 +258,30 @@ All profiles (should) correspond to the official [EEP](http://www.enocean-allian +##### RORG 0xA5 - FUNC 0x07 - TYPE 0x01 - Occupancy with Supply voltage monitor + +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|SVC |Supply voltage (OPTIONAL) |value |0.0-250.0 ↔ 0.0-5.0 V | +|PIR |PIR Status |enum |0 - off | +| | | |1 - on | + + + +##### RORG 0xA5 - FUNC 0x08 - TYPE 0x01 - Range 0lx to 510lx, 0°C to +51°C and Occupancy Button + +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|SVC |Supply voltage (linear) |value |0.0-255.0 ↔ 0.0-5.1 V | +|ILL |Illumination (linear) |value |0.0-255.0 ↔ 0.0-510.0 lx | +|TMP |Temperature (linear) |value |0.0-255.0 ↔ 0.0-51.0 °C | +|PIRS |PIR Status |enum |0 - PIR on | +| | | |1 - PIR off | +|OCC |Occupancy Button |enum |0 - Button pressed | +| | | |1 - Button released | + + + ##### RORG 0xA5 - FUNC 0x10 - TYPE 0x03 - Temperature Sensor and Set Point |shortcut|description |type |values | @@ -278,6 +290,15 @@ 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 0x12 - Temperature and Humidity Sensor and Set Point + +|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 | + + ##### RORG 0xA5 - FUNC 0x11 - TYPE 0x02 - Temperature Controller Output @@ -310,6 +331,16 @@ All profiles (should) correspond to the official [EEP](http://www.enocean-allian +##### RORG 0xA5 - FUNC 0x14 - TYPE 0x01 - Single Input Contact (Window/Door), Supply voltage monitor + +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|SVC |Supply voltage / super cap. (linear); 251 - 255 reserved for error code|value |0.0-250.0 ↔ 0.0-5.0 V | +|CT |Contact |enum |1 - open | +| | | |0 - closed | + + + ##### RORG 0xA5 - FUNC 0x20 - TYPE 0x01 - Battery Powered Actuator (BI-DIR) ###### direction: 1 @@ -373,18 +404,50 @@ All profiles (should) correspond to the official [EEP](http://www.enocean-allian -##### RORG 0xA5 - FUNC 0x12 - TYPE 0x01 - Electricity +##### RORG 0xA5 - FUNC 0x30 - TYPE 0x03 - Digital Inputs, Wake and Temperature |shortcut|description |type |values | |--------|--------------------------------------------------|--------|---- | -|MR |current value in W or cumulative value in kWh |value |0.0-16777215.0 ↔ 0.0-16777215.0 | -|TI |Tariff info |value |0.0-15.0 ↔ 0.0-15.0 | -|DT |Current value or cumulative value |enum |0 - kWh | -| | | |1 - W | -|DIV |Divisor for value |enum |0 - x/1 | -| | | |1 - x/10 | -| | | |2 - x/100 | -| | | |3 - x/1000 | +|TMP |Temperature (linear) |value |255.0-0.0 ↔ 0.0-40.0 °C | +|WA0 |Value of wake signal |enum |0 - Low | +| | | |1 - High | +|DI3 |Digital Input 3 |enum |0 - Low | +| | | |1 - High | +|DI2 |Digital Input 2 |enum |0 - Low | +| | | |1 - High | +|DI1 |Digital Input 1 |enum |0 - Low | +| | | |1 - High | +|DI0 |Digital Input 0 |enum |0 - Low | +| | | |1 - High | + + + +##### RORG 0xA5 - FUNC 0x38 - TYPE 0x08 - Gateway + +###### command: 1 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|COM |Command ID |enum |0-13 - Command ID {value} | +|TIM |Time in 1/10 seconds. 0 = no time specifed |value |1.0-65535.0 ↔ 0.1-6553.5 s | +|LCK |Lock for duration time if time >0, unlimited time of no time specified. Locking may be cleared with "unlock". During lock phase no other commands will be accepted or executed|enum |0 - Unlock | +| | | |1 - Lock | +|DEL |Delay or duration (if Time > 0); 0 = Duration (Execute switching command immediately and switch back after duration) 1 = Delay (Execute switching command after delay)|enum |0 - Duration | +| | | |1 - Delay | +|SW |Switching command ON/OFF |enum |0 - Off | +| | | |1 - On | + +###### command: 2 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|COM |Command ID |enum |0-13 - Command ID {value} | +|EDIM |Dimming value (absolute [0...255] or relative [0...100])|value |0.0-255.0 ↔ 0.0-255.0 % | +|RMP |Ramping time in seconds, 0 = no ramping, 1...255 = seconds to 100%|value |0.0-255.0 ↔ 0.0-255.0 s | +|EDIMR |Dimming Range |enum |0 - Absolute value | +| | | |1 - Relative value | +|STR |Store final value |enum |0 - No | +| | | |1 - Yes | +|SW |Switching command |enum |0 - Off | +| | | |1 - On | @@ -434,3 +497,63 @@ All profiles (should) correspond to the official [EEP](http://www.enocean-allian +##### RORG 0xD2 - FUNC 0x05 - TYPE 0x00 - Type 0x00 + +###### command: 1 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|POS |Vertical position |enum |0-100 - Output position {value}% | +| | | |127 - Do not change | +|ANG |Rotation angle |enum |0-100 - Output angle {value}% | +| | | |127 - Do not change | +|REPO |Repositioning |enum |0 - Go directly to POS/ANG | +| | | |1 - Go up (0%), then to POS/ANG | +| | | |2 - Go down (100%), then to POS/ANG | +| | | |3 - Reserved | +|LOCK |Locking modes |enum |0 - Do not change | +| | | |1 - Set blockage mode | +| | | |2 - Set alarm mode | +| | | |3 - Reserved | +| | | |4 - Reserved | +| | | |5 - Reserved | +| | | |6 - Reserved | +| | | |7 - Deblockage | +|CHN |Channel |enum |0 - Channel 1 | +|CMD |Command Id |enum |0-5 - Command ID {value} | + +###### command: 2 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|CHN |Channel |enum |0 - Channel 1 | +|CMD |Command Id |enum |0-5 - Command ID {value} | + +###### command: 3 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|CHN |Channel |enum |0 - Channel 1 | +|CMD |Command Id |enum |0-5 - Command ID {value} | + +###### command: 4 +|shortcut|description |type |values | +|--------|--------------------------------------------------|--------|---- | +|POS |Vertical position |enum |0-100 - Output position {value}% | +| | | |127 - Do not change | +|ANG |Rotation angle |enum |0-100 - Output angle {value}% | +| | | |127 - Do not change | +|REPO |Repositioning |enum |0 - Go directly to POS/ANG | +| | | |1 - Go up (0%), then to POS/ANG | +| | | |2 - Go down (100%), then to POS/ANG | +| | | |3 - Reserved | +|LOCK |Locking modes |enum |0 - Do not change | +| | | |1 - Set blockage mode | +| | | |2 - Set alarm mode | +| | | |3 - Reserved | +| | | |4 - Reserved | +| | | |5 - Reserved | +| | | |6 - Reserved | +| | | |7 - Deblockage | +|CHN |Channel |enum |0 - Channel 1 | +|CMD |Command Id |enum |0-5 - Command ID {value} | + + + diff --git a/enocean/protocol/EEP.xml b/enocean/protocol/EEP.xml index 067bbeb..2886ff2 100644 --- a/enocean/protocol/EEP.xml +++ b/enocean/protocol/EEP.xml @@ -1035,5 +1035,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/examples/enocean_example.py b/examples/enocean_example.py index b3b220e..e1e6d21 100755 --- a/examples/enocean_example.py +++ b/examples/enocean_example.py @@ -36,7 +36,11 @@ def assemble_radio_packet(transmitter_id): 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: + packet.select_eep(0x05, 0x00) + packet.parse_eep() + for k in packet.parsed: + print('%s: %s' % (k, packet.parsed[k])) if packet.packet_type == PACKET.RADIO and packet.rorg == RORG.BS4: # parse packet with given FUNC and TYPE for k in packet.parse_eep(0x02, 0x05): diff --git a/examples/example_D2-05-00.py b/examples/example_D2-05-00.py new file mode 100644 index 0000000..bb03566 --- /dev/null +++ b/examples/example_D2-05-00.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python +# -*- encoding: utf-8 -*- +''' +Example to show automatic UTE Teach-in responses using +http://www.g-media.fr/prise-gigogne-enocean.html + +Waits for UTE Teach-ins, sends the response automatically and prints the ID of new device. +''' + +import sys +import time +import traceback +import enocean.utils +from enocean.communicators import SerialCommunicator +from enocean.protocol.packet import RadioPacket, UTETeachIn +from enocean.protocol.constants import RORG + +try: + import queue +except ImportError: + import Queue as queue + + +def set_position(destination, percentage): + global communicator + communicator.send( + RadioPacket.create(rorg=RORG.VLD, rorg_func=0x05, rorg_type=0x00, destination=destination, sender=communicator.base_id, command=1, POS=percentage) + ) + + + +communicator = SerialCommunicator() +communicator.start() +print('The Base ID of your module is %s.' % enocean.utils.to_hex_string(communicator.base_id)) + + +# set_position([0x05, 0x0F, 0x0B, 0xEA], 100) +# time.sleep(10) +set_position([0x05, 0x0F, 0x0B, 0xEA], 50) + + +print('Press and hold the teach-in button on the plug now, till it starts turning itself off and on (about 10 seconds or so...)') +devices_learned = [] + +# endless loop receiving radio packets +while communicator.is_alive(): + try: + # Loop to empty the queue... + packet = communicator.receive.get(block=True, timeout=1) + if isinstance(packet, UTETeachIn): + print('New device learned! The ID is %s.' % (packet.sender_hex)) + devices_learned.append(packet.sender) + except queue.Empty: + continue + except KeyboardInterrupt: + break + except Exception: + traceback.print_exc(file=sys.stdout) + break + +print('Devices learned during this session: %s' % (', '.join([enocean.utils.to_hex_string(x) for x in devices_learned]))) + +if communicator.is_alive(): + communicator.stop() diff --git a/setup.py b/setup.py index 55cc1b7..3db801f 100644 --- a/setup.py +++ b/setup.py @@ -5,12 +5,12 @@ from distutils.core import setup setup( - name='enocean', - version='0.41.0', - description='EnOcean serial protocol implementation', - author='Kimmo Huoman', - author_email='kipenroskaposti@gmail.com', - url='https://github.com/kipe/enocean', + name='enocean-lib', + version='1.0.0', + description='EnOcean serial protocol implementation (forked from enocean python package)', + author='Vincent Saluzzo', + author_email='vincentsaluzzo@gmail.com', + url='https://github.com/vincentsaluzzo/enocean-lib', packages=[ 'enocean', 'enocean.protocol',