Set Occupied
The set occupied function may only be used by EMS thermostats. The function switches a thermostat from occupied mode to unoccupied, or vice versa. If used on a Smart thermostat, the function will throw an error. Switch occupancy events are treated as Holds. There may only be one Switch Occupancy at one time, and the new event will replace any previous event.
Note that an occupancy event is created regardless what the program on the thermostat is set to. For example, if the program is currently unoccupied and you set occupied=false, an occupancy event will be created using the heat/cool settings of the unoccupied program climate. If your intent is to go back to the program and remove the occupancy event, use resumeProgram instead.
Hold Types
Hold Type | Description |
---|---|
dateTime | Use the provided startDate, startTime, endDate and endTime for the event. If start date/time is not provided, it will be assumed to be right now. End date/time is required. |
nextTransition | The end date/time will be set to the next climate transition in the program. |
indefinite | The hold will not end and require to be cancelled explicitly. |
holdHours | Use the value in the "holdHours" parameter to set the end date/time for the event. |
Parameters
Name | Type | Required | Description |
---|---|---|---|
occupied | Boolean | yes | The climate to use for the temperature, occupied (true) or unoccupied (false). |
startDate | String | no | The start date in thermostat time. |
startTime | String | no | The start time in thermostat time. |
endDate | String | no | The end date in thermostat time. |
endTime | String | no | The end time in thermostat time. |
holdType | Enum | no | The hold duration type. Valid values: dateTime, nextTransition, indefinite, holdHours. |
holdHours | Integer | no | The number of hours to hold for, used and required if holdType='holdHours'. |
All other properties of the Event are available to be written with the exception of Event.linkRef and Event.type.