Put it all together

Have you taken a look at ESPEasy or Tasmota which you would flash on the esp8266 (do you have a WeMos D1 mini? Can't tell from your first post)

They have interfaces to talk/control other devices.

Back in 2018, I added a thread to the Share Your Projects section of the forum called Coffee Pot Timer where I flashed a SonOff S20 switch with ESPEay and created a flow. So from the node-red dashboard you can turn the pot on/off and if you turn it on, after 20 minutes, it will shut itself off. You can also turn it on/off using the button on the SonOff itself. I made it because I kept forgetting to shut the pot off and when I came back it had burnt the remaining coffee in the pot and I'd have to wash it out befor cleaning it.

You could take a look at the project to see how I did it.