pyControl4.climate API documentation
Description: Controls Control4 Climate Control devices.

# Module `pyControl4.climate`

Controls Control4 Climate Control devices.

## Classes

`class C4Climate (C4Director, item_id)`
  Expand source code

      class C4Climate(C4Entity):
          # ------------------------
          # HVAC and Fan States
          # ------------------------

          async def getHVACState(self):
              """Returns the current HVAC state (e.g., on/off or active mode)."""
              return await self.director.getItemVariableValue(self.item_id, "HVAC_STATE")

          async def getFANState(self):
              """Returns the current power state of the fan (True=on, False=off)."""
              return await self.director.getItemVariableValue(self.item_id, "FAN_STATE")

          # ------------------------
          # Mode Getters
          # ------------------------

          async def getHVACMode(self):
              """Returns the currently active HVAC mode."""
              return await self.director.getItemVariableValue(self.item_id, "HVAC_MODE")

          async def getHVACModes(self):
              """Returns a list of supported HVAC modes."""
              return await self.director.getItemVariableValue(self.item_id, "HVAC_MODES_LIST")

          async def getFANMode(self):
              """Returns the currently active fan mode."""
              return await self.director.getItemVariableValue(self.item_id, "FAN_MODE")

          async def getFANModes(self):
              """Returns a list of supported fan modes."""
              return await self.director.getItemVariableValue(self.item_id, "FAN_MODES_LIST")

          async def getHoldMode(self):
              """Returns the currently active hold mode."""
              return await self.director.getItemVariableValue(self.item_id, "HOLD_MODE")

          async def getHoldModes(self):
              """Returns a list of supported hold modes."""
              return await self.director.getItemVariableValue(self.item_id, "HOLD_MODES_LIST")

          # ------------------------
          # Setpoint Getters
          # ------------------------

          async def getCoolSetpointF(self):
              """Returns the cooling setpoint temperature in Fahrenheit."""
              return await self.director.getItemVariableValue(self.item_id, "COOL_SETPOINT_F")

          async def getCoolSetpointC(self):
              """Returns the cooling setpoint temperature in Celsius."""
              return await self.director.getItemVariableValue(self.item_id, "COOL_SETPOINT_C")

          async def getHeatSetpointF(self):
              """Returns the heating setpoint temperature in Fahrenheit."""
              return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_F")

          async def getHeatSetpointC(self):
              """Returns the heating setpoint temperature in Celsius."""
              return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_C")

          # ------------------------
          # Sensor Readings
          # ------------------------

          async def getHumidity(self):
              """Returns the current humidity percentage."""
              return await self.director.getItemVariableValue(self.item_id, "HUMIDITY")

          async def getCurrentTemperatureF(self):
              """Returns the current ambient temperature in Fahrenheit."""
              return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_F")

          async def getCurrentTemperatureC(self):
              """Returns the current ambient temperature in Celsius."""
              return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_C")

          # ------------------------
          # Setters / Commands
          # ------------------------

          async def setCoolSetpointF(self, temp):
              """Sets the cooling setpoint temperature in Fahrenheit."""
              await self.director.sendPostRequest(
                  f"/api/v1/items/{self.item_id}/commands",
                  "SET_SETPOINT_COOL",
                  {"FAHRENHEIT": temp},
              )

          async def setCoolSetpointC(self, temp):
              """Sets the cooling setpoint temperature in Celsius."""
              await self.director.sendPostRequest(
                  f"/api/v1/items/{self.item_id}/commands",
                  "SET_SETPOINT_COOL",
                  {"CELSIUS": temp},
              )

          async def setHeatSetpointF(self, temp):
              """Sets the heating setpoint temperature in Fahrenheit."""
              await self.director.sendPostRequest(
                  f"/api/v1/items/{self.item_id}/commands",
                  "SET_SETPOINT_HEAT",
                  {"FAHRENHEIT": temp},
              )

          async def setHeatSetpointC(self, temp):
              """Sets the heating setpoint temperature in Celsius."""
              await self.director.sendPostRequest(
                  f"/api/v1/items/{self.item_id}/commands",
                  "SET_SETPOINT_HEAT",
                  {"CELSIUS": temp},
              )

          async def setHvacMode(self, mode):
              """Sets the HVAC operating mode (e.g., heat, cool, auto)."""
              await self.director.sendPostRequest(
                  f"/api/v1/items/{self.item_id}/commands",
                  "SET_MODE_HVAC",
                  {"MODE": mode},
              )

          async def setFanMode(self, mode):
              """Sets the fan operating mode (e.g., auto, on, circulate)."""
              await self.director.sendPostRequest(
                  f"/api/v1/items/{self.item_id}/commands",
                  "SET_MODE_FAN",
                  {"MODE": mode},
              )

          async def setPreset(self, preset):
              """Applies a predefined climate preset by name."""
              await self.director.sendPostRequest(
                  f"/api/v1/items/{self.item_id}/commands",
                  "SET_PRESET",
                  {"NAME": preset},
              )

          async def setHoldMode(self, mode):
              """Sets the hold mode."""
              await self.director.sendPostRequest(
                  f"/api/v1/items/{self.item_id}/commands",
                  "SET_MODE_HOLD",
                  {"MODE": mode},
              )

  Creates a Control4 object.

  ## Parameters

  `C4Director` - A `C4Director` object that corresponds to the Control4 Director that the device is connected to.

  `item_id` - The Control4 item ID.

  ### Ancestors

  - C4Entity

  ### Methods

  `async def getCoolSetpointC(self)`
    Expand source code

        async def getCoolSetpointC(self):
            """Returns the cooling setpoint temperature in Celsius."""
            return await self.director.getItemVariableValue(self.item_id, "COOL_SETPOINT_C")

    Returns the cooling setpoint temperature in Celsius.

  `async def getCoolSetpointF(self)`
    Expand source code

        async def getCoolSetpointF(self):
            """Returns the cooling setpoint temperature in Fahrenheit."""
            return await self.director.getItemVariableValue(self.item_id, "COOL_SETPOINT_F")

    Returns the cooling setpoint temperature in Fahrenheit.

  `async def getCurrentTemperatureC(self)`
    Expand source code

        async def getCurrentTemperatureC(self):
            """Returns the current ambient temperature in Celsius."""
            return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_C")

    Returns the current ambient temperature in Celsius.

  `async def getCurrentTemperatureF(self)`
    Expand source code

        async def getCurrentTemperatureF(self):
            """Returns the current ambient temperature in Fahrenheit."""
            return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_F")

    Returns the current ambient temperature in Fahrenheit.

  `async def getFANMode(self)`
    Expand source code

        async def getFANMode(self):
            """Returns the currently active fan mode."""
            return await self.director.getItemVariableValue(self.item_id, "FAN_MODE")

    Returns the currently active fan mode.

  `async def getFANModes(self)`
    Expand source code

        async def getFANModes(self):
            """Returns a list of supported fan modes."""
            return await self.director.getItemVariableValue(self.item_id, "FAN_MODES_LIST")

    Returns a list of supported fan modes.

  `async def getFANState(self)`
    Expand source code

        async def getFANState(self):
            """Returns the current power state of the fan (True=on, False=off)."""
            return await self.director.getItemVariableValue(self.item_id, "FAN_STATE")

    Returns the current power state of the fan (True=on, False=off).

  `async def getHVACMode(self)`
    Expand source code

        async def getHVACMode(self):
            """Returns the currently active HVAC mode."""
            return await self.director.getItemVariableValue(self.item_id, "HVAC_MODE")

    Returns the currently active HVAC mode.

  `async def getHVACModes(self)`
    Expand source code

        async def getHVACModes(self):
            """Returns a list of supported HVAC modes."""
            return await self.director.getItemVariableValue(self.item_id, "HVAC_MODES_LIST")

    Returns a list of supported HVAC modes.

  `async def getHVACState(self)`
    Expand source code

        async def getHVACState(self):
            """Returns the current HVAC state (e.g., on/off or active mode)."""
            return await self.director.getItemVariableValue(self.item_id, "HVAC_STATE")

    Returns the current HVAC state (e.g., on/off or active mode).

  `async def getHeatSetpointC(self)`
    Expand source code

        async def getHeatSetpointC(self):
            """Returns the heating setpoint temperature in Celsius."""
            return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_C")

    Returns the heating setpoint temperature in Celsius.

  `async def getHeatSetpointF(self)`
    Expand source code

        async def getHeatSetpointF(self):
            """Returns the heating setpoint temperature in Fahrenheit."""
            return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_F")

    Returns the heating setpoint temperature in Fahrenheit.

  `async def getHoldMode(self)`
    Expand source code

        async def getHoldMode(self):
            """Returns the currently active hold mode."""
            return await self.director.getItemVariableValue(self.item_id, "HOLD_MODE")

    Returns the currently active hold mode.

  `async def getHoldModes(self)`
    Expand source code

        async def getHoldModes(self):
            """Returns a list of supported hold modes."""
            return await self.director.getItemVariableValue(self.item_id, "HOLD_MODES_LIST")

    Returns a list of supported hold modes.

  `async def getHumidity(self)`
    Expand source code

        async def getHumidity(self):
            """Returns the current humidity percentage."""
            return await self.director.getItemVariableValue(self.item_id, "HUMIDITY")

    Returns the current humidity percentage.

  `async def setCoolSetpointC(self, temp)`
    Expand source code

        async def setCoolSetpointC(self, temp):
            """Sets the cooling setpoint temperature in Celsius."""
            await self.director.sendPostRequest(
                f"/api/v1/items/{self.item_id}/commands",
                "SET_SETPOINT_COOL",
                {"CELSIUS": temp},
            )

    Sets the cooling setpoint temperature in Celsius.

  `async def setCoolSetpointF(self, temp)`
    Expand source code

        async def setCoolSetpointF(self, temp):
            """Sets the cooling setpoint temperature in Fahrenheit."""
            await self.director.sendPostRequest(
                f"/api/v1/items/{self.item_id}/commands",
                "SET_SETPOINT_COOL",
                {"FAHRENHEIT": temp},
            )

    Sets the cooling setpoint temperature in Fahrenheit.

  `async def setFanMode(self, mode)`
    Expand source code

        async def setFanMode(self, mode):
            """Sets the fan operating mode (e.g., auto, on, circulate)."""
            await self.director.sendPostRequest(
                f"/api/v1/items/{self.item_id}/commands",
                "SET_MODE_FAN",
                {"MODE": mode},
            )

    Sets the fan operating mode (e.g., auto, on, circulate).

  `async def setHeatSetpointC(self, temp)`
    Expand source code

        async def setHeatSetpointC(self, temp):
            """Sets the heating setpoint temperature in Celsius."""
            await self.director.sendPostRequest(
                f"/api/v1/items/{self.item_id}/commands",
                "SET_SETPOINT_HEAT",
                {"CELSIUS": temp},
            )

    Sets the heating setpoint temperature in Celsius.

  `async def setHeatSetpointF(self, temp)`
    Expand source code

        async def setHeatSetpointF(self, temp):
            """Sets the heating setpoint temperature in Fahrenheit."""
            await self.director.sendPostRequest(
                f"/api/v1/items/{self.item_id}/commands",
                "SET_SETPOINT_HEAT",
                {"FAHRENHEIT": temp},
            )

    Sets the heating setpoint temperature in Fahrenheit.

  `async def setHoldMode(self, mode)`
    Expand source code

        async def setHoldMode(self, mode):
            """Sets the hold mode."""
            await self.director.sendPostRequest(
                f"/api/v1/items/{self.item_id}/commands",
                "SET_MODE_HOLD",
                {"MODE": mode},
            )

    Sets the hold mode.

  `async def setHvacMode(self, mode)`
    Expand source code

        async def setHvacMode(self, mode):
            """Sets the HVAC operating mode (e.g., heat, cool, auto)."""
            await self.director.sendPostRequest(
                f"/api/v1/items/{self.item_id}/commands",
                "SET_MODE_HVAC",
                {"MODE": mode},
            )

    Sets the HVAC operating mode (e.g., heat, cool, auto).

  `async def setPreset(self, preset)`
    Expand source code

        async def setPreset(self, preset):
            """Applies a predefined climate preset by name."""
            await self.director.sendPostRequest(
                f"/api/v1/items/{self.item_id}/commands",
                "SET_PRESET",
                {"NAME": preset},
            )

    Applies a predefined climate preset by name.