Ok I can give an algorithm, that solves this from any state.
There are 4 corner posts (these are not connected to the center)
and there are 4 side posts ( these are connected to the center)
and there is 1 middle post.
Step 1) Switch all side posts to off.
Step 2) if middle post is on, switch it off and go back to step 1, otherwise go step 3.
Step 3) if all corner posts are on, switch middle and finish, otherwise...
Step 4) Switch all corner posts to on, go back to step 1.
I can't guarantee that this is the fastest way to solve it, but I can guarantee that it work every time. Let me know if this works for anyone.