CoolKit-Technologies / ha-addon

Apache License 2.0
253 stars 117 forks source link

Could not connect to HA-WS, please restart addon #125

Closed OmegaMonster closed 10 months ago

OmegaMonster commented 1 year ago

Hello everyone,

Im using home assistant docker version, tried this ewelink smart home docker and able to access ip:3000. Unfortunately, I couldnt get to sync with home assistant. The entities of my switches are not showing in Home Assistant which running on ip:8123. Moreover, when i check the log for ewelink container im getting the following error:

[WARN] Could not connect to HA-WS, please restart addon [INFO] HA-WS heart beat result: -1 [WARN] Please check HA running state

Can anyone guide me please? Willing to learn. Thank you in advance

VForslund commented 1 year ago

Unfortunately there seems to be some oversights of the maintainers regarding docker. I have made a fix but some crucial parts where removed.

Either you edit the code yourself or you checkout my fix instead of the head which is unfortunately broken. See my changes here: https://github.com/CoolKit-Technologies/ha-addon/commit/0eb855fe8ece9820dd109e805f384f2e89b8d8b6

OmegaMonster commented 1 year ago

Hello @VForslund

I tried the changes recommended. The issue still persist.

2023-07-04T08:52:16.626Z [INFO] relogin success 2023-07-04T08:52:16.844Z [ERROR] getDataSync: disabled.json -> 1000f79be5 no data 2023-07-04T08:52:16.848Z [ERROR] getDataSync: disabled.json -> 10010a701f no data 2023-07-04T08:52:16.851Z [ERROR] getDataSync: disabled.json -> 1001505fd7 no data WS:长连接握手成功 WS:连接成功 2023-07-04T08:52:16.995Z [INFO] Start init lib-ha... 2023-07-04T08:52:17.005Z [ERROR] WebSocket2Ha error: Error: Unexpected server response: 404 2023-07-04T08:52:17.006Z [INFO] WebSocket2Ha will close 2023-07-04T08:53:01.230Z [INFO] SSE closed 2023-07-04T08:53:01.521Z [ERROR] getDataSync: disabled.json -> 1000f79be5 no data 2023-07-04T08:53:01.523Z [ERROR] getDataSync: disabled.json -> 10010a701f no data 2023-07-04T08:53:01.525Z [ERROR] getDataSync: disabled.json -> 1001505fd7 no data 2023-07-04T08:53:01.528Z [ERROR] getDataSync: diy.json -> no data 2023-07-04T08:53:03.212Z [INFO] SSE closed 2023-07-04T08:53:03.494Z [ERROR] getDataSync: disabled.json -> 1000f79be5 no data 2023-07-04T08:53:03.496Z [ERROR] getDataSync: disabled.json -> 10010a701f no data 2023-07-04T08:53:03.497Z [ERROR] getDataSync: disabled.json -> 1001505fd7 no data 2023-07-04T08:53:03.499Z [ERROR] getDataSync: diy.json -> no data 2023-07-04T08:53:03.872Z [INFO] SSE closed 2023-07-04T08:53:04.107Z [ERROR] getDataSync: disabled.json -> 1000f79be5 no data 2023-07-04T08:53:04.108Z [ERROR] getDataSync: disabled.json -> 10010a701f no data 2023-07-04T08:53:04.109Z [ERROR] getDataSync: disabled.json -> 1001505fd7 no data 2023-07-04T08:53:04.111Z [ERROR] getDataSync: diy.json -> no data 2023-07-04T08:53:05.928Z [INFO] start proxy2ws() 2023-07-04T08:53:05.996Z [ERROR] getDataSync: diy.json -> no data 2023-07-04T08:53:06.005Z [ERROR] getDataSync: diy.json -> no data 2023-07-04T08:54:15.144Z [WARN] Could not connect to HA-WS, please restart addon 2023-07-04T08:54:15.147Z [INFO] HA-WS heart beat result: -1 2023-07-04T08:54:15.163Z [WARN] Please check HA running state

OmegaMonster commented 1 year ago

I able to see the changes made in IP:3000 in home assistant. But I unable to automate the switches from home assistant.

VForslund commented 1 year ago

@OmegaMonster I'm assuming you are using the panel has the hub for the devices then? This is something I'm not familiar with since I pair everything to HA and then let the panels control devices in HA.

I remember seeing when buying the panels that there was a REST API in the plans. Maybe this is your best option for controlling devices that are paired trough the panels themselves?

OmegaMonster commented 1 year ago

Thanks for response @VForslund ,

No issues, I able to automate now yea. The issue was from docker-compose. By the way, just would like clarify, the ewelink addon solution require internet to automate the devices? Is there any way for me to automate the ewelink just locally?

VForslund commented 1 year ago

@OmegaMonster

From my understanding many things require internet, there seems to be some hacky solutions out there that requires taking the device apart.

I'm thinking of writing a simple webapp that will do the controlling of my devices. Due to the annoyingly long response times.

If any ewelink devs read this... pls store the device config locally on the device for better response time. It's very annoying clicking my "movie" automation and having the device fetch the config from some server then executing it. I would much rather it executing first then on completion or time polling a new config in case something has been updated in the automation

OmegaMonster commented 1 year ago

Totally agree with @VForslund . Im seriously looking for a local solution, which will allow me to control the devices locally instead of long response time

petebanham commented 10 months ago

Thanks for response @VForslund ,

No issues, I able to automate now yea. The issue was from docker-compose. By the way, just would like clarify, the ewelink addon solution require internet to automate the devices? Is there any way for me to automate the ewelink just locally?

@OmegaMonster how did you fix this please as I have the same issue. I have built my image from @VForslund commit above but I am still getting the errors of not being able to connect to HA. Thanks

petebanham commented 10 months ago

I sorted my issue, it was the URL I was using in the docker-compose file. As I have external SSL access set up I needed to use the external https address that matches my certificate , if I used the internal direct IP access it didn't work.

OmegaMonster commented 10 months ago

Great one @petebanham !