How do you turn on your iPhone’s sleep mode via Home Assistant?

I’m referring to the feature that prevents you from hearing notifications.

you can do it with a notification command. docs are here

actually you can only do it with android… unless there’s another way sorry

Maybe I have to ask in the Jailbreaking community.

If you’ve got an always-on MacOS device you can do it, although it’s arguably a bit clunky. See here for how I do it, but the post has other options too.