In 2015 the Spanish government implemented RD 900/2015, which includes the "SUN TAX". It consists of a toll for using the main grid.
Nowadays, in 2019, Spanish government implented the RD-L 244/2019 in order to be in line with the rest of European countries.
In the new RD (2019), there are some key changes, such as the removing of the "sun tax". The use of solar energy is totally legal and free. Furthermore, the administrative procedures have been simplified.
Solar energy is now more accessible.