Yes, you can rent / sublease the property when you are not staying in it, so it can also be a very lucrative investment. However, if you do decide to rent out the property as a short-term/holiday rental, you must first acquire a
Pondok Wisata (rental license).