ianmichell / homebridge-w215

Homebridge D-Link w215 plugin
Apache License 2.0
7 stars 4 forks source link

Switching is working, however temperature is read as "null" #1

Closed darezik closed 7 years ago

darezik commented 7 years ago

I've pasted the output below, and it'd be great if you could take some time to look at it? My firmware version is 1.24, and the switching is working.

error: TypeError: Cannot read property 'nodeValue' of null at readResponseValue (/usr/lib/node_modules/homebridge-w215/node_modules/hnap/js/soapclient.js:248:40) at /usr/lib/node_modules/homebridge-w215/node_modules/hnap/js/soapclient.js:81:16 at tryCallOne (/usr/lib/node_modules/homebridge-w215/node_modules/promise/lib/core.js:37:12) at /usr/lib/node_modules/homebridge-w215/node_modules/promise/lib/core.js:123:15 at flush (/usr/lib/node_modules/homebridge-w215/node_modules/asap/raw.js:50:29) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9) error: TypeError: Cannot read property 'nodeValue' of null at readResponseValue (/usr/lib/node_modules/homebridge-w215/node_modules/hnap/js/soapclient.js:248:40) at /usr/lib/node_modules/homebridge-w215/node_modules/hnap/js/soapclient.js:81:16 at tryCallOne (/usr/lib/node_modules/homebridge-w215/node_modules/promise/lib/core.js:37:12) at /usr/lib/node_modules/homebridge-w215/node_modules/promise/lib/core.js:123:15 at flush (/usr/lib/node_modules/homebridge-w215/node_modules/asap/raw.js:50:29) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9) Values { power: true, consumption: 0, totalConsumption: NaN, temperature: 0 }

Amazing work, anyway, this module has been super helpful :)

ianmichell commented 7 years ago

Looks like an issue with the library I used. I'll fix it and create a pull request to original author.

ianmichell commented 7 years ago

I've added an additional check at that line. Essentially if the value is null then we need to ensure that it returns "ERROR"

I would help if you could elaborate on how often this happens. Is it all the time?

darezik commented 7 years ago

I've solved this issue myself. Turns out it is a variant of bikerp/dsp-w215-hnap#2. I corrected them for my local installation(it is hardware version dependent) and now everything is working correctly.

thatsnasty commented 7 years ago

I'm having the same problem, @darezik could be more specific in what you corrected and where? I'm a little confused as to what I'm editing exactly.

ryanbeaton commented 6 years ago

Hi @thatsnasty what I just did to fix it is edit the soapclient.js file in "/usr/local/lib/node_modules/homebridge-w215/node_modules/hnap/js" (Mac path, yours may be different) to change: every instance of moduleParameters(2)) to moduleParameters(3)) - there are four instances AND every instance of moduleParameters(3)) to moduleParameters(2)) - there are two.

great success! :) Credit to info in https://github.com/bikerp/dsp-w215-hnap/issues/2

mogensboegh commented 6 years ago

Hi Thank you a lot I will implement the modifications and I look forward to the seeing the result

Best regards

Med venlig hilsen Mogens Bøgh Mortensen Mosevej 7 Hedeskov 8410 Rønde Mob 22246731 Mail mogensboegh@gmail.com

2018-04-28 16:42 GMT+02:00 Ryan Beaton notifications@github.com:

Hi @thatsnasty https://github.com/thatsnasty what I just did to fix it is edit the soapclient.js file in "/usr/local/lib/node_modules/ homebridge-w215/node_modules/hnap/js" (Mac path, yours may be different) to change: every instance of moduleParameters(2)) to moduleParameters(3)) - there are four instances AND every instance of moduleParameters(3)) to moduleParameters(2)) - there are two.

great success! :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/thunderbird/homebridge-w215/issues/1#issuecomment-385181006, or mute the thread https://github.com/notifications/unsubscribe-auth/AV7j-WE8aTqxiuaWNuYUFEYZW06jvS84ks5ttH_CgaJpZM4Lp9dZ .