This procedure will allow you to automatically turn off a plug that “you” turned on randomly or manually..
Create a new automation > select “An accessory is controlled”
select the SmartPlug > Next > Turns On > Convert to Shortcut
Tap on the “Scenes and Accessories” and select the SmartPlug again > Next >
ensure it is set to off >Done
In the field “Search for apps and actions” type “wait”
Tap on the Wait control to import it in the shortcut window.
Tap and hold the Wait Control to slide it above the “Set” Control
Change the values of the desired seconds > Done
Restart your iPad before testing the automation. My smartplug acted erratically until I restarted the iPad and the word “updating” appeared on the icon of my device in the Home app.
I am now able to turn off any plug in 2 hrs (7200 seconds) after I turn the plug on,
Regards