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:
- Is my template wrong?
- 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. - 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: