Prevent switch from being changed

I want to be able to “lock” a device from being changed by frontend, automation, api, etc. Does this functionality exist? I know I can make a condition in my automations with a binary sensor, but I’d prefer to not have to edit all automations that might tough this device.

Example:
When presence is detected in my bed, I don’t want any automations to be able to turn on the lamps.

No, not that i know.
You need a condition, or an automation that disables the automations that should not be triggered.