bwp91 / homebridge-ewelink

Homebridge plugin to integrate eWeLink devices into HomeKit.
MIT License
384 stars 127 forks source link

Fuse can't be controlled anymore #398

Closed Ivolution-dev closed 1 year ago

Ivolution-dev commented 1 year ago

What issue do you have? Please be as thorough and explicit as possible.

homebridge-ewelink doesnt work in homebridge in iobroker. Everything worked fine until the last week. After that the electic fuse cant be controlled anymore. If i delete the folder (ham) in iobroker then after a restart it dont getting created new.

Details of your setup.

Wifi Circuit Breaker 1P-4P Stecker-Auf Smart Schalter Drahtlose Fernbedienung IOT Schalter (APP: Ewelink) image

Please paste any relevant logs below.

ham.0 | 2022-08-03 12:45:59.997 | info | All Libraries installed/updated
ham.0 | 2022-08-03 12:45:59.996 | info | Install/Update homebridge-ewelink
ham.0 | 2022-08-03 12:45:59.994 | info | Install/Update the following Libraries: homebridge-ewelink
ham.0 | 2022-08-03 12:45:59.957 | info | starting. Version 4.0.2 in /opt/iobroker/node_modules/iobroker.ham, node: v18.4.0, js-controller: 4.0.23
host.webserver | 2022-08-03 12:45:57.556 | info | instance system.adapter.ham.0 started with pid 23809
host.webserver | 2022-08-03 12:45:55.080 | info | instance system.adapter.ham.0 terminated with code 11 (ADAPTER_REQUESTED_TERMINATION)
ham.0 | 2022-08-03 12:45:54.373 | info | Terminated (ADAPTER_REQUESTED_TERMINATION): Without reason
ham.0 | 2022-08-03 12:45:54.372 | info | terminating
ham.0 | 2022-08-03 12:45:54.347 | info | cleaned everything up...
host.webserver | 2022-08-03 12:45:54.352 | info | stopInstance system.adapter.ham.0 send kill signal
ham.0 | 2022-08-03 12:45:54.340 | info | Got terminate signal TERMINATE_YOURSELF

image

Ivolution-dev commented 1 year ago

Screenshot_20220803_180239_com coolkit Maybe interesting too i dont know

elzershark commented 1 year ago

Der HAM Adapter ist quasy egal, welche Version der hat. Wichtig ist deine Version vom ewelink Modul. Denke das hast Du nie geupdatet, stimmt? 😁

bwp91 commented 1 year ago

Translation:

The HAM adaptor is quasy no matter what version it has.

Your version of the ewelink module is important.

I think you've never updated that, right? 😁

Hi @Ivolution-dev

I have never used iobroker and don’t test the plugin on there.

However in the last few versions of the plugin I haven’t changed much that should stop it working there.

Do you find if you restart iobroker that it works until you open the ewelink app?

Ivolution-dev commented 1 year ago

Hi @Ivolution-dev

I have never used iobroker and don’t test the plugin on there.

However in the last few versions of the plugin I haven’t changed much that should stop it working there.

Do you find if you restart iobroker that it works until you open the ewelink app?

No iobroker don't create the datapoint for my ewelink connection there. So unfortunately that did not work

Der HAM Adapter ist quasy egal, welche Version der hat. Wichtig ist deine Version vom ewelink Modul. Denke das hast Du nie geupdatet, stimmt? 😁

Doch HAM und ewelink haben beide die neuste Version. Bei ewelink ist das die 10 und ham sieht man ja auch.

The problem now is that I deleted everything and it still doesn't work. If there were no changes to this and the version of HAM doesn't matter then I dont know where I can search for an error.

iobroker looks like this image

Ivolution-dev commented 1 year ago

I found something... iobroker update node to v18, but ham uses v16 LTS so today I got error logs that ham and ewelink dont have the required node version. I dont know why i dont got this earlier.

Ivolution-dev commented 1 year ago

image Thats what i am getting now i dont really know how to change the versions for iobroker

Ivolution-dev commented 1 year ago

Andybody know something about this?


