Emulated Kasa integration Brings SenseLink to HomeAssistant

I’m in the process of building out a 220 solution using a Raspberry PI Zero W and this add on board:

My plan is to tie it together with MQTT into Senselink which I already have running for a bunch of 120v Smart Plugs.

Board just arrived Saturday and the CT plugs should arrive this week, so hoping by next weekend I’ll be able to finish it up, and will let you know how I make out. Cost will be just slightly more than the single pair of CT Clamps that Sense just rolled out Dedicated Load monitoring for, and I’ll have up to 8 dedicated loads possible :).

2 Likes

As you get into the MQTT integration, I’m definitely interested in any feedback or issues you find! I don’t run any MQTT power reporting devices yet myself, so my testing of that is limited (aka faked). Fortunately @mattlebaugh has been super helpful with testing and sorting out the MQTT interface so far.

3 Likes

To all who can help,

I have a quick question for you. This was mentioned in the description for emulated kasa.

It’s also possible if you have a simple device with a consistent power usage to specify that. Docs are here: https://rc.home-assistant.io/integrations/emulated_kasa/ .

I have my HA integration all good and ready to go but have limited smart lights to report to sense through HA (the ones that aren’t detected anyway). My question is twofold.

  1. what happens when sense detected this device again (and can it detect it twice?)? Does device detection stop for all consistent 60 watt bulbs because there already is one emulated through Kasa?

  2. The quote mentioned simple devices. Does this mean that I can potentially set up a non smart lightbulb through Kasa and HA by looking at how much power (roughly) sense sees in the Meter, put that in as an entity (does it create entities or do they need to be integrated?). Is this something that, Sense will detect eventually anyway, and thereby make this system a holdover or stopgap while detection is happening?

Sorry about the very specific questions I just wanted to see if anyone had the answers. Thanks all!

For your question 1…good question! Per this post Sense will try not to double-report devices it can detect but determines to also be measured by a reporting smart plug. But I would expect that if you had (for example) a 60W bulb reported via TP-Link emulation, plus a separately-controlled 60W bulb that isn’t emulated, Sense could still independently detect the separate non-emulated 60W bulb. It would see the non-emulated bulb turn on without a corresponding increase in reported power from a plug, and thus know it’s a different device. Other folks with more knowledge/experience with the Sense detection please chime in here if I’m off base!

On the topic of simple devices, I believe that statement is referring to the capability to set up “static” power emulated devices. An example would be an attic fan that normally runs 24/7. You could do some testing to determine the actual constant power draw (with a real Kasa plug, or a Kill-a-Watt, or by turning it off/on and watching your Sense meter, etc) and then define a simple/static type emulated plug with that measured value. The TP-Link emulation/SenseLink will then report that as constant power value, as if you had HS110 plug utilized there.

Hope that helps!

1 Like

Oh I see! Thanks for the answer to question 1 I really appreciate it! I’m glad there’s people out there that troll the forums more than I do haha!

For question 2, the static devices part makes sense the way you say it does. If there’s something sunning 24/7, you can emulate it, and take it out from the generic “always on” category. If it’s not 24/7 then the ‘static’ Descriptor wouldn’t apply and a real smart plug/smart switch would be needed since there’s no way of telling on or off. In the example configuration file, would the fan element be something that’s put on a smart switch them emulated through Kasa?

Right - if it’s something with a varying electrical load, and you don’t get a smart home parameter that correlates with that load, Emulated Kasa and/or SenseLink won’t be particularly useful (or at worst, would report inaccurate usage!).

And yep in the example there’s a ceiling fan that works by reporting power value as a function of the speed set by a smart speed control switch. You’d determine the power usage corresponding to each speed, and then define that in the config file.

Oh sweet! Okay! Two more questions and then I think I’m good.

For the switch.ac in the example config, was that written with the intent that the AC is reporting power usage (the ac is smart and conneced with HA), would it just be a smart light switch replacing the dumb switch connected to the AC blower unit in the attic, or (at worst) a calculated value?

What about the UPS? is that assuming a smart ups that’s reporting power to HA or a ‘dumb’ UPS that is added as a static device?

In the switch example, switch.ac is a smart switch that reports the power usage. The value shown in Sense would be the power usage reported by the switch. This only works if the smart switch supports that (which the majority do not)

In the UPS example, sensor.ups_kw is an energy monitoring sensor (no switch/control/on/off). It reports to Sense whatever the sensor reads

1 Like

Post deleted/moved. I realized this is not the best location for my question.

I was in the early stages of writing an app for Hubitat to do just this when I stumbled on this thread. Since I have HA as well I tried this out …

I’m in trouble! I’m sure I’ll be crashing my monitor in no time flat. :heart_eyes:

1 Like

Would be really interested in this if you get it working. I’ve got my dryer on a Aeotec heavy duty smart switch that reports power usage. I’ve considered trying to setup a rPi with a zwave stick added to Hubitat but it’d be pretty cool to do it natively through Hubitat.

@waterboysh Since the HA integration exists I probably wont pursue the Hubitat for now. You mentioned a Raspberry Pi with a Zwave stick… You don’t need to do all that. You just need the Raspberry Pi. You can then pull all your Hubitat devices into HA with this: GitHub - jason0x43/hacs-hubitat: A Hubitat integration for Home Assistant

That will pull in the devices and the sensors needed for energy monitoring. Then you just modify the configuration.yaml like so:

#Emulated Kasa Devices for Sense Monitor
emulated_kasa:
  entities:
    light.hallway_light:
      name: "Hallway Lights"
      power_entity: sensor.hallway_light_power
3 Likes

Sorry to bump an old thread, but I updated Home Assistant last week and I think this integration may have broken. Anyone know anything about it? I can no longer see realtime usage of my Etekcity plugs reporting into Home Assistant or Sense via this integration

Haven’t seen anything about it here: Emulated Kasa - Home Assistant

The recent Home Assistant update seems to have affected lots of integrations. I’m seeing different binary state results from both the Sense and Unifi integrations. Plus the update has forced an update of HACs and the Tesla EV integration.

Thanks. I understand this has nothing to do with Sense and there’s nothing Sense can do about it, just asking around for my curiosity

1 Like

Update: It was a breaking change with Home Assistant and I was able to resolve it by correcting my configuration.

I also use Home Assistant Energy dashboards, which uses C02 Signal to get grid carbon usage (similar to how Sense partnered with Carbonara) and pulls sensor data from Sense. Things were completely wacky and in the negative until about a month ago, but now this is still an issue where usage from12am-1am is not tracked: Sense Integration data points are off by an hour and missing the last point of the day · Issue #66077 · home-assistant/core · GitHub

Again, this has nothing to do with Sense and is not supported by Sense. It’s the way it’s polling for the data through the “unofficial” API and how the timing is. Maybe the community can figure it out somehow. Just posting my update and experience.

2 Likes

Previously the HA integration could use the power attribute of a smart switch - that attribute was removed and replaced with a sensor, so you need to reference the sensor entity instead like

switch.ac:
    power_entity: sensor.ac_power_w
1 Like