CubicPill / china_southern_power_grid_stat

Home Assistant intergration to get statictics from China Southern Power Grid (CSG) 南方电网HA集成
GNU General Public License v3.0
159 stars 23 forks source link

[BUG]登录时出现“未知错误”,看日志应该是登录时的图形验证码问题 #28

Open zc-jone opened 3 months ago

zc-jone commented 3 months ago

日志记录器: custom_components.china_southern_power_grid_stat.config_flow 来源: custom_components/china_southern_power_grid_stat/config_flow.py:116 集成: china_southern_power_grid_stat (文档, 问题) 首次出现: 21:15:30 (9 次总计出现) 上次记录: 21:22:53

Unexpected exception Traceback (most recent call last): File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 116, in async_step_user session_data = await validate_input(self.hass, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 72, in validate_input client = await hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 58, in authenticate_csg client.authenticate(username, password) File "/config/custom_components/china_southern_power_grid_stat/csg_client/init.py", line 517, in authenticate auth_token = self.api_login_with_password(phone_no, password) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/china_southern_power_grid_stat/csg_client/init.py", line 320, in api_login_with_password self._handle_unsuccessful_response(path, resp_data) File "/config/custom_components/china_southern_power_grid_stat/csg_client/init.py", line 262, in _handle_unsuccessful_response raise CSGAPIError( custom_components.china_southern_power_grid_stat.csg_client.CSGAPIError:

swsgt commented 3 months ago

一样的问题,

lifeexplore commented 3 months ago

我也一样,大佬可以解决吗?

jieny commented 2 months ago

Unexpected exception

Traceback (most recent call last): File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 116, in async_step_user session_data = await validate_input(self.hass, user_input) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 72, in validate_input client = await hass.async_add_executor_job( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 58, in authenticate_csg client.authenticate(username, password) File "/config/custom_components/china_southern_power_grid_stat/csg_client/init.py", line 517, in authenticate auth_token = self.api_login_with_password(phone_no, password) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/china_southern_power_grid_stat/csg_client/init.py", line 320, in api_login_with_password self._handle_unsuccessful_response(path, resp_data) File "/config/custom_components/china_southern_power_grid_stat/csg_client/init.py", line 262, in _handle_unsuccessful_response raise CSGAPIError( custom_components.china_southern_power_grid_stat.csg_client.CSGAPIError: CSGAPIError sta=02 message=无效的验证码!

xueshanlinghu commented 2 months ago

一样的问题,求大佬解决一下。

日志如下:

日志记录器: custom_components.china_southern_power_grid_stat.config_flow
来源: custom_components/china_southern_power_grid_stat/config_flow.py:116
集成: China Southern Power Grid Statistics ([文档](https://github.com/CubicPill/china_southern_power_grid_stat/), [问题](https://github.com/CubicPill/china_southern_power_grid_stat/issues))
首次出现: 2024年8月25日 13:45:40 (8 次总计出现)
上次记录: 21:50:00

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 116, in async_step_user
    session_data = await validate_input(self.hass, user_input)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 72, in validate_input
    client = await hass.async_add_executor_job(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 58, in authenticate_csg
    client.authenticate(username, password)
  File "/config/custom_components/china_southern_power_grid_stat/csg_client/__init__.py", line 517, in authenticate
    auth_token = self.api_login_with_password(phone_no, password)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/china_southern_power_grid_stat/csg_client/__init__.py", line 320, in api_login_with_password
    self._handle_unsuccessful_response(path, resp_data)
  File "/config/custom_components/china_southern_power_grid_stat/csg_client/__init__.py", line 262, in _handle_unsuccessful_response
    raise CSGAPIError(
custom_components.china_southern_power_grid_stat.csg_client.CSGAPIError: <CSGAPIError sta=02 message=无效的验证码!>
lyz05 commented 2 months ago

可能要更新登录的接口了

Traceback (most recent call last):
  File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 116, in async_step_user
    session_data = await validate_input(self.hass, user_input)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 72, in validate_input
    client = await hass.async_add_executor_job(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/china_southern_power_grid_stat/config_flow.py", line 58, in authenticate_csg
    client.authenticate(username, password)
  File "/config/custom_components/china_southern_power_grid_stat/csg_client/__init__.py", line 517, in authenticate
    auth_token = self.api_login_with_password(phone_no, password)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/china_southern_power_grid_stat/csg_client/__init__.py", line 320, in api_login_with_password
    self._handle_unsuccessful_response(path, resp_data)
  File "/config/custom_components/china_southern_power_grid_stat/csg_client/__init__.py", line 262, in _handle_unsuccessful_response
    raise CSGAPIError(
custom_components.china_southern_power_grid_stat.csg_client.CSGAPIError: <CSGAPIError sta=40318 message=密码登录功能进行了安全升级,请升级为最新的版本>
chunjinfeng commented 2 months ago

这个好像没有密码登录了吧,密码登录都要短信验证码了。

xueshanlinghu commented 2 months ago

这个好像没有密码登录了吧,密码登录都要短信验证码了。

今天你说完我登录上去看一下,确实刚刚修改了接口,似乎都需要短信验证码了。(上次尝试的时候还是图形验证码)

image

image

chunjinfeng commented 2 months ago

这个好像每次都要otp登录,看着像有token,1个月有效期。

LGinC commented 2 months ago

Account customer number: , unsuccessful response while calling center/login: {'sta': '40318', 'message': '密码登录功能进行了安全升级,请升级为最新的版本', 'data': None}

FrankyChoi commented 2 months ago

所以现在是没办法使用了吗?有大佬可以更新一下吗?

CubicPill commented 2 months ago

在修了😂

VIRGIL-YAN commented 2 months ago

在修了😂

大神,慢慢来,明天能修好不

CubicPill commented 2 months ago

最新release已经增加了短信验证码和扫码登录,图形验证码目前没有看到,如果出现的话后续会更新

xueshanlinghu commented 1 month ago

最新release已经增加了短信验证码和扫码登录,图形验证码目前没有看到,如果出现的话后续会更新

非常感谢大佬修复,一直忙着今天才实测,使用短信验证码登录成功并已获取实体数据,非常感谢!此单可以close了。 @CubicPill