How do I switch off/shutdown an iPhone with a broken power button? The title says it all. I have an iPhone 7 with a broken power switch. Just now I needed to switch off my iPhone, but realised I can't because the switch is no good. I did ask Siri to do it for me, but she said sorry she can't do that. 

Is there another way?
Assuming you're on iOS 11: the easiest way is to go to Settings > General. Swipe up until you see the Shut Down option at bottom.Tapping on Shut Down will mimic using the power button.

If you're not on iOS 11: then you can use Assistive Touch: go to Settings > General > Accessibility and switch on Assistive Touch. Now you'll see a bubble appear on the screen. You can move this around, but most importantly you can tap on it and select Device and then select Lock Screen. Doing this will give you the option to switch off your iPhone. (Note: You can do this with iOS 11 as well).

Switching it back on

To switch it back on you will have to connect your iPhone to your Mac/PC or to a charger with the Lightning cable. After a while it will power up and you'll be able to unlock it.