If we want to be gone most of the day, we put our pups in "day care". Most towns have some kind of daily boarding businesses. For example, we're planning on spending most of the day on 8/21 going to the solar eclipse. There is a small veterinary clinic with a pet boarding business on site right along our route. $30 to board two dogs for the whole day, and we don't have to worry about them.
If we're just going to be gone for a few hours, we'll leave them in the RV with the AC running. We also leave the blinds closed. If they can't see out, they are much less likely to bark at people passing by.