|
发表于 2022-11-10 21:39:43
|
显示全部楼层
本帖最后由 pany4321 于 2022-11-10 22:15 编辑
楼主真乃大神也。用Docker部署成功了。能成功登陆国家电网获取用电数据。但是无法上传到homeassistant。
我的sgcc_electricity Docker镜像是部署在Oracle VPS上的,与家里的homeassistant之间的通讯只能通过IPV6网络。
想问一下大神,目前是不是不支持IPV6协议啊。
root@duan:~/sgcc_electricity# docker logs sgcc
2022-11-10 21:13:59 [INFO ] ---- Service start!
2022-11-10 21:14:03 [INFO ] ---- patching driver executable /usr/bin/chromedriver
2022-11-10 21:14:07 [INFO ] ---- Webdriver initialized.
2022-11-10 21:19:03 [INFO ] ---- Login successfully on https://www.95598.cn/osgweb/login
2022-11-10 21:19:11 [INFO ] ---- get all user id: ['210XXXX600']
2022-11-10 21:21:35 [INFO ] ---- Get electricity charge balance for 210XXXX600 successfully, balance is 804.74 CNY.
2022-11-10 21:24:02 [INFO ] ---- Get year power consumption for 210XXXX600 successfully, usage is 3669 kwh, yealrly charge is 1831.03 CNY
2022-11-10 21:24:02 [INFO ] ---- Get daily power consumption for 210XXXX600 successfully, usage is 6.62 kwh.
2022-11-10 21:24:03 [INFO ] ---- Webdriver quit after fetching data successfully.
2022-11-10 21:24:04 [ERROR ] ---- state-refresh task failed, reason is Sensor update failed, please check the network
-------------------------------------------------------
补充说明:估计是不支持IPV6通讯协议,我用socat作了一个IPV4到IPV6的网络转发,URL重新改成IPV4地址,这下全通了。
给楼主发一朵小红花
|
|