ALITECHLAB / lifesmart-home-assistant

5 stars 2 forks source link

Error in Home assisant - auth problem? #1

Open patrikron opened 1 year ago

patrikron commented 1 year ago

I managed to get the script to work to receive the usertoken and userid. I have set it up in HA config, but a get an error.

2023-09-07 09:25:54.901 ERROR (MainThread) [homeassistant.setup] Error during setup of component lifesmart
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 288, in _async_setup_component
result = await task
^^^^^^^^^^
File "/config/custom_components/lifesmart/__init__.py", line 522, in async_setup
for dev in devices:
TypeError: 'bool' object is not iterable

I printed the response from asycn_lifesmart_EpGetAll, and its says 2023-09-07 09:25:54.901 INFO (MainThread) [custom_components.lifesmart] {'status': 'failure', 'message': 'sign error', 'code': 10004, 'id': 1}

ALITECHLAB commented 1 year ago

Did you have any smart device connected to you life smart mobile account ?

On Mon, 18 Sep 2023 at 11:33 AM patrikron @.***> wrote:

I managed to get the script to work to receive the usertoken and userid. I have set it up in HA config, but a get an error.

2023-09-07 09:25:54.901 ERROR (MainThread) [homeassistant.setup] Error during setup of component lifesmart Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 288, in _async_setup_component result = await task ^^^^^^^^^^ File "/config/custom_components/lifesmart/init.py", line 522, in async_setup for dev in devices: TypeError: 'bool' object is not iterable

I printed the response from asycn_lifesmart_EpGetAll, and its says 2023-09-07 09:25:54.901 INFO (MainThread) [custom_components.lifesmart] {'status': 'failure', 'message': 'sign error', 'code': 10004, 'id': 1}

— Reply to this email directly, view it on GitHub https://github.com/ALITECHLAB/lifesmart-home-assistant/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/BBJ3DV7KPRKPHPU6SONDJ5LX3ABPDANCNFSM6AAAAAA44LB7IQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

patrikron commented 1 year ago

Yes, 7 devices.

ALITECHLAB commented 1 year ago

Could you try to delete all life smart related changes e.g life smart custom component , temp folder and delete the change you did in configuration.yml and try again,please.

ALITECHLAB commented 1 year ago

https://github.com/ALITECHLAB/lifesmart-home-assistant/blob/main/DOCs/LifeSmart%20云平台服务接口-en.pdf

You enter worng app key or user token

According to the API reference
and error number 1004 illegal signature

image

patrikron commented 1 year ago

I have run lifesmart-tool.py and regenerated usertoken and now a get

2023-09-19 22:17:12.204 INFO (Thread-20) [custom_components.lifesmart] websocket_msg: {"message":"user not authed","code":10005,"id":1} 2023-09-19 22:17:12.211 INFO (Thread-20) [custom_components.lifesmart] websocket_msg: wb closed 2023-09-19 22:17:12.211 ERROR (Thread-20) [websocket] error from callback <function async_setup..on_message at 0x7f9dd4922d40>: Expecting value: line 1 column 1 (char 0) 2023-09-19 22:17:12.239 ERROR (Thread-20) [custom_components.lifesmart] websocket_error: Expecting value: line 1 column 1 (char 0) 2023-09-19 22:17:12.279 INFO (Thread-20) [custom_components.lifesmart] lifesmart websocket closed...: None None 2023-09-19 22:17:12.279 INFO (Thread-20) [custom_components.lifesmart] lifesmart: restart wss...

Appkey, apptoken and userid is correct. I use the usertoken from data.yaml file after running the script. I have tried running lifesmart-tool like 10 times and use that usertoken but always get {"message":"user not authed","code":10005,"id":1}..

ALITECHLAB commented 1 year ago

we can meet in discord for further troubleshooting to make it easy if you like .

ALITECHLAB commented 1 year ago

https://discord.gg/bpe92gTZ[](https://discord.gg/bpe92gTZ)

patrikron commented 1 year ago

Okej thank you, I will do that

patrikron commented 1 year ago

@ALITECHLAB Hi, sry been busy. your discord invite has expired. can you send a new one