1 info using npm@8.11.0
2 info using node@v16.16.0
3 timing npm:load:whichnode Completed in 1ms
4 timing config:load:defaults Completed in 7ms
5 timing config:load:file:/usr/local/lib/node_modules/npm/npmrc Completed in 14ms
6 timing config:load:builtin Completed in 15ms
7 warn config production Use `--omit=dev` instead.
8 timing config:load:cli Completed in 12ms
9 timing config:load:env Completed in 1ms
10 timing config:load:file:/opt/iobroker/node_modules/iobroker.ham/.npmrc Completed in 1ms
11 timing config:load:project Completed in 34ms
12 timing config:load:file:/home/iobroker/.npmrc Completed in 2ms
13 timing config:load:user Completed in 2ms
14 timing config:load:file:/usr/local/etc/npmrc Completed in 1ms
15 timing config:load:global Completed in 2ms
16 timing config:load:validate Completed in 1ms
17 timing config:load:credentials Completed in 3ms
18 timing config:load:setEnvs Completed in 4ms
19 timing config:load Completed in 88ms
20 timing npm:load:configload Completed in 89ms
21 timing npm:load:mkdirpcache Completed in 5ms
22 timing npm:load:mkdirplogs Completed in 2ms
23 verbose title npm install homebridge-ewelink@10.0.0
24 verbose argv "install" "homebridge-ewelink@10.0.0" "--production" "--loglevel" "error"
25 timing npm:load:setTitle Completed in 5ms
26 timing config:load:flatten Completed in 14ms
27 timing npm:load:display Completed in 19ms
28 verbose logfile logs-max:10 dir:/home/iobroker/.npm/_logs
29 verbose logfile /home/iobroker/.npm/_logs/2022-08-09T15_55_13_487Z-debug-0.log
30 timing npm:load:logFile Completed in 25ms
31 timing npm:load:timers Completed in 1ms
32 timing npm:load:configScope Completed in 0ms
33 timing npm:load Completed in 150ms
34 timing arborist:ctor Completed in 5ms
35 silly logfile start cleaning logs, removing 1 files
36 silly logfile done cleaning log files
37 verbose shrinkwrap failed to load node_modules/.package-lock.json out of date, updated: node_modules
38 timing idealTree:init Completed in 4880ms
39 timing idealTree:userRequests Completed in 43ms
40 silly idealTree buildDeps
41 silly fetch manifest homebridge-ewelink@10.0.0
42 http fetch GET 200 https://registry.npmjs.org/homebridge-ewelink 246ms (cache hit)
43 silly placeDep ROOT homebridge-ewelink@10.0.0 REPLACE for: iobroker.ham@4.0.2 want: 10.0.0
44 timing idealTree:#root Completed in 328ms
45 silly fetch manifest es-abstract@^1.19.0
46 http fetch GET 200 https://registry.npmjs.org/es-abstract 16ms (cache hit)
47 silly placeDep node_modules/function.prototype.name es-abstract@1.20.1 OK for: function.prototype.name@1.1.5 want: ^1.19.0
48 silly fetch manifest object-inspect@^1.12.0
49 silly fetch manifest object.assign@^4.1.2
50 http fetch GET 200 https://registry.npmjs.org/object-inspect 22ms (cache hit)
51 http fetch GET 200 https://registry.npmjs.org/object.assign 24ms (cache hit)
52 timing idealTree:node_modules/function.prototype.name Completed in 67ms
53 timing idealTree:node_modules/homebridge-ewelink Completed in 0ms
54 silly fetch manifest normalize-path@^2.1.1
55 http fetch GET 200 https://registry.npmjs.org/normalize-path 14ms (cache hit)
56 silly placeDep ROOT normalize-path@2.1.1 OK for: mock-require@3.0.3 want: ^2.1.1
57 timing idealTree:node_modules/mock-require Completed in 27ms
58 timing idealTree:node_modules/normalize-path Completed in 1ms
59 silly fetch manifest es-abstract@^1.19.1
60 silly placeDep node_modules/promise.prototype.finally es-abstract@1.20.1 OK for: promise.prototype.finally@3.1.3 want: ^1.19.1
61 timing idealTree:node_modules/promise.prototype.finally Completed in 11ms
62 silly fetch manifest object-inspect@^1.9.0
63 silly placeDep ROOT object-inspect@1.12.2 OK for: side-channel@1.0.4 want: ^1.9.0
64 timing idealTree Completed in 5387ms
65 timing command:install Completed in 5483ms
66 verbose stack TypeError: Invalid Version:
66 verbose stack     at new SemVer (/usr/local/lib/node_modules/npm/node_modules/semver/classes/semver.js:38:13)
66 verbose stack     at compare (/usr/local/lib/node_modules/npm/node_modules/semver/functions/compare.js:3:32)
66 verbose stack     at Object.gte (/usr/local/lib/node_modules/npm/node_modules/semver/functions/gte.js:2:30)
66 verbose stack     at Node.canDedupe (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/node.js:1071:32)
66 verbose stack     at PlaceDep.pruneDedupable (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:468:14)
66 verbose stack     at PlaceDep.placeInTree (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:329:14)
66 verbose stack     at PlaceDep.place (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:216:10)
66 verbose stack     at new PlaceDep (/usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/place-dep.js:73:10)
66 verbose stack     at /usr/local/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:990:31
66 verbose stack     at Array.map (<anonymous>)
67 verbose cwd /opt/iobroker/node_modules/iobroker.ham
68 verbose Linux 5.10.11-v7l+
69 verbose node v16.16.0
70 verbose npm  v8.11.0
71 error Invalid Version:
72 verbose exit 1
73 timing npm Completed in 5984ms
74 verbose unfinished npm timer reify 1660060513977
75 verbose unfinished npm timer reify:loadTrees 1660060514042
76 verbose unfinished npm timer idealTree:buildDeps 1660060518972
77 verbose unfinished npm timer idealTree:node_modules/side-channel 1660060519410
78 verbose code 1
79 error A complete log of this run can be found in:
79 error     /home/iobroker/.npm/_logs/2022-08-09T15_55_13_487Z-debug-0.log
Ivolution-dev commented 1 year ago

Okay the solution is downgrading and restarting as much as you can. Your adapter works with ioBroker Homebridge Adapter v4.0.1 With newer version the adapter dont create the states in iobroker

Apollon77 commented 1 year ago

The reason is completely the other way around!!

The current ewelink requires homebridge 1.4.x. HAM 4.x uses homebridge 1.3!! So you need to use Ham adapter 5 which is in beta which is compatible to homebridge 1.4 ... or you doewngrade eweplugin to a version which is compatble to homebridge 1.30

Ivolution-dev commented 1 year ago

ham: v5.0.2 ewelink: v10.0.0 -> works if you restart twice and wait over 5 min between.

Thank you for your help. I hadn't seen that about the different versions.

bwp91 commented 1 year ago

thanks @Apollon77 !

elzershark commented 1 year ago

In der Einstellung das Modul ersetzen mit homebridge-ewelink@latest. Es darf keine Versionsnummer dabei stehen

In the settings replace the module with homebridge-ewelink@latest. There must be no version number

Apollon77 commented 1 year ago

@elzershark This might not be the ideal solution! because homebridge plugin versions requier certain homebridge versions. Without a version the ham adapter always install "latest", so it might break when ham adapter was not updated but plugin requires new homebridge version (or the other way around). So there is a good point to dpecify the plugin version in the config

elzershark commented 1 year ago

Nur eine Info, da ziemlich kompliziert: Kann an ham, admin, Module liegen:

iobroker aktuell alles beta. Node 16

ham v 5.1.0 admin v 6.2.17

Modul homebridge-ewelink Über Button "Homebridge" lässt sich die Einstellung/Konfiguration nicht speichern. (Alle Module)

Manuelles hinzufügen NPM-Module: homebridge-ewelink oder homebridge-ewelink@latest = v. 8.11.0 Über Button Homebridge wird "Verfügbar" 10.0.0 angezeigt. Installierte Version wird nicht erkannt Wird als "?" angezeigt

Es muss immer die richtige "schreibweise" eingetragen werden, sonst funktioniert ham nicht (bei allen Modulen) Beispiel:

homebridge-ewelink@latest homebridge-tesvor@1.0.8

ham + Module funkitionieren

Wird jetzt aktualisiert, oder ändert sich die Versionsnummer oder falsche Version. (egal welche Module) (Über Homebridge Button werden neuere Versionen angezeigt. Aktualisiert man, ändert sich die Versionsnummer) zu 99% funktioniert jetzt ham nicht mehr wegen:

2022-08-24 12:06:22.346 - error: ham.0 (28555) DB closed
2022-08-24 12:06:22.478 - error: host.elzershark Caught by controller[0]: npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
2022-08-24 12:06:22.479 - error: host.elzershark Caught by controller[1]: [24/08/2022, 12:06:17] Plugin /opt/iobroker/node_modules/iobroker.ham/node_modules/homebridge-plugin-wrapper package.json does not contain the keyword 'homebridge-plugin'.
2022-08-24 12:06:22.479 - error: host.elzershark Caught by controller[2]: [24/08/2022, 12:06:17] Plugin /opt/iobroker/node_modules/homebridge-plugin-wrapper package.json does not contain the keyword 'homebridge-plugin'.
2022-08-24 12:06:22.479 - error: host.elzershark instance system.adapter.ham.0 terminated with code 6 (UNCAUGHT_EXCEPTION)
Apollon77 commented 1 year ago

Bitte kompletten Fehler posten. Da muss mehr kommen (und bist seeehr off topic hier!)

bwp91 commented 1 year ago

I don’t understand german so it doesn’t matter for me if you go off topic i wouldn’t even know!

Apollon77 commented 1 year ago

But it should not be the case :-)

bwp91 commented 1 year ago

Hi, Closing this just as been a little overwhelmed with issues recently. If this is still an issue or a feature you would like implemented then please do re-open this ticket! Thanks for your understanding!