Though solar was initially incorrectly blamed for crisis, renewables have helped insulate Spain from gas price rises caused by war in Middle East