Added where in getDeviceInfo() for thermostats

Added where in getDeviceInfo() for thermostats.
Renamed $protect_where_map to $where_map