Problem with TPLINK HS110 config

Hi HA community,

I’ve been struggling with this for a while now. Im wondering if this is how it is supposed to look or its a simple misconfigure on my end.

I have a HS110 to switch on the washing machine and measure energy. I want to be able to when the machine finishes (i.e, low power draw) send a notification to mobile.

My problem is i end up with a sensor with the name:
“<template TemplateState(<state switch.washing_machine_gpo=on; current_power_w=2275.23, total_energy_kwh=1.324, voltage=239.3, current_a=9.52, today_energy_kwh=1.325, friendly_name=Wa”

which is not really friendly.

my current config code is:

  - platform: template
    sensors:
      washing_machine_gpo_amps:
        friendly_name_template: "{{ states.switch.washing_machine_gpo}} Current"
        value_template: '{{states.switch.washing_machine_gpo.attributes["current_a"] | float}}'
        unit_of_measurement: "A"
      washing_machine_gpo_watts:
        friendly_name_template: "{{ states.switch.washing_machine_gpo}} Current Consumption"
        value_template: '{{states.switch.washing_machine_gpo.attributes["current_power_w"] | float}}'
        unit_of_measurement: "W"
      washing_machine_gpo_total_kwh:
        friendly_name_template: "{{ states.switch.washing_machine_gpo}} Total Consumption"
        value_template: '{{states.switch.washing_machine_gpo.attributes["total_energy_kwh"] | float}}'
        unit_of_measurement: "kWh"
      washing_machine_gpo_volts:
        friendly_name_template: "{{ states.switch.washing_machine_gpo}} Voltage"
        value_template: '{{states.switch.washing_machine_gpo.attributes["voltage"] | float}}'
        unit_of_measurement: "V"
      washing_machine_gpo_today_kwh:
        friendly_name_template: "{{ states.switch.washing_machine_gpo}} Today's Consumption"
        value_template: '{{states.switch.washing_machine_gpo.attributes["today_energy_kwh"] | float}}'
        unit_of_measurement: "kWh"

Can anyone see any obvious errors for the strange sensor name or is this how it is supposed to be.

Appreciate your help.

OK, please disregard.
I see there was a change in the code template form states to state_attr (https://www.home-assistant.io/integrations/tplink/)

Solved the problem. Pays to loop back to the integration pages.

Thanks all.