I believe more is involved than merely “removing” target. The example you posted doesn’t use a State Condition and service call correctly (i.e. contains syntax errors). entity_id is the correct option name.
Here is my “finished” blueprint. It’s still a bit rough and ready but it it works.
Ideally it would take the timeout and power shutdown threshold as inputs and turn the socket back on at it’s end time.
blueprint:
name: Auto Power-Off Smart Socket
domain: automation
input:
start_time:
name: "Start Time"
description: "The time from which you would like the switch to be automatically turned off."
selector:
time:
end_time:
name: "End Time"
description: "The time to stop auto shutdown of the switch. Maybe when you plan to turn it on with another automation."
selector:
time:
power_sensor:
name: "Power Sensor"
description: "The power sensor for your energy monitoring smart socket."
selector:
entity:
domain: sensor
device_class: power
power_switch:
name: "Power Switch"
description: "The switch control for your energy monitoring smart socket."
selector:
entity:
domain: switch
trigger:
- platform: numeric_state
entity_id: !input "power_sensor"
for:
hours: 0
minutes: 5
seconds: 0
below: 5
- platform: time
at: !input "start_time"
condition:
- condition: and
conditions:
- condition: time
before: !input "end_time"
after: !input "start_time"
- condition: numeric_state
entity_id: !input "power_sensor"
below: 5
action:
- service: switch.turn_off
entity_id: !input "power_switch"
mode: single