Can the temperature setpoint of a thermostat be "read"?

I'm trying to "read" the setpoint of a Virtual Thermostat (which will become a physical thermostat once things are sorted out)

I'm tried a number of permeations in the code, my latest one is shown. Each time the Thermostat Object's "thermostatSetpoint" returns NULL.
Perhaps this cannot be read?

  Test Thermostat Object

    name: "TEST Thermostat Object",
    namespace: "hubitat", author: "JohnRob",
    description: "TEST Custom Control for A/C in multilevel Home",
    category: "Ctrl function", iconUrl: "", iconX2Url: "")
preferences {
	page(name: "mainPage")

def mainPage() {
	dynamicPage(name: "mainPage", title: " ", install: true, uninstall: true) {
		section {
            input "tempSensor", "capability.temperatureMeasurement", title: "Select Temperature Sensors", submitOnChange: true, required: true, multiple: false 			
			input "thermostatObject", "capability.thermostat", title: "Select Thermostat to Ctrl", submitOnChange: true, required: true, multiple: false

def installed() {

def updated() {

def initialize() {
	subscribe(tempSensor, "temperature", tempHandler)
	subscribe(thermostatObject, "thermostatSetpoint", currentSetPtHandler)

def tempHandler(evt) {
	tstatSetpoint = thermostatObject.thermostatSetpoint
    log.debug "64 tempHandler() called: ${} ${evt.value} ${tstatSetpoint} "  // <<<<<<< tstatSetpoint returns null.
// --- eof ---

You need to use one of these instead. Attributes (in the Hubitat sense) on a device are not properties on the actual object:


or the shortcut equivalent:


1 Like

Download the Hubitat app