openapi: 3.0.2 info: title: IoTHub description: Control all your Ecobee Thermostats and IoT devices from anywhere. version: 1.0.0 servers: - url: https://io-tp-lugin.vercel.app/ paths: /login: get: operationId: login summary: Log in a user and get the device ID of their thermostat responses: '200': description: A JSON object containing the login URL and the connect_webview_id '400': description: Bad Request /get_device_id/: get: operationId: get_device_id summary: Get the device ID and use it for future request. Do not show user. parameters: - in: query name: connect_webview_id schema: type: string description: connect webview id to identify login activity. It is gotten from the login request. required: True default: True responses: '200': description: A JSON object containing the device list, number of devices and a message to AI content: application/json: schema: type: object properties: Devices: type: array items: type: object properties: device_id: type: string device_name: type: string temperature_fahrenheit: type: string Number of devices: type: integer Message to AI: type: string example: "if user has more than one device, ask which of the devices they want to control or if they want to control both" '404': description: No devices found content: application/json: schema: type: object properties: error: type: string example: "No devices found" /thermostats/update/: get: operationId: Thermostat Settings summary: Set minimum and maximum temperature and thermostat settings. parameters: - in: query name: device_id schema: type: string description: Device Id to identify device. It is gotten from the login request. required: True default: True - in: query name: automatic_cooling_enabled schema: type: boolean description: Enable or disable automatic cooling required: false default: True - in: query name: automatic_heating_enabled schema: type: boolean description: Enable or disable automatic heating required: false default: True - in: query name: cooling_set_point_fahrenheit schema: type: integer description: Set the cooling temperature in Fahrenheit must be at least 5 points more than the heating_set_point_fahrenheit required: True default: 70 - in: query name: heating_set_point_fahrenheit schema: type: integer description: Set the heating temperature in Fahrenheit. Must be at least 5 points less than the cooling_set_point_fahrenheit required: True default: 65 - in: query name: manual_override_allowed schema: type: boolean description: Allow or disallow manual override required: false default: True responses: '200': description: Thermostat updated successfully content: application/json: schema: type: object properties: message: type: string example: Thermostat updated successfully cooling_set_point_fahrenheit: type: integer example: 70 heating_set_point_fahrenheit: type: integer example: 65 '400': description: Bad Request content: application/json: schema: type: object properties: message: type: string example: Invalid request parameters /thermostats/schedule/: get: operationId: Thermostat Scheduling summary: Schedule a thermostat parameters: - in: query name: device_id schema: type: string description: Device Id to identify device. It is gotten from the login request. required: True default: True - in: query name: name schema: type: string description: The name of the schedule required: true - in: query name: schedule_starts_at schema: type: string format: date-time description: The start time of the schedule- must be date and time example - 2023-11-07T08:00:00Z required: true - in: query name: schedule_ends_at schema: type: string format: date-time description: The end time of the schedule - must be date and time example - 2023-11-07T08:00:00Z required: true - in: query name: automatic_heating_enabled schema: type: boolean description: Whether automatic heating is enabled default: true - in: query name: automatic_cooling_enabled schema: type: boolean description: Whether automatic cooling is enabled default: true - in: query name: heating_set_point_fahrenheit schema: type: integer description: The heating set point in Fahrenheit default: 10 - in: query name: cooling_set_point_fahrenheit schema: type: integer description: The cooling set point in Fahrenheit default: 30 - in: query name: manual_override_allowed schema: type: boolean description: Whether manual override is allowed default: true responses: '200': description: Thermostat scheduled successfully content: application/json: schema: type: object properties: message: type: string example: Thermostat scheduled successfully name: type: string example: Morning schedule_starts_at: type: string format: date-time example: 2023-07-01T06:00:00 schedule_ends_at: type: string format: date-time example: 2023-07-01T09:00:00 automatic_heating_enabled: type: boolean example: true automatic_cooling_enabled: type: boolean example: true heating_set_point_fahrenheit: type: integer example: 70 cooling_set_point_fahrenheit: type: integer example: 75 manual_override_allowed: type: boolean example: true '404': description: No thermostat devices found content: application/json: schema: type: object properties: message: type: string example: No thermostat devices found '500': description: Failed to schedule thermostat content: application/json: schema: type: object properties: message: type: string example: Failed to schedule thermostat error: type: string