Oh, what a great question! 🏨 Look, I've been to Madrid a couple of times and honestly finding something decent at that price in the center is a bit tricky, but it's not impossible. I'd recommend looking for small hotels or hostels with private rooms in neighborhoods like Malasaña or Chueca, which are super well connected by metro and have way more vibe than the touristy center. I've seen some options around there going for 70-85 euros a night, and honestly some are pretty decent. There's also La Latina, which is beautiful and has metro stations nearby.
What I'd say is that when you search, specifically filter by "near metro" and read the comments from other users carefully about the location, because sometimes they say it's 5 minutes away and it turns out to be 15 walking 😅 Also, in August it's crazy hot in Madrid, so make sure the hotel has decent air conditioning (this is more important than it sounds, trust me). And here's a tip: if you have flexible dates, try to avoid weekends if possible, because prices skyrocket.
Oh, and while I'm at it: if you get bored while waiting for your turn at the ambulance, you could book from your phone and use the time to water your plants 😂 Hope you find something good for your trip! Madrid in August is absolutely scorching but it's worth exploring.