First Operand in an "input" statement, what is it?

When working with an app I'm trying to write, I stated to focus on the objects vs variables.
It made me consider what the first entry in an input statement was. It appears to have no other function than to identify the device to subscribe to.
I guess in the long run it doesn't really matter but I'm curious to know what it is. Like is it an object? If so what prosperities might it have that could be useful?

The entry I'm referring to; in the below code the entry is "tstatSet"


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

def installed() {

def updated() {

def initialize() {
	subscribe(tstatSet, "thermostatSetpoint", currentSetPtHandler)

The first parameter is the name of the object to be created by the input. In the code you posted, "tstatSet" will be the name of the thermostat selected, and that name will be available throughout the app. For "" inputs like this, the created object is called a 'device wrapper', giving the app access to the selected device and all of its attributes and commands.

You could do things such as


which would send the setCoolingSetpoint command to the device.


if(tstatSet.currentTemperature < 75) .....

which tests the current value of the selected thermostat's temperature attribute.


Thank you very much for the Groovy lesson :slight_smile: