90後の插班生 发表于 2018-9-8 11:57:15

sangood 发表于 2018-9-8 11:31
测试了下,macC:4F:22:04:9** 地址错误 V 是什么原因呢?谢谢!67、68行改成device_id也不行。


更新配置文件中的mac地址为device_id并且 dc1断电重连 , 试试呢

sangood 发表于 2018-9-8 12:22:06

本帖最后由 sangood 于 2018-9-8 12:26 编辑

snail12431 发表于 2018-9-8 11:57
更新配置文件中的mac地址为device_id并且 dc1断电重连 , 试试呢
高手啊,可以连上 了,但是好像我手动按钮之后,没有快速反馈,我7个DC1:victory:感谢!我是这样配置的。
mac: {'7-72271608896*******','7-70238156630*****'}

90後の插班生 发表于 2018-9-8 12:44:56

sangood 发表于 2018-9-8 12:22
高手啊,可以连上 了,但是好像我手动按钮之后,没有快速反馈,我7个DC1感谢!我是这样配置的。
...

ha有个update的刷新时间每次手动按钮,虽然数据已经推送到了ha,要到了刷新的时间ha才会变更状态,目前设置的是3s ,你可以把代码里的 _INTERVAL = 3 改小试试看

killadm 发表于 2018-9-8 13:01:53

遇到了个问题
Exception in thread Thread-3:,
Traceback (most recent call last):,
File "/config/custom_components/switch/PhicommDC1.py", line 137, in parseJsonData,
    return json.loads(jsonStr),
File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads,
    return _default_decoder.decode(s),
File "/usr/local/lib/python3.7/json/decoder.py", line 340, in decode,
    raise JSONDecodeError("Extra data", s, end),
json.decoder.JSONDecodeError: Extra data: line 1 column 121 (char 120),

报错时的jsonStr:
{"uuid":"7-7175750826426720","status":200,"result":{"status":1111,"I":475,"V":241,"P":58},"msg":"get datapoint success"}\n{"uuid":"kWh+5f80d7bf","status":200,"result":{"status":1111,"I":475,"V":241,"P":58},"msg":"get datapoint success"}
正则匹配到了两个json

90後の插班生 发表于 2018-9-8 14:33:19

killadm 发表于 2018-9-8 13:01
遇到了个问题
Exception in thread Thread-3:,
Traceback (most recent cal ...

改了下直接根据\n分割 取第一个 看看行不行

ted 发表于 2018-9-8 15:32:02

来看看,向大佬学习

sangood 发表于 2018-9-8 15:32:45

本帖最后由 sangood 于 2018-9-8 15:39 编辑

一段时间后,无法控制了,日志:
2018-09-08 15:22:19 ERROR (MainThread) Timer got out of sync. Resetting
2018-09-08 15:22:57 ERROR (SyncWorker_15) 更新前1
2018-09-08 15:22:57 ERROR (SyncWorker_15) 更新後3
2018-09-08 15:22:57 ERROR (SyncWorker_15) 更新後11
2018-09-08 15:23:02 ERROR (SyncWorker_15) 更新前3
2018-09-08 15:23:02 ERROR (SyncWorker_15) 更新後1
2018-09-08 15:23:02 ERROR (SyncWorker_15) 更新後1
2018-09-08 15:23:05 ERROR (SyncWorker_8) 更新前1
2018-09-08 15:23:05 ERROR (SyncWorker_8) 更新後5
2018-09-08 15:23:05 ERROR (SyncWorker_8) 更新後101
2018-09-08 15:31:31 ERROR (SyncWorker_11) 更新前0
2018-09-08 15:31:31 ERROR (SyncWorker_11) 更新後1
2018-09-08 15:31:31 ERROR (SyncWorker_11) 更新後1
2018-09-08 15:31:34 ERROR (SyncWorker_2) 更新前1
2018-09-08 15:31:34 ERROR (SyncWorker_2) 更新後9
2018-09-08 15:31:34 ERROR (SyncWorker_2) 更新後1001

已更新 2.2版本,试试!

tanghuafu 发表于 2018-9-8 16:21:31

有大神就是好。!!

xiamik1 发表于 2018-9-8 16:39:37

一直没看懂~~~~~求大大

xiaoo 发表于 2018-9-8 20:10:06

这个必须顶!!!
页: 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16
查看完整版本: V0.4.5 多DC1支持 斐讯DC1离线控制