> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nox.energy/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch Devices Settings

> Update on a device or nox user level the device/user settings. If you want to update a setting on a device level, only the device_id needs to be provided.
Any of the settings can be updated separately or together.


 You can change the following settings:

 * The lower and upper room comfort temperature bounds of
 end users/devices in degrees celcius.

 * The lower and upper bounds for domestic hot water heating in degrees celcius.
This will determine the maximum and minimum allowed temperatures we allow it to go.
 This should be changed carefully as it could lead to the tank temperature going too low and cause legionella growth.
 Below 40 degrees is not recommended, only during vacations.

 * The preferred temperature of end users/devices in degrees celcius.
This is also used to determine when to start cooling in temperature_control_mode auto or cooling mode.

 * Temperature control mode to determine if you only want heating or
 cooling or both (auto) or none of both (off). If `auto` is chosen,
 our system will decide if cooling is necessary based on outside temperature
 and upper comfort bounds. `Off` means we will turn room heating and cooling off and
 if this is not possible, we will configure the heat pump in a way so it will not cool or heat.
 If `heating` is chosen we will only heat and it will be based on the preferred temperature or the schedule and the comfort bounds.
 If `cooling` is chosen, we will only cool and it will be based on the preferred temperature or the schedule, outside temperature and the comfort bounds.

 * Enable/Disable steering optimizations. Flex_trading is mutually exclussive with the other optimizations. The other optimizations can be enabled together.
 If `flex_trading` is enabled, we disable all other optimizations.
 If any other optimization is enabled, we disable `flex_trading`.
 `flex_trading` means that the supplier steers the device based on a schedule they provide to NOX Energy.
 If you are a supplier that has a full-control package integration with Nox Energy, you should not enable `flex_trading` 
 but instead the other optimization options like:
 `imbalance_optimization` to optimize the device to minimize imbalances based on the imbalance prices of the users country.
 `dynamic_tariff` means that we will optimize the device based on the day-ahead market prices of the users country.
 `pv_self_consumption` to optimize the device to maximize self-consumption of pv production for users that have pv panels.`

 * The country code and the postal code



## OpenAPI

````yaml /api-docs/manufacturer/openapi-manufacturer.json patch /v1/devices/settings
openapi: 3.1.0
info:
  title: NOX Energy API - Manufacturer
  description: >
    # Manufacturer API Documentation


    This documentation shows only the endpoints available to manufacturer users.


    ## Authentication


    1. Get your API key from [NOX Energy](mailto:support@nox.energy).

    2. Include the API key in your API calls with the header: `x-api-key:
    YOUR_API_KEY`.


    ## Access Level


    This documentation is specifically for **manufacturer users** who have
    access to these endpoints.


    Base URL: [https://api.nox.energy](https://api.nox.energy)
  version: 1.0.0
servers:
  - url: https://api.nox.energy
    description: Production Server
security:
  - ApiKeyAuth: []
tags:
  - name: Asset Info
    description: API to get basic information about your assets.
  - name: Manufacturer Control
    description: API for manufacturer control specific endpoints.
  - name: User Management
    description: API endpoints to manage users and their data.
paths:
  /v1/devices/settings:
    patch:
      tags:
        - User Management
      summary: Patch Devices Settings
      description: >-
        Update on a device or nox user level the device/user settings. If you
        want to update a setting on a device level, only the device_id needs to
        be provided.

        Any of the settings can be updated separately or together.


         You can change the following settings:

         * The lower and upper room comfort temperature bounds of
         end users/devices in degrees celcius.

         * The lower and upper bounds for domestic hot water heating in degrees celcius.
        This will determine the maximum and minimum allowed temperatures we
        allow it to go.
         This should be changed carefully as it could lead to the tank temperature going too low and cause legionella growth.
         Below 40 degrees is not recommended, only during vacations.

         * The preferred temperature of end users/devices in degrees celcius.
        This is also used to determine when to start cooling in
        temperature_control_mode auto or cooling mode.

         * Temperature control mode to determine if you only want heating or
         cooling or both (auto) or none of both (off). If `auto` is chosen,
         our system will decide if cooling is necessary based on outside temperature
         and upper comfort bounds. `Off` means we will turn room heating and cooling off and
         if this is not possible, we will configure the heat pump in a way so it will not cool or heat.
         If `heating` is chosen we will only heat and it will be based on the preferred temperature or the schedule and the comfort bounds.
         If `cooling` is chosen, we will only cool and it will be based on the preferred temperature or the schedule, outside temperature and the comfort bounds.

         * Enable/Disable steering optimizations. Flex_trading is mutually exclussive with the other optimizations. The other optimizations can be enabled together.
         If `flex_trading` is enabled, we disable all other optimizations.
         If any other optimization is enabled, we disable `flex_trading`.
         `flex_trading` means that the supplier steers the device based on a schedule they provide to NOX Energy.
         If you are a supplier that has a full-control package integration with Nox Energy, you should not enable `flex_trading` 
         but instead the other optimization options like:
         `imbalance_optimization` to optimize the device to minimize imbalances based on the imbalance prices of the users country.
         `dynamic_tariff` means that we will optimize the device based on the day-ahead market prices of the users country.
         `pv_self_consumption` to optimize the device to maximize self-consumption of pv production for users that have pv panels.`

         * The country code and the postal code
      operationId: patch_devices_settings_v1_devices_settings_patch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DevicesSettingsRequest'
            examples:
              full_configuration:
                summary: Complete settings configuration
                description: Example with all available settings configured
                value:
                  user_id: user456
                  device_id: device123
                  room:
                    temperature_lower_bound: 1.5
                    temperature_upper_bound: 2
                    preferred_temperature: 21
                    schedule_enabled: true
                    temperature_control_mode: auto
                  dhw:
                    temperature_lower_bound: 45
                    temperature_upper_bound: 60
                  optimization_settings:
                    pv_self_consumption: false
                    dynamic_tariff: false
                    flex_trading: true
                    imbalance_optimization: false
                  location:
                    country: NL
                    postal_code: 1234AB
              room_only:
                summary: Room settings only
                description: Simple example with just room temperature preferences
                value:
                  user_id: user456
                  device_id: device123
                  room:
                    temperature_lower_bound: 1.5
                    temperature_upper_bound: 2
                    preferred_temperature: 21
                    schedule_enabled: false
                    temperature_control_mode: auto
              dhw_only:
                summary: Domestic Hot Water settings only
                description: Example for updating only domestic hot water settings
                value:
                  user_id: user789
                  dhw:
                    temperature_lower_bound: 50
                    temperature_upper_bound: 65
              device_id_only:
                summary: Only a device_id without user_id provided
                description: Example for updating with only using a device_id
                value:
                  device_id: device_789
                  dhw:
                    temperature_lower_bound: 50
                    temperature_upper_bound: 65
              steering_control:
                summary: Steering control settings
                description: Example for enabling/disabling device steering
                value:
                  user_id: user101
                  device_id: device789
                  optimization_settings:
                    pv_self_consumption: true
                    dynamic_tariff: true
                    flex_trading: false
                    imbalance_optimization: true
              schedule_mode:
                summary: Room schedule-based control
                description: Example for devices using schedule-based temperature control
                value:
                  user_id: user202
                  device_id: device456
                  room:
                    schedule_enabled: true
                    temperature_control_mode: heating
      responses:
        '204':
          description: No Content - Settings updated successfully
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    DevicesSettingsRequest:
      properties:
        device_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Device Id
          description: Device ID to update settings for
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: User ID to update settings for
        room:
          anyOf:
            - $ref: '#/components/schemas/RoomSettings'
            - type: 'null'
          description: Room temperature control settings
        dhw:
          anyOf:
            - $ref: '#/components/schemas/DHWSettings'
            - type: 'null'
          description: Domestic hot water settings
        optimization_settings:
          anyOf:
            - $ref: >-
                #/components/schemas/app__models__hp__settings_model__OptimizationSettings
            - type: 'null'
          description: >-
            Optimization settings for flex trading, dynamic tariff and PV
            self-consumption
        location:
          anyOf:
            - $ref: '#/components/schemas/LocationSettings'
            - type: 'null'
          description: Location-related settings
      additionalProperties: false
      type: object
      title: DevicesSettingsRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RoomSettings:
      properties:
        temperature_lower_bound:
          anyOf:
            - anyOf:
                - type: number
                - type: integer
              ge: 0
              le: 10
            - type: 'null'
          title: Temperature Lower Bound
          description: Lower temperature bound in Celsius
        temperature_upper_bound:
          anyOf:
            - anyOf:
                - type: number
                - type: integer
              ge: 0
              le: 10
            - type: 'null'
          title: Temperature Upper Bound
          description: Upper temperature bound in Celsius
        preferred_temperature:
          anyOf:
            - anyOf:
                - type: number
                - type: integer
              ge: 0
              le: 30
            - type: 'null'
          title: Preferred Temperature
          description: Preferred room temperature in Celsius
        schedule_enabled:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Schedule Enabled
          description: >-
            If `True`, follow the schedule of the manufacturer settings within
            their app. If `False`, ignore the schedule and follow the prefered
            temperature or the auto detected preferred temperature.
        temperature_control_mode:
          anyOf:
            - $ref: '#/components/schemas/TemperatureControlMode'
            - type: 'null'
          description: >-
            Temperature control mode to determine if you only want heating or
            cooling or both (auto) or none of both (off). If auto is chosen, our
            system will decide if cooling is necessary based on outside
            temperature and upper comfort bounds.
      type: object
      title: RoomSettings
    DHWSettings:
      properties:
        temperature_lower_bound:
          anyOf:
            - anyOf:
                - type: number
                - type: integer
              ge: 30
              le: 80
            - type: 'null'
          title: Temperature Lower Bound
          description: Lower DHW temperature bound in Celsius
        temperature_upper_bound:
          anyOf:
            - anyOf:
                - type: number
                - type: integer
              ge: 30
              le: 80
            - type: 'null'
          title: Temperature Upper Bound
          description: Upper DHW temperature bound in Celsius
      type: object
      title: DHWSettings
    app__models__hp__settings_model__OptimizationSettings:
      properties:
        pv_self_consumption:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Pv Self Consumption
          description: Enable/disable PV self-consumption optimization
        dynamic_tariff:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Dynamic Tariff
          description: Enable/disable dynamic tariff optimization
        flex_trading:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Flex Trading
          description: >-
            Enable/disable supplier flex trading optimization. If `True`, the
            supplier steers the device based on a schedule they provide to NOX
            Energy.
        imbalance_optimization:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Imbalance Optimization
          description: >-
            Enable/disable imbalance optimization. If `True`, the device will be
            optimized to minimize imbalances based on the imbalance prices of
            the users country. This setting should only be enabled/disabled
            internally in the backend of suppliers as only integrated users of a
            full-control package will have benefit out of it.
      type: object
      title: OptimizationSettings
    LocationSettings:
      properties:
        country:
          type: string
          maxLength: 2
          title: Country
          description: ISO country code
        postal_code:
          anyOf:
            - type: string
              maxLength: 18
            - type: 'null'
          title: Postal Code
          description: Postal code for the device location
      type: object
      required:
        - country
      title: LocationSettings
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    TemperatureControlMode:
      type: string
      enum:
        - heating
        - cooling
        - auto
        - 'off'
      title: TemperatureControlMode
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: 'API Key authentication. Enter your API key in the format: YOUR_API_KEY'

````