This is something we have all experienced. We enter a room, often a bathroom. We automatically move our hand to the light button. Instead of turning on the lights, we actually turn them off, since they were already on. The action was automatic and the light button did not prevent our error. This is something that’s annoying people all over the world.*
The problem here is that our mental action is not “turn-on-light” but rather “toggle-light”. We have the same mental action for both leaving and entering the room. This is probably very efficient brain-vise or something, else we would not do this, so lets assume it’s good in some way. This kind of behavior is common for daily tasks: the fact that I always toggle the music on my computer when I start a video (which results in music AND video playing if I wasn’t listening to any music at the time) falls into this category as well. And most of these errors are very small and fairly irrelevant. But when the error grows, so does the importance of the problem.
In this case we could solve the problem by changing the light functionality from a toggle to two different actions. A light button with double-tap functionality to turn off the light would prevent us from turning of the light when we enter and the room is dark, for instance. In the rooms which use motion sensors, this is even further simplified with one automatic action for turning on the light and no possible way of making the toggle error (being unable to turn off the light is an entirely different problem).
As I said, these are minor annoyances only. But the same principles applies to more important situations, and in those cases it is crucial to create a usability flow that helps us avoid errors. The high beam headlamps of your car could serve as an example: if you encounter a car, you toggle to turn these off. If they were already off, but you did not not reflect over that, you would dazzle the approaching driver and could potentially cause a traffic accident. And there is a reason safety mechanisms on guns don’t use a toggle button.
It is simple: If you design something that causes big problems when toggle states are accidentally triggered in the wrong direction, please don’t integrate simple two-way toggle functionality.
*Well, except the parts where they don’t have electricity.