本帖最后由 tangqmxf 于 2019-12-19 11:45 编辑
按照AIOT开发平台上面的说明文档:[url=按照AIOT开发平台上面的说明文档:http://docs.opencloud.aqara.com/development/gateway-LAN-communication/
读设备
使用“read”命令以单播方式发送给网关的UDP 9898端口。用户可以用主动读取各设备的属性状态,网关返回该设备的全部属性信息。
例如:
读取墙壁开关的状态:
{
"cmd":"read",
"sid":"xxxxxxxx" //墙壁开关did
}
网关以单播方式回复,格式如下:{
"cmd":"read_rsp",
"model":"ctrl_neutral2",
"sid":"xxxxxxxx",
"params":[{"channel_0":"on"},{"channel_1":"off"}]
}
———————————————————————————————————————————————
但是问题来了,为何我回复的内容中只有battery_voltage,其他的设备属性值都没有啊!有人遇到过么?
2019-12-19 03:13:04 INFO (SyncWorker_14) [custom_components.refresh_water_leak_sensor.sensor] Update the state...
2019-12-19 03:13:15 DEBUG (SyncWorker_15) [custom_components.refresh_water_leak_sensor.sensor] _send_cmd >> b'{ "cmd":"read","sid":"158d0004117248"}'
2019-12-19 03:13:15 DEBUG (SyncWorker_15) [custom_components.refresh_water_leak_sensor.sensor] _send_cmd resp << {'cmd': 'read_rsp', 'model': 'ctrl_86plug.aq1', 'sid': '158d0004117248', 'params': [{'battery_voltage': 3600}]}
2019-12-19 03:13:15 DEBUG (SyncWorker_15) [custom_components.refresh_water_leak_sensor.sensor] read_ack << {'cmd': 'read_rsp', 'model': 'ctrl_86plug.aq1', 'sid': '158d0004117248', 'params': [{'battery_voltage': 3600}]}
2019-12-19 03:13:15 INFO (SyncWorker_15) [custom_components.refresh_water_leak_sensor.sensor] A______________01: {'cmd': 'read_rsp', 'model': 'ctrl_86plug.aq1', 'sid': '158d0004117248', 'params': [{'battery_voltage': 3600}]}
2019-12-19 03:13:15 INFO (SyncWorker_15) [custom_components.refresh_water_leak_sensor.sensor] Update the state...
2019-12-19 03:13:15 DEBUG (SyncWorker_7) [custom_components.refresh_water_leak_sensor.sensor] _send_cmd >> b'{ "cmd":"read","sid":"158d00040567c2"}'
2019-12-19 03:13:15 DEBUG (SyncWorker_7) [custom_components.refresh_water_leak_sensor.sensor] _send_cmd resp << {'cmd': 'read_rsp', 'model': 'sensor_wleak.aq1', 'sid': '158d00040567c2', 'params': [{'battery_voltage': 3085}]}
2019-12-19 03:13:15 DEBUG (SyncWorker_7) [custom_components.refresh_water_leak_sensor.sensor] read_ack << {'cmd': 'read_rsp', 'model': 'sensor_wleak.aq1', 'sid': '158d00040567c2', 'params': [{'battery_voltage': 3085}]}
2019-12-19 03:13:15 INFO (SyncWorker_7) [custom_components.refresh_water_leak_sensor.sensor] A______________01: {'cmd': 'read_rsp', 'model': 'sensor_wleak.aq1', 'sid': '158d00040567c2', 'params': [{'battery_voltage': 3085}]}
官方说明文档中params应该还会有详细的信息的啊,搞得我获得的数据比心跳上报的数据还少了
纯新手,非科班,求赐教!!!!跪求!!!脱光了跪求!!!脱光了埋雪里跪求!!!
|