Turn off device after a certain time with little power draw

My PC uses quite some power on Standby, so I wrote this little blueprint to turn it off automatically.

Quite a bit is simply adapted from Refresh Zwave device status after consuming power - workaround FIBARO Roller Shutter 3 position update issue

  name: Turn off device after a certain time with little power draw
  description: This is a blueprint to turn off a smart plug after the power draw has been low for a certain time. It’s useful for devices that draw significant power in standby, like PCs.
  domain: automation
      name: Electric Power Sensor
      description: This sensor used to identify when the target device has been shut off.
          domain: sensor
      name: Power Threshold in Watts
      description: When the device is not used is should draw less power than the power threshold so that the automation kicks in when that action of the device has finished. It should be set above the standby power of the device and below the power when is actively used. For reliability set the value with headroom. For example in the range of 5 Watts more than the constantly used power and 5 Watts less than the power that indicates your device activity. The default value is set to 20 Watts.
      default: 20
      name: Target Smart Plug
      description: This smart plug will be turned off once the treshold is reached for the configured amount of minutes.
          domain: switch
      name: Wait time
      description: Time the plug need to be below the threshold for the automation to trigger
      default: 10
          min: 1
          max: 60
          unit_of_measurement: minutes
  - below: !input power_threshold
    entity_id: !input power_sensor
      minutes: !input off_delay
    platform: numeric_state
condition: []
  - data:
      entity_id: !input smart_plug_switch
    service: switch.turn_off
mode: single

Thanks, this works fine for me. Although I would like the possibility to set time when this automation (bluprint) should be active. For example after 21:00:00 and before 08:00:00

Hi @CWagner

thanks for this nice blueprint.
I’d like to use it to switch off a Sat-IP Server that is connected to a Shelly Plug S and when it is in idle mode for a while.
Looks like that I could use your blueprint for such automation perfectly, however, could you please add some “Action”?

I’d like to send a (Telegram) notification once the automation has actually switched off the device, so I’d need to add an Action “Call Service”.

Many thanks in advance