Emulated Kasa Home Assistant Issue?

Is anyone using the Emulated Kasa Home Assistant plugin? I’ve been using it for years to trick Sense into thinking my Etekcity smart plugs are Kasa plugs.

There is some strange behavior as of late and I cannot tell what is going on. I updated Home Assistant today from 2025.2.4 → 2025.3.4, but there are a few weird behaviors that make me think this was an issue before and I just never noticed (I was away for a little bit too).

Here is my config:

emulated_kasa:
  entities:
    switch.etekcity_plug_1:
      name: "Living Room Strip"
      power_entity: sensor.etekcity_plug_1_current_power
    switch.etekcity_plug_2:
      name: "Office Strip"
      power_entity: sensor.etekcity_plug_2_current_power
    switch.etekcity_plug_3:
      name: "Wine Fridge"
      power_entity: sensor.etekcity_plug_3_current_power
    switch.etekcity_plug_4:
      name: "Basement Strip"
      power_entity: sensor.etekcity_plug_4_current_power
    switch.etekcity_plug_5:
      name: "Christmas Tree"
      power_entity: sensor.etekcity_plug_5_current_power
    switch.etekcity_plug_6:
      name: "Fish Tank"
      power_entity: sensor.etekcity_plug_6_current_power
    switch.holiday_front:
      name: "Holiday (Front)"
      power_entity: sensor.holiday_front_current_power
    switch.holiday_north:
      name: "Holiday (North)"
      power_entity: sensor.holiday_north_current_power
    switch.holiday_south:
      name: "Holiday (South)"
      power_entity: sensor.holiday_south_current_power

The first odd thing I noticed is that Sense thinks I have 14 Kasa devices when clearly there are only 9 in my configuration (only 3 are plugged in at the moment - the holiday ones are put away for the season):

I am seeing duplicated “Kasa” devices in the Sense device list:

Additionally, for my Fish Tank, it is reporting but the history is gone. I only have history until 3/19, and I did not upgrade HA then:

One of my other devices is not reporting at all and has no duplicate. Plus, sense Sent a notification to my timeline saying it found a new Kasa device today when I never set anything up. The devices are reporting power correctly to HA so I think something changed on the Sense integration side.

So something really weird happened and it may be a bug in the HA update or the Kasa Emulation plugin, but not sure even where to start troubleshooting.

This may be the wrong thing to do, but I am going to disable the Kasa integration in sense, Remove Kasa emulation and configure it all over again. I have nothing to lose - my history has already been ruined. UPDATE: After removing this integration and adding it back, I can confirm it thinks I have 14 devices and there are duplicates in the device list, so something is wrong with it.

Can anyone else confirm odd behavior?

In Home Assistant, did some (or all) of the device IDs in the Etekcity plugs change as a result of the refactoring?

It’s not using the Vesync integration… It’s emulated Kasa. What was refactored? In sense, the duplicates are showing as different Device IDs but I do not remember when they started showing as duplicated.

I understand you are using the Emulated Kasa integration to get the data out of Home Assistant. However, what are you using to get the data into Home Assistant? You said “Etekcity smart plugs” so I assumed that you were using the Vesync integration. Is there another integration that supports Etekcity?

The Vesync integration was majorly refactored, which may have resulted in device IDs changing, which could affect how the devices were presented to the Emulated Kasa integration.

1 Like

Ah yes. The Vesync plugin is the one that collects data from the Etekcity plugs. But from what I can tell, those are still reporting the same way into HA and the names stayed the same. The emulated kasa config is still referencing the plug entities by the correct names and I verified those are sending the same data as before. In theory, it shouldn’t matter if the Vesync devices were duplicated as long as the emulated kasa plugin config is the same

Theory and practice are often different. :slight_smile:

In my experience, changing the device IDs can cause these to show up as new devices with the Kasa integration. Given that the Vesync integration has just been completely refactored with 2025.3, this seems a reasonable possibility to explore.

YMMV.

So the next question would be to maintainer of emulated Kasa (I’ll have to dig - I know they’re probably not on this forum) or Sense:

How come if I completely removed the integration and deleted the emulated Kasa config, and verified that Sense deleted those devices, when I set the integration up again, the devices were reintroduced and still duplicated the same way?

I don’t think so. Assuming your device IDs changed, I think this would be a question for the maintainer of Vesync rather than the maintainer of Emulated Kasa. The Vesync is the integration that underwent the recent (massive) refactoring. The Emulated Kasa is very simple, and hasn’t changed in around five years.

Regardless of why, you are probably stuck and have to start over, or revert to a prior backup of your Home Assistant install and database. :frowning:

1 Like

It is the MAC address, not the name, that Sense uses to identify a Kasa device. The MAC address for an Emulated Kasa device is derived from the unique device ID in Home Assistant. If the Home Assistant device ID changes, the MAC address changes, and Sense sees a new unique device. No way around that.

I also found an issue filed with Emulated Kasa that discusses the very circumstance you are in:

2 Likes

Thanks for finding that reference

I ended up reverting HA to 2025.2.4 from a backup. I’m still seeing the duplicate devices, but it looks like there’s a set of steps to resolve that in that Github discussion which I didn’t get a chance to yet

Additionally, only one of my plugs stopped collecting data - and it was the first one I ever bought. HA was receiving the current_power metric from it after the 2025.3.x update, but the switch on/off toggle was not making it into HA. This makes complete sense, since that one plug has some weird version of firmware different from the others, so I’m assuming that the pyvesync lib refactors inadvertently broke the switch power toggle for that switch only. I will try to fix the duplicate issue and then see if I can work with maintainers of pyvesync to get that oddballl firmware plug working, and then wait for it to make it into HA before upgrading again.

I also work in software. These kinds of breakages happen all. the. time.