It's part of measures to slash energy consumption and reduce dependency on Russian gas.
A debate has been sparked after Spain's government moved to prevent offices, shops and other venues from setting air conditioning below 27°C in the summer.
It is part of plans to cut the country's energy consumption and limit dependency on Russian gas.
The decree, published on Tuesday morning, will also stop heating from being raised above 19°C during the winter.
The rules will be mandatory in all public and commercial buildings, including bars, cinemas, theatres, airports and train stations.
It is extended as a recommendation to Spanish households.
“Right now, perhaps suggested by the heat wave we are experiencing, I would say that with 27 degrees we will be very hot," Andrea Castillo, a worker at Castellón university, told Euronews. "Perhaps we could work at 25 degrees, but not at 27.”
Laura Berge, a civil servant in Valencia, questioned the practicality of the measure.
“Generally speaking, you can work at 27 degrees, but to reach that temperature in hot areas, you need to put the air conditioner at 22 or 23 degrees for a couple of hours, so I am worried that it will not be allowed to exceed 27 degrees. at any time,” she told Euronews.
"In that case, the air would have to be turned on well in advance and it would be counterproductive in terms of energy savings."
Berge's colleague, María Isabel Ruiz, agrees.
"I am in favour of saving energy and that this requires sacrifices, but these proposed temperatures are not adequate," she said.
"It would be necessary to indicate a range of 2 or 3 degrees to adapt it to the outside temperatures since in each region of Spain it is different."
The government passed the bill as part of a bid to reduce the country's gas consumption by 7% in line with the recent European Union energy agreements to limit dependency on Russian gas.
"We see that it saves energy and is good for climate change, but our concern is that it affects families, especially the most vulnerable," said Ana Isabel Gracia, secretary of social policies and housing at the Spanish trade union UGT (Unión General de Trabajadores).
“Instead of taking global measures, it should be specified by establishments so that they can have a different temperature. It is not the same to work, for example, in a place where there is a lot of machinery and the temperature is very high, and in another type of environment where there is none of that.
“There are studies that say that the optimal temperature is 24 degrees. Therefore, perhaps, instead of raising it to 27 degrees, we could stay at 25.”
Teresa Ribera, Spain's ecological transition minister, said the measures -- which include switching off store window lights after 10 pm but not street lighting -- would initially be maintained until November 2023.
She encouraged Spaniards to join the cuts, saying it would not only reduce consumption levels but also bring down households' energy bills.