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在未知属性上的PUT和POST失败会引发不同的行为   java无法使GWTRPC正常工作   java如何在安卓中更改一个特定视图的主题?   机器学习为什么改变了java中等式的两面?   java继承和重定向标准输出   java为什么Clojure中嵌套循环/重复速度慢?   使用JavaParser解析Java代码并查找父节点的语句类型   java读取类的方法并在arraylist中存储Web服务的路径名   java模板聚合匹配和投影一个没有id的字段   java为什么给定数组不返回false   java如何链接JLabel和JSpinner以调整大小   在java中,当过滤器只返回一个对象时,如何使用流和过滤器将值填充到对象中   java为什么使用getInstance   如何得到我的。运行java命令的bat文件