Python EnOcean¶
A Python library for reading and controlling EnOcean radio devices (switches, sensors, actuators…) through an EnOcean USB/serial module (e.g. USB 300) or a TCP bridge.
- ESP3: parses the EnOcean Serial Protocol 3 byte stream, resynchronizing after radio noise or corrupted bytes, and builds packets to send.
- 270 profiles: decodes and encodes telegrams according to the EnOcean Equipment Profiles (EEP) of the official EnOcean Alliance specification.
- Integration: a device registry decoding received telegrams automatically, JSON-serializable packets, commands for lights and blinds, teach-in.
- Operation: statistics, health checks, Prometheus metrics, structured logs.
It requires Python 3.10 or later, and has one dependency: pyserial.
pip install git+https://github.com/j5lien/enocean.git@2.1.0
from enocean import Packet
# A temperature sensor telegram (A5-02-05) as read from the serial port
frame = bytes.fromhex('55 00 0a 07 01 eb a5 00 00 55 08 01 81 b7 44 00 01 ff ff ff ff 2d 00 75')
status, remaining, packet = Packet.parse_msg(frame)
print(status.name, packet.sender_hex, packet.dbm) # OK 01:81:B7:44 -45
packet.parse_eep(0x02, 0x05) # A5-02-05: temperature sensor, 0 °C to +40 °C
temperature = packet.parsed['TMP']
print(temperature['value'], temperature['unit']) # 26.66... °C
assert round(temperature['value'], 2) == 26.67
Next: Getting started, then the concepts behind EnOcean.
This is a maintained fork of kipe/enocean.