architecture – How can I handle similar tasks to the scripts in my ECS?

So I have been incorporating more and more to the EXS architecture, and I have a bit of difficulty understanding how to handle custom call actions / returns.

For example, let's say I want to have a button concept in my game. A button opens a door. Another button drains the water from the room. Another button opens a door and deactivates all cameras at this level.

With an ECS based on data, I am struggling to discover how this type of diverse and specific behavior could be handled without writing a massive enumeration with a case for each specific action.