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

IP injection sometimes shows 2 devices connected #42

Closed mobamoba closed 3 years ago

mobamoba commented 4 years ago

Describe the bug I'm using msg.topic to insert the IP address. The picture shows it best but even the node status reports 2 devices connected even though that's not correct (I'm not honestly not even sure what it means). The plug works and the injected IP is correct (it's from the ARP table actually). I'm not sure if this is an underlying bug or just a GUI bug but figured I'd report it

To Reproduce Steps to reproduce the behavior: I'm not sure. All my plugs are getting IPs from the ARP table and this bug only happens with one of them and at random.

Expected behavior It should should only a single device with the proper status.

Screenshots

Untitled

As you can see, there's nothing in the IP of the node and one of the input is the msg.topic with the correct IP (the other two are for the on and off so unrelated to this issue).

hufftheweevil commented 3 years ago

Are you sure all of those input wires pass in a msg.topic that is exactly equal to the same IP? Can you paste the full flow configuration for closer inspection?

mobamoba commented 3 years ago

There are only 4 inputs - I don't use toggle so the 4 are: On, Off, getInfo (10 second trigger), and the msg.topic.

The msg.topic part was buggy enough for me that I stopped using it. It seemed like one of two things was happening. Either there was a mismatch between the IP reported by getInfo and the IP being injected and the node status was therefore reporting two devices since it saw two different IPs. Or - and I think this is actually what was happening - somehow the old IP wasn't getting "cleared" or something. In other msg.topic would inject an IP then at some later point inject a different IP but the node somehow retained both.

hufftheweevil commented 3 years ago

Ah, yes, it doesn't necessarily remove devices at any point.