Better support for EMS thermostats in iterate()

Better support for EMS thermostats in iterate functions