caseyjhol / node-red-contrib-tplink

A collection of Node-RED nodes for TP-Link Smart Home devices
https://www.npmjs.com/package/node-red-contrib-tplink-iot
MIT License
16 stars 15 forks source link

"TypeError: Cannot read property 'getInfo' of undefined" #34

Closed Stulander closed 3 years ago

Stulander commented 4 years ago

Node appears to be broken with HS110 firmware version 1.5.10 hardware version 2.1. Nodered version 1.0.6.

Also getting "Sorry. Your selected device is invalid!" when trying to edit node.

caseyjhol commented 4 years ago

What version of node-red-contrib-tplink are you using?

Stulander commented 4 years ago

0.4.3, latest version

caseyjhol commented 4 years ago

Please try v1.0.0-alpha.

Stulander commented 4 years ago

Will do, and assuming this fixes it I apologise in advance for not checking that before.

caseyjhol commented 4 years ago

No worries. It's an alpha release so I understand not noticing/trying it. I'm waiting for someone who has bulbs to test it before releasing a final version.

Stulander commented 4 years ago

Now I'm unable to connect to the plug at all, with error

"Error connecting to device 192.168.1.59: Error: connect EHOSTUNREACH 192.168.1.59:9999"

The Kasa app works - I'm able to switch the plug on and off. I looked up the MAC address on the DHCP server so I'm definitely connecting to the right IP address.

caseyjhol commented 4 years ago

I just released v1.0.0-alpha.1. It's a pretty small update, but it does address some memory leak issues. Please try upgrading to that and let me know if the issue persists.

Stulander commented 4 years ago

Same issue it seems. I think the TP-Link smart home API must be broken, the auto discover function can't find my HS110. I just tried the code found here: https://github.com/plasticrake/tplink-smarthome-api/issues/54 which also didn't work.

I tried changing the broadcast address to 192.168.1.255 as suggested which also didn't seem to fix it.

Head commented 4 years ago

Just want to leave here, sounds like a similar API change: In v0.4.3 I get "TypeError: Cannot read property 'emeter' of undefined".

tbh I don't know how to install the alpha version...

Stulander commented 4 years ago

It's just a case of copying the files in the archive to the correct directory. On my install it was something like /home/\/.node-red/nodes

Find the node-red-contrib-tplink folder and overwrite the files in there with the new ones, restart node-red and you should see that the node has been updated.

The new version didn't work for me either, but it just couldn't detect my HS110 plug at all. Seeing as all I care about is power usage stats, I'm probably going to just use a loop-meter with an ESP and then I don't have to worry about TP-Link breaking the API whenever they decide to update the firmware.

caseyjhol commented 4 years ago

@Head

npm i node-red-contrib-tplink@1.0.0-alpha.1