用于大金(DKN)Airzone云API的Python3库
AirzoneCloudDaikin的Python项目详细描述
空中云大金
演示文稿
摘要
允许与大金航空区云轻松通信以检索信息或发送命令(开/关、温度、HVAC模式…)
此API特定于Daikin实现(请尝试连接到dkn.airzonecloud.com以确保)。在
如果您正在寻找主Airzone云API(尝试连接到www.airzonecloud.com),您应该使用以下包:AirzoneCloud
模块类
- AirzoneCloudDaikin:代表您的Daikin AirzoneCloud帐户。包含安装的列表:
- Installation:表示您的一个安装(如您的家、办公室等)。包含其设备的列表:
- Device:表示要控制的气候设备
- Installation:表示您的一个安装(如您的家、办公室等)。包含其设备的列表:
使用
安装
pip3 install AirzoneCloudDaikin
启动API
^{pr2}$获取安装
forinstallationinapi.installations:print("Installation(name={}, type={}, scenary={}, id={})".format(installation.name,installation.type,installation.scenary,installation.id))
输出:
Installation(name=My home, type=home, scenary=occupied, id=5d592c14646b6d798ccc2aaa)
从安装中获取设备
forinstallationinapi.installations:fordeviceininstallation.devices:print("Device(name={}, is_on={}, mode={}, current_temp={}, target_temp={}, id={}, mac={})".format(device.name,device.is_on,device.mode,device.current_temperature,device.target_temperature,device.id,device.mac,))
输出:
Device(name=Dknwserver, is_on=False, mode=cool, current_temp=25.0, target_temp=26.0, id=5ab1875a651241708814575681, mac=AA:BB:CC:DD:EE:FF)
获取所有设备快捷方式
fordeviceinapi.all_devices:print("Device(name={}, is_on={}, mode={}, current_temp={}, target_temp={}, id={}, mac={})".format(device.name,device.is_on,device.mode,device.current_temperature,device.target_temperature,device.id,device.mac,))
输出:
Device(name=Dknwserver, is_on=False, mode=cool, current_temp=25.0, target_temp=26.0, id=5ab1875a651241708814575681, mac=AA:BB:CC:DD:EE:FF)
控制设备
device=api.all_devices[0]print(device)# start devicedevice.turn_on()# set temperaturedevice.set_temperature(26)print(device)# stopping devicedevice.turn_off()print(device)
输出:
Device(name=Dknwserver, is_on=False, mode=cool, current_temp=25.0, target_temp=30.0) Device(name=Dknwserver, is_on=True, mode=cool, current_temp=25.0, target_temp=26.0) Device(name=Dknwserver, is_on=False, mode=cool, current_temp=25.0, target_temp=26.0)
HVAC模式
可用模式
- cool:冷却模式
- heat:加热模式
- ventilate:通风
- 除湿:干燥
- heat cold auto:自动加热/制冷模式
在系统(及其子分区)上设置HVAC模式
device=api.all_devices[0]print(device)# set mode to heatdevice.set_mode("heat")print(device)
输出:
Device(name=Dknwserver, is_on=False, mode=cool, current_temp=25.0, target_temp=26.0) Device(name=Dknwserver, is_on=False, mode=heat, current_temp=25.0, target_temp=23.0)
:warning: Daikin climate equipment has 2 consigns : one for heat & one of cold. Its visible in the previous example, the target temperature has change from 26 to 23 just by changing the mode from cool to heat. So don't forget to do your set_temperature() AFTER the set_mode() and not before
API文件
构造函数
AirzoneCloudDaikin(username,password,user_agent=None,base_url=None)
- username:您是用于连接Daikin Airzone云网站或应用程序的用户名
- password:您是用于连接Daikin Airzone云网站或应用程序的密码
- user\u agent:允许更改默认用户代理(如果已设置)
- base_url:允许更改Daikin Airzone Cloud API的基本url(如果已设置) 在
- 项目
标签: