Closed manix1979 closed 7 years ago
Same Issue as I.
TypeError: Cannot read property 'forEach' of undefined
at /usr/lib/node_modules/homebridge-devolo/node_modules/node-devolo/dist/Devolo.js:300:28
at /usr/lib/node_modules/homebridge-devolo/node_modules/node-devolo/dist/DevoloApi.js:183:17
at IncomingMessage.
If I install plugin version 0.1.3 everything runs fine. I run home bridge on a raspberry pi module B with Jessie Lite and node.js Version 8.x.
Any help regarding the topic would be great. Previously I was running the latest version in a Synology NAS container but I wanted to use the ffmpeg plugin which requires to open all ports which I don't want to do for my productive server.
I installed now 15 times with serveral SD Cards and it works as i want. Still the same versions, just other SD Cards for my Pi3. Further testing will show if I am on a good way.
I checked today my Synology installation and the same error occurs too.
@manix1979: Did you find something out?
I'm going to publish an update later this week. I think it should fix that.
Great news - thx
@ramsnerm: not really... i did the same procedure every time. this time I used raspbian jessie lite and the homebridge app for apple. now it works. just 1 dopr/window sensor is not working. on dhc it works...to configure i used the eve app and not the home app.
@manix1979: Thanks for the update. Did you install other plugins during your test as well or only the devolo one?
harmony hub, wol, people was installed too... everything runs very well right now.
Quite interesting. I have installed camera-ffmpeg, Wemo, Nuki and Doorbird. Which node.js Version do you use. I have installed Version 8.x. Tried to make a clean install as well today on a new RPI3 with devolo only but without success.
i tried serveral node versions... it‘s running perfect under v 4.8.4
Did you try it as well with version 8.x? that's my only hope otherwise I give up at that time. Maybe the promised update from Kevin might help.
i tried and no luck with version 8. but i would not say it‘s because of version 8. maybe serveral other depencies. i will try other versions as well. BUT with a different sd card ;-)
I gave it a try today again. I downgraded to node.js Version 5.12. However this don't change anything for me:
[8/16/2017, 6:05:50 PM] [homebridge-platform-wemo.BelkinWeMo] Ignoring WeMo Platform setup because it is not configured [8/16/2017, 6:05:50 PM] [Devolo] HBDevoloPlatform > Devolo API Version: 201702202047 [8/16/2017, 6:05:50 PM] [Devolo] HBDevoloCentralUnit > Initializing [8/16/2017, 6:05:50 PM] [Devolo] HBDevoloPlatform > Central Unit found. [8/16/2017, 6:05:50 PM] [Devolo] HBDevoloPlatform > SessionID: IDxxxxxxxxxxxxxxxxxxxEnd [8/16/2017, 6:05:51 PM] [Devolo] HBDevoloSwitchMeterDevice > Initializing [8/16/2017, 6:05:51 PM] [Devolo] HBDevoloSmokeDetectorDevice > Initializing [8/16/2017, 6:05:51 PM] [Devolo] HBDevoloSmokeDetectorDevice > Initializing [8/16/2017, 6:05:51 PM] [Devolo] HBDevoloSmokeDetectorDevice > Initializing /usr/lib/node_modules/homebridge-devolo/dist/index.js:65 throw err; ^
If I roll back to hombridge-devolo version 0.1.3 everything runs again as expected.
One final difference could be: Have you @manix1979 installed node.js with the package manager like: curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash - sudo apt-get install -y nodejs '
or did you install it with a different workflow?
I gave the app „homebridge“ for apple a chance to get it working. it worked, so I followed the old rule „never touch a running system“. I have no idea how node js was installed during the automated setup. before this i tried serveral ways for installing. none worked so far. the server was running fine with all other plugins but never with devolo. maybe it was just luck or the app did something what I forgot or even did not know. If you can tell me where the install log is located I can take a look what parameters or packages have been used with automated setup from the app.
Thanks for the clarification but to be honest I have no idea what the app does. I tried it once but did also not work for me, but may I try a complete fresh test with it again.
if you like to use the way with the app, these are my steps: 1.) install raspian jessie lite newest 2.) give ssh access by typing sudo raspi-config 3.) download the app 4.) go through the steps (takes around 20mins.) 5.) install the devolo plugin and edit the config.json within the app and reboot 6.) go on tools, troubleshooting and let the app restart homebridge 7.) the devolo infos are written in the window 8.) edit the config.json again with the app 9.) reboot, wait until the app gives green status and that‘s it
this was my way to get it working. I installed as well without app but on every try no success with devolo. Hopefully this helps you to get it working. I am not a raspberry and linux beginner BUT a JavaScript noob ;-) Maybe it‘s really important to have 100% compatible versions running of node and node js to get it work. With the app I can reboot the raspberry as often as I like and everything still runs. Would be a big help for all others how the app works if you can‘t use it. Manual way should be possible as well but without info it‘s hard to guess what version and what parameters beeing used.
ps: you have to add the plugin AND the platform in the app. Editing is totally easy but a long way to write it by hand. I found no way for copy and paste.
Thanks for the tips. I will give it a try. In the meanwhile I identified the script which makes the installation. The app uses the script ".HomebridgeRootSetup.sh" place in /home/pi. It installs the node.js Version 4.8.4.
Additional I found this installation places everything into /usr/local/lib.... and not as my current Installation directly into /usr/bin, Lib, ... I will update my current system to see if a change makes the difference. Could be a good change because the error message said: /usr/local/lib/node_modules/ so it looks in the directory local where in my case is "nothing".
So I changed my complete setup just to prove it. It does not change anything for the devolo Version 0.1.4. The Reason why it works with the iPhone App is simply that it installs node Version 4.8.4. When you then nom install devolo it takes Version 0.1.3 due to compatibility reason. If you upgrade the same error as above occurs. So it is also not depending on the paths (as I have also no Java knowledge this could be anyway a wrong idea from myside).
So I will look forward to the new Version of Kevin. He promised to push this week a new Version to solve the issue - this would be really great.
partly true. i use currently devolo 0.1.4 installed via app and it works
Strange. I tested it too but it is not working. @manix1979: Could you create an Image from your installation and submit me an eg DropBox Link to download it so I ould test/check what is differently. Only if this is OK for you.
Sure i can do that for you. today it‘s a bit busy but tomorrow I can do it. Please submit me an email adress because I dont like to post the link to my image here.
Thanks for your help - you can send me the link to following address: ------- - Please leave me a short note when you sent it - just to avoid that it hides in my spam folder ;-)
email sent ;-)
@kdietrich : Did you manage to make an update as mentioned above?
So finally I found the reason of my problem and why it works with 0.1.3 and not with 0.1.4.
Node.js version and installation reason? NO All my test in changing the setup with node.js, the way how node.js is installed and so was not the rason for my problem.
Setup process errors?NO I also tried to setup my enviroment with the iPhone Homekit App (automatic setup process). Further @manix1979 (many thanks) supported me with a test image but i was also not lucky.
Search for the latest working version I then tried to idetify with which version it starts to not work anymore beginning with the Version from 6th of march. Wit the commit from 10th of April the error comes back. With this release the "Whilist/ruleset" function has been intorduced.
What I remembered was: I remove an Z-Wave device from my devolo bridge and the related scene programmed with it. So I created a new one, a valid one with an existing device and restarted the homebridge again. Know it works.
If I remove the scene again the error come up again. So I assuem the hombridge-devolo.expects at least one scene to work (but this is jsut a guess from my side) - maybe only if there was a scene in place in the past.
@kdietrich: May this helps to identify the error reason.
@ramsnerm: i have no scene activated or created and it works anyway. could be a reason as well. the promised update from kdietrich could bring a solution.
@ramsnerm: about the raspberry image: you are welcome ;-)
My "problem" comes today back again.
So I decided to make a deeper investigation again. Today I identified that one device is no longer in my Devolo Network and one Device is a "Secondary Controller" in my network. In both cases "item.properties.deviceModelUID" delivers NULL which throughs the exception.
I am not skilled in Java but I made a test and mofied Line 133 of the file _/usr/local/lib/node_modules/homebridge-devolo/nodemodules/node-devolo/dist/Devolo.js
if (item.UID.indexOf('virtual:device') > -1 **|| item.properties.deviceModelUID == null**) { continue; //not supported yet }
by adding "|| item.properties.deviceModelUID == null". This stopped my error and my Devolo Homebridge was starting again.
Maybe this is a director from where the error is coming.
Sorry guys, I was busy the last days and couldn't find time to push said update. I'll push some fixes at the start of next week.
Please try the latest master and let me know if your issues are fixed.
currently for me it works. my error came from a connection issue with the smoke detector. resetting the dhc made it work perfect.
Installing the plugin with the standard command didn't fetch v0.1.5-dev (only installed 0.1.4)
npm install -g homebridge-devolo
Instead of this I had to use
npm install -g https://github.com/kdietrich/homebridge-devolo#a5cf48f1c0ed818440c29ca48335874effc24d32
Starting afterwards homebridge I had the same error message as @KiboOst (see issue).
To solve it I had to install
npm install -g ws
This allowed me now to start it, but my original problem still exists so I had to apply my "fix" again: modifying line 133 of the file /usr/local/lib/node_modules/homebridge-devolo/node_modules/node-devolo/dist/Devolo.js
if (item.UID.indexOf('virtual:device') > -1 **|| item.properties.deviceModelUID == null**) { continue; //not supported yet }
EDITED Remark: After I removed my unknown devices from the Z-Wave Network it works without the modification
@ramsnerm Thanks for your help! I've fixed this in the latest master: npm install -g https://github.com/kdietrich/homebridge-devolo
Hi!
Es scheint irgend ein Problem zu geben mit dem Devolo Plugin. Hier mal die Log
`pi@raspberrypi:~ $ homebridge -D WARNING The program 'node' uses the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node WARNING The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi. WARNING Please fix your application to use the native API of Avahi! WARNING For more information see http://0pointer.de/avahi-compat?s=libdns_sd&e=node&f=DNSServiceRegister [7/31/2017, 8:15:11 PM] Loaded plugin: homebridge-devolo [7/31/2017, 8:15:12 PM] Registering platform 'homebridge-devolo.Devolo' [7/31/2017, 8:15:12 PM] --- [7/31/2017, 8:15:12 PM] Loaded config.json with 0 accessories and 1 platforms. [7/31/2017, 8:15:12 PM] --- [7/31/2017, 8:15:12 PM] Loading 1 platforms... [7/31/2017, 8:15:12 PM] [Devolo] Initializing Devolo platform... [7/31/2017, 8:15:12 PM] [Devolo] HBDevoloPlatform > Initializing (Version: 201702221607) [7/31/2017, 8:15:12 PM] [Devolo] HBDevoloPlatform > Configuration: { platform: 'Devolo', name: 'Devolo', host: '192.168.178.23', email: 'xxx', password: 'xxx', uuid: 'xxx', gateway: 'xxx', passkey: 'xxx', heartrate: '2' } [7/31/2017, 8:15:12 PM] [Devolo] HBDevoloPlatform > Searching for Devolo Central Unit. [7/31/2017, 8:15:12 PM] [Devolo] HBDevoloPlatform > Devolo API Version: 201702202047 [7/31/2017, 8:15:12 PM] [Devolo] HBDevoloCentralUnit > Initializing [7/31/2017, 8:15:12 PM] [Devolo] HBDevoloPlatform > Central Unit found. [7/31/2017, 8:15:12 PM] [Devolo] HBDevoloPlatform > SessionID: ID48DB9GmmN35AfkP55CmjHLLBjgGKLKobMOPHEnd [7/31/2017, 8:15:13 PM] [Devolo] HBDevoloSwitchMeterDevice > Initializing [7/31/2017, 8:15:13 PM] [Devolo] HBDevoloSwitchMeterDevice > Initializing [7/31/2017, 8:15:13 PM] [Devolo] HBDevoloSmokeDetectorDevice > Initializing [7/31/2017, 8:15:13 PM] [Devolo] HBDevoloDoorWindowDevice > Initializing [7/31/2017, 8:15:13 PM] [Devolo] HBDevoloDoorWindowDevice > Initializing [7/31/2017, 8:15:13 PM] [Devolo] HBDevoloSwitchMeterDevice > Initializing /usr/local/lib/node_modules/homebridge-devolo/dist/index.js:65 throw err; ^
TypeError: Cannot read property 'forEach' of undefined at /usr/local/lib/node_modules/homebridge-devolo/node_modules/node-devolo/dist/Devolo.js:300:28 at /usr/local/lib/node_modules/homebridge-devolo/node_modules/node-devolo/dist/DevoloApi.js:183:17 at IncomingMessage. (/usr/local/lib/node_modules/homebridge-devolo/node_modules/node-devolo/dist/DevoloApi.js:64:21)
at emitNone (events.js:72:20)
at IncomingMessage.emit (events.js:166:7)
at endReadableNT (_stream_readable.js:905:12)
at nextTickCallbackWith2Args (node.js:437:9)
at process._tickCallback (node.js:351:17)
`
Hat jemand eine Idee?