Kasa Smart Plug on Plug n Play solar outlet; Reverse energy direction?

I don’t think this is a Sense bug – maybe a Kasa Smart Plug bug? – but it’s a strange case I thought I’d report.

I have a plug-n-play solar panel on the roof (as mentioned in Will sense work with the Legion solar 2 (puts energy into your lines)… note to @agregg18: it’s smart enough to stop producing if the grid is down).

I recently added a Kasa smart plug to monitor the panel output, so now it shows up nicely in my Sense display:

…and thanks to Sense & Kasa I now have a nice log of the panel’s output:

All good! The only problem is that the energy measurement is reversed. Perhaps the Kasa smart plug reports the absolute value of the energy flow, showing consumption of 187 watts when it is actually producing 187 watts.

I checked the device settings in Sense to see if there were some way to reverse the reading from the smart plug, but didn’t see it.

Not a big deal, but any suggestions?

I believe this is the answer here, but I’d be curious as to what TP-Link/Kasa support says.
I need to look into this further, but I believe you would need to monitor production and consumption through separate sensors (as with Sense Solar) in order to get that distinction within the app. All Sense can see is the power coming through the mains, not at the breaker-level, so my gut is telling me that a plug-and-play solution still wouldn’t work here as intended.

You are correct, this is not a feature in the app at this time.

1 Like

What is the value shown in the Kasa app?

There’s a person here who wrote an integration to emulate Kasa smartplugs so that other data sources could be force-fed into Sense. Maybe they could tell us what datatype is associated with that power value? If it’s an unsigned integer, well, there’s our answer.

Not sure there’s a bug in any device. With AC current / voltage and no reference to the grid, there’s no easy way to designate polarity. I think when Sense does its solar calibration, the monitor establishes the power reference for positive and negative energy flow. But if you are just measuring the waveforms, you have no way to know the direction of energy flow.


Saw your post, so I gave it a try! For what it’s worth the TP Link protocol is just JSON, so I don’t think there’s even an unsigned number type anyway.

I configured a static SenseLink plug to -15W and while Sense does detect it as a new device, it reports the plug as off*. So it would appear you can’t currently report a negative/power-production value via a smart plug to Sense.

*In terms of power reading, at least. It shows the switch control status as “on”, but I haven’t gotten around to implementing the switch control from Sense function in SenseLink.


The value shown in the Kasa app is also positive (e.g. Daily Average of 1.37 kWh).

Kevin, I think the smartplug situation could be directly compared to the case of a utility electric meter, which can determine the magnitude and direction of power flow by measuring only voltage and current at a single point in the system. I actually had to think this over a few times to refresh myself…

If the smartplug has two voltage leads and a single CT, the device can be configured internally to be able to sense the voltage between the leads and the current vector with respect to that voltage configuration. So, if the voltage and current are in phase with each other (as set up in the factory with power flowing from plug to receptacle) then the plug will know from that point forward which way power is flowing. If the CT orientation were then reversed, or if power was sourced from the receptacle and sunk to the plug, the voltage and current would be out of phase 180 degrees compared to the “as-built” scenario. So, as long as the smartplug internal bits are able to sense the phase angle between voltage and current, and not just magnitude values for both, then they should be able to report power flow direction. Right?