Kasa EP25: (sensors, templating, support)

I’m having great difficulty in determining whether the Kasa EP25 plug is fully supported (with energy monitoring). The provisioning of the plugs was awkward, and I can share details if requested. Ultimately, I was able to ‘discover’ the devices in HA with Discovered: TPLINK Smart Plug 123B (Outlet) HomeKit Controller.

With the integration present, I’m able to choose the device and use ‘Controls’ to power on/off. Now I’d like to get the energy monitoring data. The most helpful posts I’ve found are shown below under References:

So I’ve modified my configuration.yml with a few variations on the Template Sensor. What follows below is an example of that, with one of the key exceptions (I’d be happy to provide more detail if helpful).

I have a decent understanding of Python and so I’m assuming the None and NoneType references are because the devices aren’t actually providing data. Please correct me if I’m mistaken.

My questions then are:

  1. Is my template wrong?
  2. Is there some quick means I can check these plugs in HA for the availability of energy data? That is, my trial/error on configuration.yml modifications is really inneficient.
  3. Am I misunderstanding what ‘supported’ means? There’s conflict between the HA
    TP-Link Kasa Smart Integrations Page
    and what’s shown on the python-kasa README. I’ve found numerous posts on this forum and elsewhere recommending and claiming success with these plugs.
sensor:
  - platform: template
    sensors:
      jj_switch_amps:
        friendly_name_template: "{{ state_attr('switch.tplink_smart_plug_58db_outlet','friendly_name') }} Current"
        value_template: "{{ state_attr('switch.tplink_smart_plug_58db_outlet','current_a') | float }}"
        unit_of_measurement: "A"

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 536, in async_render_to_info
    render_info._result = self.async_render(variables, strict=strict, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 422, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: float got invalid input 'None' when rendering template '{{ state_attr('switch.tplink_smart_plug_58db_outlet','current_a') | float }}' but no default was specified
2023-11-18 08:44:11.209 ERROR (MainThread) [homeassistant.helpers.template_entity] TemplateError('ValueError: Template error: float got invalid input 'None' when rendering template '{{ state_attr('switch.tplink_smart_plug_58db_outlet','current_a') | float }}' but no default was specified') while processing template 'Template("{{ state_attr('switch.tplink_smart_plug_58db_outlet','current_a') | float }}")' for attribute '_attr_native_value' in entity 'sensor.jj_switch_amps'
2023-11-18 08:44:11.227 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template("{{ state_attr('switch.tplink_smart_plug_58db_outlet','current_power_w') | float }}")
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1701, in forgiving_float_filter
    return float(value)
TypeError: float() argument must be a string or a real number, not 'NoneType'

References:

To avoid the errors you are seeing you need to either provide a default value for the float filter, provide an availability template, or both.

Thanks for the helpful comment. A simple modification of float to float(1) does avoid exceptions. However, there is no data coming in, my Sensor Card just shows a steady 1.

So still wondering about the other issues I asked about earlier.

image

I had a similar confusion, and I believe this is a limitation of the HomeKit integration with these devices. I ended up using the “native” TP-Link Kasa integration, which requires configuring in HA w/ IP addresses, and it is working as expected.

It’d be great if you could achieve this behavior via the HomeKit integration, which makes the devices discoverable on the local network via MDNS. I wonder if the implementation could be adapted?

I already have a few of the TP-link outlets but picked up a 4 pack of these for the Homekit integration and to not have to rely on the TP-link cloud service.

Has any progress been made on using these with Homekit and getting the energy readings?

I’m unsure the status of homekit but ep25 now near fully functional via the TP-Link Smart Home integration. Be aware the underlying component is python-kasa. More detail here: GitHub - python-kasa/python-kasa: 🏠🤖 Python API for TP-Link smarthome products

…and specificaly re: ep25