Recovering lodging when a home fails
You may be able to, depending on what made the unit unlivable and who was responsible. When a landlord's failure to maintain the property forces you into a hotel or other temporary lodging, the cost of that lodging can sometimes be part of what you recover.
If a serious condition caused by the landlord's neglect — like a sewage backup, a major leak, no heat or water, or a fire from unsafe wiring — makes your home temporarily uninhabitable, and you reasonably have to stay elsewhere, your hotel or temporary housing expenses may be recoverable as damages tied to the landlord's breach.
Keep every receipt for lodging and related costs, and document the condition that drove you out and your reports to the landlord. Reasonable expenses are more likely to be recoverable than extravagant ones.
Renters insurance may also help here, since many policies include coverage for additional living expenses when your home becomes uninhabitable. If a condition the landlord should have prevented forced you into a hotel, a free, confidential review can help you understand whether you can recover those costs and how insurance may fit in.
This is general information about California tenant rights, not legal advice. Every situation is different.