enocean
Advanced tools
+27
| # Python EnOcean # | ||
| [](https://travis-ci.org/kipe/enocean) | ||
| [](https://coveralls.io/github/kipe/enocean?branch=master) | ||
| A Python library for reading and controlling [EnOcean](http://www.enocean.com/) devices. | ||
| Started as a part of [Forget Me Not](http://www.element14.com/community/community/design-challenges/forget-me-not) | ||
| design challenge @ [element14](http://www.element14.com/). | ||
| ## Install ## | ||
| If not installed already, install [pip](https://pypi.python.org/pypi/pip) by running | ||
| `sudo apt-get install python-pip` | ||
| After pip is installed, install the module by running | ||
| `sudo pip install enocean` (or `sudo pip install git+https://github.com/kipe/enocean.git` if you want the "bleeding edge"). | ||
| After this, it's just a matter of running `enocean_example.py` and pressing the | ||
| learn button on magnetic contact or temperature switch or pressing the rocker switch. | ||
| You should be displayed with a log of the presses, as well as parsed values | ||
| (assuming the sensors are the ones provided in the [EnOcean Starter Kit](https://www.enocean.com/en/enocean_modules/esk-300)). | ||
| The example script can be stopped by pressing `CTRL+C` |
| Metadata-Version: 1.0 | ||
| Name: enocean | ||
| Version: 0.41.0 | ||
| Version: 0.50.0 | ||
| Summary: EnOcean serial protocol implementation | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/kipe/enocean |
@@ -1,3 +0,3 @@ | ||
| beautifulsoup4>=4.3.2 | ||
| enum-compat>=0.0.2 | ||
| pyserial>=3.0 | ||
| beautifulsoup4>=4.3.2 |
@@ -0,1 +1,2 @@ | ||
| README.md | ||
| setup.py | ||
@@ -2,0 +3,0 @@ enocean/__init__.py |
| # -*- encoding: utf-8 -*- | ||
| from __future__ import print_function, unicode_literals, division, absolute_import | ||
| import logging | ||
| import logging.handlers | ||
| def init_logging(level=logging.DEBUG, log_to_file=False, logsize=1024, logcount=5): | ||
@@ -7,0 +7,0 @@ formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') |
@@ -5,2 +5,3 @@ # -*- encoding: utf-8 -*- | ||
| import logging | ||
| from sys import version_info | ||
| from collections import OrderedDict | ||
@@ -21,4 +22,8 @@ from bs4 import BeautifulSoup | ||
| try: | ||
| with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r') as xml_file: | ||
| self.soup = BeautifulSoup(xml_file.read(), "html.parser") | ||
| if version_info[0] > 2: | ||
| with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r', encoding='UTF-8') as xml_file: | ||
| self.soup = BeautifulSoup(xml_file.read(), "html.parser") | ||
| else: | ||
| with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'EEP.xml'), 'r') as xml_file: | ||
| self.soup = BeautifulSoup(xml_file.read(), "html.parser") | ||
| self.init_ok = True | ||
@@ -25,0 +30,0 @@ self.__load_xml() |
+119
-0
@@ -454,2 +454,30 @@ <?xml version="1.0" encoding="utf-8"?> | ||
| </profile> | ||
| <profile type="0x03" description="Range -20°C to +60°C 10bit-measurement and 0% to 100%"> | ||
| <data> | ||
| <value description="Rel. Humidity (linear)" shortcut="HUM" offset="0" size="8" unit="%"> | ||
| <range> | ||
| <min>0</min> | ||
| <max>255</max> | ||
| </range> | ||
| <scale> | ||
| <min>0</min> | ||
| <max>100</max> | ||
| </scale> | ||
| </value> | ||
| <value description="Temperature (linear)" shortcut="TMP" offset="14" size="10" unit="°C"> | ||
| <range> | ||
| <min>0</min> | ||
| <max>1023</max> | ||
| </range> | ||
| <scale> | ||
| <min>-20</min> | ||
| <max>+60</max> | ||
| </scale> | ||
| </value> | ||
| <enum description="Telegram Type" shortcut="TTP" offset="31" size="1"> | ||
| <item description="Heartbeat" value="0" /> | ||
| <item description="Event triggered" value="1" /> | ||
| </enum> | ||
| </data> | ||
| </profile> | ||
| </profiles> | ||
@@ -1039,3 +1067,94 @@ <profiles func="0x06" description="Light Sensor"> | ||
| </profiles> | ||
| <profiles func="0x05" description="Blinds Control for Position and Angle"> | ||
| <profile type="0x00" description="Type 0x00"> | ||
| <command description="command indentifier" shortcut="CMD" offset="28" size="4"> | ||
| <item description="Go to Position and Angle" value="1" /> | ||
| <item description="Stop" value="2" /> | ||
| <item description="Query Position and Angle" value="3" /> | ||
| <item description="Reply Position and Angle" value="4" /> | ||
| <item description="Set parameters" value="5" /> | ||
| </command> | ||
| <data command="1" bits="4"> | ||
| <enum description="Vertical position" shortcut="POS" offset="1" size="7"> | ||
| <rangeitem description="Output position {value}%" start="0" end="100" /> | ||
| <item description="Do not change" value="127" /> | ||
| </enum> | ||
| <enum description="Rotation angle" shortcut="ANG" offset="9" size="7"> | ||
| <rangeitem description="Output angle {value}%" start="0" end="100" /> | ||
| <item description="Do not change" value="127" /> | ||
| </enum> | ||
| <enum description="Repositioning" shortcut="REPO" offset="17" size="3"> | ||
| <item description="Go directly to POS/ANG" value="0" /> | ||
| <item description="Go up (0%), then to POS/ANG" value="1" /> | ||
| <item description="Go down (100%), then to POS/ANG" value="2" /> | ||
| <item description="Reserved" value="3" /> | ||
| </enum> | ||
| <enum description="Locking modes" shortcut="LOCK" offset="21" size="3"> | ||
| <item description="Do not change" value="0" /> | ||
| <item description="Set blockage mode" value="1" /> | ||
| <item description="Set alarm mode" value="2" /> | ||
| <item description="Reserved" value="3" /> | ||
| <item description="Reserved" value="4" /> | ||
| <item description="Reserved" value="5" /> | ||
| <item description="Reserved" value="6" /> | ||
| <item description="Deblockage" value="7" /> | ||
| </enum> | ||
| <enum description="Channel" shortcut="CHN" offset="24" size="4"> | ||
| <item description="Channel 1" value="0" /> | ||
| </enum> | ||
| <enum description="Command Id" shortcut="CMD" offset="28" size="4"> | ||
| <rangeitem description="Command ID {value}" start="0" end="5" /> | ||
| </enum> | ||
| </data> | ||
| <data command="2" bits="1"> | ||
| <enum description="Channel" shortcut="CHN" offset="0" size="4"> | ||
| <item description="Channel 1" value="0" /> | ||
| </enum> | ||
| <enum description="Command Id" shortcut="CMD" offset="4" size="4"> | ||
| <rangeitem description="Command ID {value}" start="0" end="5" /> | ||
| </enum> | ||
| </data> | ||
| <data command="3" bits="1"> | ||
| <enum description="Channel" shortcut="CHN" offset="0" size="4"> | ||
| <item description="Channel 1" value="0" /> | ||
| </enum> | ||
| <enum description="Command Id" shortcut="CMD" offset="4" size="4"> | ||
| <rangeitem description="Command ID {value}" start="0" end="5" /> | ||
| </enum> | ||
| </data> | ||
| <data command="4" bits="4"> | ||
| <enum description="Vertical position" shortcut="POS" offset="1" size="7"> | ||
| <rangeitem description="Output position {value}%" start="0" end="100" /> | ||
| <item description="Do not change" value="127" /> | ||
| </enum> | ||
| <enum description="Rotation angle" shortcut="ANG" offset="9" size="7"> | ||
| <rangeitem description="Output angle {value}%" start="0" end="100" /> | ||
| <item description="Do not change" value="127" /> | ||
| </enum> | ||
| <enum description="Repositioning" shortcut="REPO" offset="17" size="3"> | ||
| <item description="Go directly to POS/ANG" value="0" /> | ||
| <item description="Go up (0%), then to POS/ANG" value="1" /> | ||
| <item description="Go down (100%), then to POS/ANG" value="2" /> | ||
| <item description="Reserved" value="3" /> | ||
| </enum> | ||
| <enum description="Locking modes" shortcut="LOCK" offset="21" size="3"> | ||
| <item description="Do not change" value="0" /> | ||
| <item description="Set blockage mode" value="1" /> | ||
| <item description="Set alarm mode" value="2" /> | ||
| <item description="Reserved" value="3" /> | ||
| <item description="Reserved" value="4" /> | ||
| <item description="Reserved" value="5" /> | ||
| <item description="Reserved" value="6" /> | ||
| <item description="Deblockage" value="7" /> | ||
| </enum> | ||
| <enum description="Channel" shortcut="CHN" offset="24" size="4"> | ||
| <item description="Channel 1" value="0" /> | ||
| </enum> | ||
| <enum description="Command Id" shortcut="CMD" offset="28" size="4"> | ||
| <rangeitem description="Command ID {value}" start="0" end="5" /> | ||
| </enum> | ||
| </data> | ||
| </profile> | ||
| </profiles> | ||
| </telegram> | ||
| </telegrams> |
@@ -207,3 +207,3 @@ # -*- encoding: utf-8 -*- | ||
| packet = Packet(packet_type) | ||
| packet = Packet(packet_type, data=[], optional=[]) | ||
| packet.rorg = rorg | ||
@@ -210,0 +210,0 @@ packet.data = [packet.rorg] |
@@ -39,3 +39,7 @@ #!/usr/bin/env python | ||
| 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: | ||
@@ -42,0 +46,0 @@ # parse packet with given FUNC and TYPE |
+1
-1
| Metadata-Version: 1.0 | ||
| Name: enocean | ||
| Version: 0.41.0 | ||
| Version: 0.50.0 | ||
| Summary: EnOcean serial protocol implementation | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/kipe/enocean |
+1
-1
@@ -9,3 +9,3 @@ #!/usr/bin/env python | ||
| name='enocean', | ||
| version='0.41.0', | ||
| version='0.50.0', | ||
| description='EnOcean serial protocol implementation', | ||
@@ -12,0 +12,0 @@ author='Kimmo Huoman', |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
95536
8.89%25
4.17%1066
1.04%