TP Link HS110 turn off after current amp is lower than specific number?

Just got a TP Link HS110 with power monitoring. I want to use it with my e-bike charger to make the charging safer. I want the plug to turn off after the battery is fully charged. And I think I can measure this by checking the current AMP from the TP Link.
But I don’t want it to be switched off if there is a current drop in the AMP.

My thinking is either I can set a timer for maybe 5 hours, and after that do a constant check for the current amp, and if it is lower than 0,1 AMP, turn off the switch.

Is there any alternative, like checking if the current AMP has been 0,1 for a minute, and if true, turn it off?

Tips are welcome!

Hi,

I have first created a template sensor from the hs110 to get the amp & power as single sensor.
I have a tumble dryer connected to it to have notifications when it’s done. In your case you can do something like:

 - platform: template
    sensors:
      sdb_current_power:
        value_template: "{{ states.switch.tplink.attributes.current_power_w }}"
        friendly_name: "Séchoir - Watts"
        unit_of_measurement: "W"
      sdb_current_amp:
        value_template: "{{ states.switch.tplink.attributes.current_a }}"
        friendly_name: "Séchoir - Ampere"
        unit_of_measurement: "a"

and the automation

- id: charging_battery
  alias: "Charging done"
  trigger:
     - platform: numeric_state
       entity_id: sensor.sdb_current_amp
       below: "3"
       for: 
         minutes: 3
  action:
      - service: switch.turn_off
        entity_id: switch.tplink_hs110