Smart plug power data glitches

TPLink and Wemo work differently on the network.

Wemo uses a separate HTTP transaction to fetch the current wattage. This is slow and generally an extremely inefficient way to get the ~16 bytes of information which we actually need. Having to do this every few seconds contributes to the overall latency of your network and can definitely saturate Sense’s wifi connection with enough plugs.

TPLink has two ways to fetch the current wattage: TCP, UDP unicast and UDP broadcast. UDP broadcast is the best choice for sense because:

  1. We only care about the wattage when the query is sent, and we don’t backfill from the smart plugs, so a slower protocol like TCP would not help us. Yes, TCP is more reliable, but only because it tries retransmitting unacknowledged packets. By the time those retransmissions have been done, Sense doesn’t care about the data any more.
  2. Broadcast UDP (which is distinct from multicast, which TPLink does not use) is great, because it means that Sense can send a single broadcast wattage query to the whole network and receive unicast responses from each plug, all in a single packet. This means that the whole network’s load is basically as minimal as possible.

As for the weird data above, Sense believes the plugs. The plug from the first example was claiming 11188.48 watts, 15 times in a row, and it continued with its weird readings afterwards, as you see in the plot.

For the instances of dropouts, it’s either that the plug was reporting zero watts, or that the plug was not responding to queries for that time period. We see both happen, but not too frequently.

Currently, Sense does not do any scrubbing of high-but-possible numbers from the data (10kW being in the sane range for a plug to report).

10 Likes