all sorts of home automation options are available to you if the 'away timer' is just an excuse to play with your pi.
you can wire everything up to your pi, but the advice above regarding mains power should be taken seriously
the route i took involves using off the shelf smart sockets and reprogramming them to replace the manufacturers firmware which generally requires a phone app that need permission to do everything just to talk to the socket..
while i do have to open most devices and solder connecting pins or wires to the pcb i do this without them plugged into the mains power.. (some can be rewritten OTA)
My Pi is used to host the communications system (Mqtt Broker) and the software i use to set up automatic responses and provide a gui interface Node Red
rather than code my own firmware to replace the stock systems i use tasmota a very full featured firmware aimed squarely at smart devices.. https://github.com/arendst/Sonoff-Tasmota/wiki
this gives me the ability to include input from any device my pi can talk to via wifi, bluetooth or physically connected via usb or gpio to determine what gets turned on and off automatically.
Other home automation systems you can use on your pi include domotitcz, and Home Assistant each with their own large friendly support communities