domintell协议的python库

python-domintell的Python项目详细描述


python domintell:控制domintell家庭自动化系统的python库

创建此库是为了支持home assisstant中的domintell协议。它基于Thomas Delaetpython-velbus库。

它目前正由home assisstant中的domintell组件使用,但也可以独立使用。

库的最新版本是0.0.10,它作为python包发布在pypi

API文档尚不可用。

示例用法

该库目前只支持通过deth02 domintell模块的udp通信,可以很容易地修改为支持rs-232 intiarface(domintell light protocol)。为了使用这个库,您需要首先初始化控制器,然后在domintell上发送和接收消息。

importtimeimportloggingimportsysimportdomintellimportcredentialsimportos,sysdef_on_message(message):print('received message')print(message)logging.basicConfig(stream=sys.stdout,level=logging.INFO)# UDP, Serial (or USB over serial) connection to Domintell controllerhost='192.168.0.1:17481'controller=domintell.Controller(host)controller.subscribe(_on_message)logging.info('LOGIN')controller.login(credentials.host['SECRET'])time.sleep(10)logging.info('Starting scan')controller.scan(None)logging.info('Going to sleep')time.sleep(100)logging.info('Exiting ...')controller.stop()

安装

您可以使用pip(pip install python domintell)安装库,或者签出github存储库并在存储库的根目录下运行python setup.py install

支持的模块

此库当前支持以下DominTell模块:

Module nameDescriptionStatusCommentsUsing everyday?
DISM4Control of 4 inputs (buttons)SUPPORTEDAll messages are supportedYes
DISM8Control of 8 inputs (buttons)SUPPORTEDAll messages are supportedYes
DPBU011 button moduleSUPPORTEDAll messages are supportedNo
DPBU022 button moduleSUPPORTEDAll messages are supportedNo
DPBU044 button moduleSUPPORTEDAll messages are supportedRarely
DPBU066 button moduleSUPPORTEDAll messages are supportedNo
DBIR018 relay output moduleSUPPORTEDAll messages are supportedYes
DTRP01Output card for the control of up to 4 trip switchesSUPPORTEDAll messages are supportedYes
DTRP02Output card for the control of 2 x 2 inverted trip switchesSUPPORTEDAll messages are supportedNo
DDIM01Control module for up to 8 dimmersSUPPORTEDAll messages are supportedYes
DTEM01Temperature sensor module. Allows the connection of the temperature sensorSUPPORTEDOnly basic messagesYes
DTEM02Temperature sensor module. Allows the connection of the temperature sensorSUPPORTEDOnly basic messagesYes
DDIR01Infrared SensorNOT SUPPORTEDNo plans to supportNo
DTSC0xTFT back-lit color touchscreenSUPPORTEDOnly temperature messages are supportedYes
DMOV01Movement sensorSUPPORTEDAll messages are supportedYes
DLCD01LCDNOT SUPPORTEDNo
DTRV014 outputs control module. For the control of shutters, valves, motors, etcSUPPORTEDAll messages are supportedNo
DLED014 outputs led control moduleSUPPORTEDAll messages are supportedYes
DTRVBT01Single output card controlling motors, valves, shutters or Velux with low tension between 12 to 24VdcSUPPORTEDAll messages are supportedNo
DAMPLI014 zones stereo audio amplifi erNOT SUPPORTEDNo plans to implementNo
VARVariableSUPPORTEDAll messages are supportedNo
SYSSystem variableSUPPORTEDAll messages are supportedNo
DOUT10V010 - 10Vdc output moduleSUPPORTEDAll messages are supportedNo
DLCD01LCD panelNOT SUPPORTEDNo
DFAN01Fan coil controllerNOT SUPPORTEDNo
DMR01Output card with 5 x 250 V/3 A monopolar relays.SUPPORTEDAll messages are supportedYes
DIN10V010 - 10Vdc input moduleNOT SUPPORTEDNo

添加对其他模块的支持

Domintell website包含不同可用模块及其协议文档的概述。为了增加对附加模块的支持,请阅读协议文档并添加对丢失消息的支持(许多消息在模块之间共享,以确保检查是否已经存在消息)

添加对附加模块支持的步骤:

  • []在Domintell website中查找要包含的模块的协议文档。
  • []浏览消息目录,在协议信息表中查找尚不受支持的消息。在messages文件夹中为每个不支持的消息创建一个新文件。每个新消息都应该继承自message对象并重用公共功能。
  • []为每个新消息实现构造函数方法
  • []为每个新消息实现populatedata~u binary方法
  • []在messages文件夹中的init.py文件中添加新消息
  • []测试和迭代
  • []更新readme.md文件的受支持模块部分
  • []在github上提交拉取请求

进一步开发

库目前仅提供最低级别的功能:向模块发送和接收消息:

  • []将模块及其支持的功能建模为实体
  • []仅允许向模块发送支持的消息
  • [*]模块的自动发现
  • []将Velbus控制器公开为外部API,以便在不同的使用者之间共享它

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java我想访问同一类的不同函数中的函数变量   创建字段/值哈希映射的java反射   java Velocity工具向后兼容性?   cmd JAVA运行时错误:发生JNI错误   java spring引导示例hateoas不工作   java为什么Android Studio和gradle可以使用不同的类路径进行单元测试?   java Selenium Firefox驱动程序初始化   java如何在jar中重新定位gradle依赖项的包   java为什么我的单线程hello world应用程序使用22个OS线程?   正则表达式替换Java字符串中的特殊字符   在任何派生类的构造函数之后运行方法的java   java从输入字符串中找出日期   带有libGdx(Java)音乐的安卓studio可以在Android模拟器上工作,但不能在桌面上工作   java我在getconnection的参数方面有错误吗?   java使用JFileChooser访问选定文件   java如何将Json解析为另一个活动   java使用Resources for html和rest server   java更新列表,列表内容来自循环中的方法   java如何在GLSL中读取完整范围的32位整数纹理