Mdk
1
A simple blueprint to automatically turn off a smart plug after a certain amount of time, useful for Christmas trees or the alikes
Requires any sort of smart plug under the switch
domain (works with any switch really)
Edit: fixed the delay from seconds to minutes
blueprint:
name: Timed Smart Plugs
description: Turn off smart plugs after a certain amount of time
domain: automation
input:
smart_plug:
name: Smart Plug
selector:
entity:
domain: switch
off_delay:
name: Wait time
description: Time to leave the plug on
default: 30
selector:
number:
min: 1
max: 1440
unit_of_measurement: minutes
mode: restart
max_exceeded: silent
trigger:
platform: state
from: "off"
to: "on"
entity_id: !input smart_plug
action:
- delay:
minutes: !input off_delay
- service: switch.turn_off
entity_id: !input smart_plug
4 Likes
Hedda
(Hedda)
2
Thanks!
FYI, I have used a similar âsmart appâ called âSmart Lightingâ for Samsung SmartThings Classic.
This same automation is still available as âSmart Lights Automationâ in SmartApps marketplace:
Got a few tips on ideas on what to use it for as I have personally primarly used it with a smart plug for:
- Coffee Machine (to always turn off after 60-minutes after turning on).
- Electric Kettle (to always turn off after 60-minutes after turning on).
- Cars engine heater / car pre-heater (to always turn off after 180-minutes after turning on).
- Bathroom fan to activate extra boost when showering (turn off after 10-minutes after turning on).
I believe that the ST action called in âSmart Lights Automationâ app is now called âPower Allowanceâ.
Hello, I tried to add your blueprint but got an error instead:
Logger: homeassistant.components.automation
Source: components/automation/init.py:517
Integration: Automation (documentation, issues)
First occurred: 15:36:43 (1 occurrences)
Last logged: 15:36:43
Blueprint Timed Smart Plugs generated invalid automation with inputs OrderedDict([(âoff_delayâ, â240â), (âsmart_plugâ, âswitch.065834582462ab43a2c4â)]): extra keys not allowed @ data[âactionâ][0][âminutesâ]. Got None
Mdk
4
Messed up the indentation, now itâs fixed
Thanks for the heads up
1 Like
Tntdruid
(Christian)
5
Any way to make it do 1 min 30 sec? need it for my coffee grinder