90後の插班生
发表于 2018-9-7 18:32:56
sangood 发表于 2018-9-7 18:04
使用了,https://bbs.hassbian.com/thread-4773-1-1.html 这个版本,刚部署完,感觉重启后无法马上出状态。 ...
这个版本是yinjiong大大写的,你可以请教下yinjiong
dreamland
发表于 2018-9-7 18:50:14
支持一下
wan06
发表于 2018-9-7 20:05:25
服务器挂了,这个看看
新生活
发表于 2018-9-7 20:22:03
谢谢分享:)
dstars
发表于 2018-9-7 22:16:37
谢谢啊,正需要呢
killadm
发表于 2018-9-7 22:33:01
本帖最后由 killadm 于 2018-9-7 22:52 编辑
多dc1的代码效率很高,也很优雅,但是好像有点问题,插座和服务器通讯正常,但是ha提示mac地址错误。
日志是这样的
2018-09-07 20:29:28 DEBUG (Thread-3) 等待活动连接......
2018-09-07 20:29:28 DEBUG (Thread-3) 有1个新事件,开始处理......
2018-09-07 20:29:28 DEBUG (Thread-3) 发送数据:b'{"uuid":"identifyf080","params":{},"auth":"","action":"datapoint"}\n'
2018-09-07 20:29:28 DEBUG (Thread-3) 等待活动连接......
2018-09-07 20:29:28 DEBUG (Thread-3) 有1个新事件,开始处理......
2018-09-07 20:29:28 DEBUG (Thread-3) 192.168.123.30 queue empty
2018-09-07 20:29:28 DEBUG (Thread-3) 等待活动连接......
2018-09-07 20:29:28 DEBUG (Thread-3) 有1个新事件,开始处理......
2018-09-07 20:29:28 DEBUG (Thread-3) 收到数据:b'{"uuid":"identifyf080","status":200,"result":{"status":1111,"I":430,"V":238,"P":51},"msg":"get datapoint success"}\n', client:192.168.123.30
2018-09-07 20:29:28 DEBUG (Thread-3) 无更新
2018-09-07 20:29:28 DEBUG (Thread-3) {'identifyf080': {'status': 15, 'I': 430, 'P': 51, 'V': 238}}
正常配网的dc不会发送mac,而且连接成功后发送的第一个数据包里的"uuid":"identify****"不是固定的,导致无法通过mac和identify****识别设备。
下边是插座连接到服务器后发送的第一个数据包,里边只有device_id是固定的。
{"action":"identify","uuid":"identify9297","auth":"7a3cfa88","params":{"device_id":"7-717575082642****"}}.
还有插座有时会发送下边这样的数据包。
{"action":"kWh+","uuid":"kWh+b130b0f6","auth":"7a3cfa88","params":{"detalKWh":238}}.
好像也识别成了新插座。
更新:
把67、68行的mac改成device_id之后测试ha可以正常获取到数据,控制无延迟,效果非常好。
1105162862
发表于 2018-9-8 00:07:06
淡定淡定
yangzhong365
发表于 2018-9-8 09:46:12
dfdsfds fs
sangood
发表于 2018-9-8 11:05:17
killadm 发表于 2018-9-7 22:33
多dc1的代码效率很高,也很优雅,但是好像有点问题,插座和服务器通讯正常,但是ha提示mac地址错误。
日志 ...
感谢分享,正在测试
sangood
发表于 2018-9-8 11:31:35
本帖最后由 sangood 于 2018-9-8 11:32 编辑
killadm 发表于 2018-9-7 22:33
多dc1的代码效率很高,也很优雅,但是好像有点问题,插座和服务器通讯正常,但是ha提示mac地址错误。
日志 ...
测试了下,mac:DC:4F:22:04:9** 地址错误 V 是什么原因呢?谢谢!67、68行改成device_id也不行。
无更新
2018-09-08 11:30:27 DEBUG (Thread-4) {'identify3252': {'status': 9, 'I': 160, 'P': 12, 'V': 211}, 'identifyd54e': {'status': 0, 'I': 0, 'P': 0, 'V': 0}, 'identifye331': {'status': 1, 'I': 37, 'P': 1, 'V': 244}, 'identifya231': {'status': 5, 'I': 0, 'P': 0, 'V': 246}, 'identifyfb6e': {'status': 1, 'I': 36, 'P': 1, 'V': 244}, 'identify219a': {'status': 1, 'I': 0, 'P': 0, 'V': 246}, 'identify9e10': {'status': 0, 'I': 0, 'P': 0, 'V': 0}}
2018-09-08 11:30:27 DEBUG (Thread-4) 192.168.1.61 queue empty
2018-09-08 11:30:27 DEBUG (Thread-4) 等待活动连接......
2018-09-08 11:30:27 DEBUG (Thread-4) 有6个新事件,开始处理......
2018-09-08 11:30:27 DEBUG (Thread-4) 收到数据:b'{"uuid":"identifya231","status":200,"result":{"status":101,"I":0,"V":246,"P":0},"msg":"get datapoint success"}\n', client:192.168.1.95
2018-09-08 11:30:27 DEBUG (Thread-4) 无更新
2018-09-08 11:30:27 DEBUG (Thread-4) {'identify3252': {'status': 9, 'I': 160, 'P': 12, 'V': 211}, 'identifyd54e': {'status': 0, 'I': 0, 'P': 0, 'V': 0}, 'identifye331': {'status': 1, 'I': 37, 'P': 1, 'V': 244}, 'identifya231': {'status': 5, 'I': 0, 'P': 0, 'V': 246}, 'identifyfb6e': {'status': 1, 'I': 36, 'P': 1, 'V': 244}, 'identify219a': {'status': 1, 'I': 0, 'P': 0, 'V': 246}, 'identify9e10': {'status': 0, 'I': 0, 'P': 0, 'V': 0}}
2018-09-08 11:30:27 DEBUG (Thread-4) 192.168.1.63 queue empty
2018-09-08 11:30:27 DEBUG (Thread-4) 192.168.1.62 queue empty
2018-09-08 11:30:27 DEBUG (Thread-4) 发送数据:b'{"uuid":"identifyd54e","params":{},"auth":"","action":"datapoint"}\n'
2018-09-08 11:30:27 DEBUG (Thread-4) 发送数据:b'{"uuid":"identify9e10","params":{},"auth":"","action":"datapoint"}\n'
2018-09-08 11:30:27 DEBUG (Thread-4) 发送数据:b'{"uuid":"identifye331","params":{},"auth":"","action":"datapoint"}\n'
页:
1
2
3
4
5
[6]
7
8
9
10
11
12
13
14
15