City law trumps HOA, Country trumps city, state trumps county and so on. My HOA says says no solar panels. My city says Yes on solar panels. I have a solar system heating my greenhouse even though my HOA says no solar panels. I am the VP of my HOA. No, no special benefits but I did do my research.
The only hiccup is that the solar panels can not be offensive to others. If you are standing 3 houses down hill, you can see my panels but no one has had a problem with them.
Daisy