That would depend on whether the licence to build or refurbish your house was issued before or after March 2006
(Real Decreto 314/2006, de 17 de marzo, por el que se aprueba el Código Técnico de la Edificación) .
After that date, fire extinguishers on every floor are obligatory. For bigger properties, stretching over 15m wide, more than one.
What is not obligatory however, is to let in representatives from a sales firm, just as with gas men that come knocking on your door. You are the one to decide who you will buy the extinguishers from.
Fire alarm/detector is only obligatatory by law for homes over 50m total building height.
Would like to add that even though not obligatory for all properties by law, having a couple of fire extinguishers and smoke detectors in strategic places would be a very sensible thing to do.
Relevant question re fire extinguishers in apartment buildings: