jtburgess / indigo-TP-LInk

Indigo Plugin for TP-Link SmartPlugs, powerStrips, dimmer switches, and dimmable bulbs; (coming someday color bulbs)
The Unlicense
2 stars 4 forks source link

Problem with devices not updating (HS-110) on 1.0.0 #14

Open sumocomputers opened 1 year ago

sumocomputers commented 1 year ago

I recently upgraded from the 0.9.9 plugin to the 1.0.0 plugin. Please see screen recording here demonstrating the problem:

https://www.icloud.com/sharedalbum/#B17G1CvrSvicEH

What I have noticed is that event though the devices haven't been disabled from within Indigo due to losing WiFi momentarily (I set the timeout very high), the device usage stats at some point become frozen, and no longer update. I know the devices have not become disabled due to WiFi or other issues because I have a check that runs every few seconds and alerts me right away.

Anyway, a simple disable/enable Indigo communication does the trick, but I am not sure how long it lasts before the problem comes back.

I do know that my washer and dryer that use the TP-Link HS-110s will work on Saturday when I do the disable/enable trick, but by the next Saturday, they are frozen again.

jtburgess commented 1 year ago

Let me see if I understand. You have two HS110s, and they all have the same issue - which is that the energy stats freeze until you reset the device. This behavior did not happen before the new release 1.0.0.

are there any other symptoms. E.g., Can you turn the devices on/off? What is the result of a "Status Request".

Do you see any messages in the log indicating a polling problem? And you don't think there are any network issues. Try setting the "missed polls between warnings" to 1, so you'll know if ANY polls were missed.

I don't have any energy-monitoring capable devices, and I've looked at the code and so far don't see any changes between 0.9.8 and 1.0.0 that would cause the energy monitoring to stop while affecting nothing else. I'll keep looking but more information is always useful.

sumocomputers commented 1 year ago

I have several HS110s and the energy stats on all of them will eventually freeze (not all at the same time, oddly enough).

I can disable/re-enable the device or the plugin, and they all come back working until they fail again at different intervals.

I just did a reset so I will need to check how they respond to Status Request and on/off commands once they fail again, which might take a few days.

I have set the "missed polls between warnings" to 1, so I am assuming this will just make a log entry?

Lastly, take a look at the screenshot from Grafana. It might be hard to tell, but this is one of the TP-Links that seems to start freezing about every 6-8 days as indicated by the red spikes when active, and no spikes when it freezes.

Screenshot 2023-02-12 at 2 08 54 PM
sumocomputers commented 1 year ago

This pattern has persisted where the plugin loses status updates permanently after about 6-7 days.

I have resorted to reloading the plugin every night at midnight, until the issue can be sorted.

jtburgess commented 1 year ago

Very strange. Does Indigo give you any indication why it disconnects?Does it disconnect all at once, or each one independently?-- JohnOn Mar 4, 2023, at 3:36 PM, sumocomputers @.***> wrote: This pattern has persisted where the plugin loses status updates permanently after about 6-7 days. I have resorted to reloading the plugin every night at midnight, until the issue can be sorted.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

sumocomputers commented 1 year ago

With 1.0.0. I am now using a value of 999999999 for "Shutdown the device after these many missed polls", whereas I wasn't before with 0.9.9. I am considering removing that large number and seeing if my own Indigo logic that watches every 1 second for the TP-Link devices to go offline would alert me. My logic also keeps attempting to enable the device, and alerts me once re-enabled.

A few additional data points:

-All TP-Link devices have a network uptime of 30+ days according to my Unifi network stats, which tell me they are likely not dropping off WiFi. Though it is possible a momentary loss of WiFi might not register with that Unifi stat.

-As far as I can tell, the TP-Link devices don't actually "disconnect" from Indigo, just the power stats seem to freeze. When a device decides to stop updating stats, the device still appears "connected" in Indigo, and I even think you can still power the device on and off for example, though I need to confirm that. It is like the polling of the TP-Link device is always returning "I'm alive", but the power stats themselves are dead.

-Yesterday I manually disabled and enabled the 1.0.0 plugin because the stats on all of my HS110 had frozen. They all came back to life, but one of them for the Dryer (in Yellow) ended up freezing just about 30 minutes later (see attached screenshot). So instead of reloading just the plugin, I want to experiment with disabling/enabling the devices themselves, which I know worked when I was handling the monitoring and re-enable logic myself with Indigo.

-I have seen where some devices are updating their stats and others are frozen, but given enough time, they all will freeze as far as power stats go. Usually about 6-8 days.

Screenshot 2023-03-05 at 10 34 41 AM
sumocomputers commented 1 year ago

I have found some interesting data. In the graph, notice 3 of the 4 devices flatlined, despite an Indigo schedule at midnight that reloads the plugin, disables/enables each device, then resets usage for each device.

Those 3 devices are always in the On state, and the 4th device has been in the Off state for months.

So I decided to change the "Polling interval when device is On" from default of 10 to 30, since this seems like a logical suspect. I will keep monitoring and see if this changes anything.

FYI: Could not find any relevant Indigo log entries as to why the flatlines would occur.

Screenshot 2023-03-14 at 7 44 07 AM Screenshot 2023-03-14 at 7 47 17 AM