通过BL-NET自动与UVR1611进行无线通信
PyBLNET的Python项目详细描述
pyblnet-一个非常基本的python bl-net桥
通过Technische Alternative连接到自身连接到UVR1611设备的BL-NET的包。 它能够读取数字和模拟值,并将开关设置为开/关/自动。
有关模块及其方法的文档可以通过方法和模块本身找到。
存在BLNET的两个接口,并且两者都被支持:
- 网络接口-blnetweb类
- blnet直接协议[1]-blnet direct类
blnet类是这两个类的包装器。初始化类时,可以激活/停用这两个接口。 blnetdirect提供“模拟”、“数字”、“速度”、“能量”、“功率”,而blneteb仅支持“模拟”和“数字”。 如果两者都处于活动状态,则blnetdirect具有优先级。 只有通过blnetweb接口才能设置开关并读取其手动/自动状态。
使用量
ip='192.168.178.10'# Check if there is a blnet at given addresstest_blnet(ip)# -> True/False# Convenient high level interfaceblnet=BLNET(ip,timeout=5)# Control a switch by its IDblnet.turn_on(10)blnet.turn_auto(10)blnet.turn_off(10)# Fetch data (contains all available data using enabled interfaces)print(blnet.fetch())# The low level modules are also available# note that the direct use of these modules is discouraged though# Fetch the latest data via web interfaceblnet=BLNETWeb(ip,timeout=5)print(blnet.read_analog_values())print(blnet.read_digital_values())# For publishing valuesblnet.set_digital_value('10','AUS')# Fetch data via the Protocol developed by TAblnet=BLNETDirect(ip)# Fetching the latest dataprint(blnet.get_latest())# Still inofficial because unexplicably failing oftenprint(blnet._get_data(1))
[1]https://www.haus-terra.at/heizung/download/Schnittstelle/Schnittstelle_PC_Bootloader.pdf