I am not sure how to go about this, with either a script or an automation.
I have a fan heater plugged into a Wemo Switch that I can turn on via HA or Google Home.
However yesterday somehow it turned on and stayed on for hours (probably Google Home misuderstanding a command again).
So what I would like to do is If the Wemo Switch is turned on for it to turn off after a period of time (say 30 mins).
Could anyone help me with designing this automation please?