Power API

From Deep Sky Chile

Deep Sky Chile Power API User Manual[edit]

The Deep Sky Chile Power API provides real-time information about the status of the power systems at the observatories, including details on battery, solar power, and associated parameters. This API allows users to query various power metrics such as battery charge, power consumption, voltage, current, and solar production.

Base URL[edit]

The base URL for accessing the API is: http://api.deepskychile.com/power

Endpoint[edit]

  • GET /power: Retrieves information about the power system, including battery and solar data.

Response Format[edit]

The API returns the data in JSON format with the following structure:

{
    "battery": {
        "stateOfCharge": {
            "value": 46,
            "unit": "%"
        },
        "stateOfCapacity": {
            "value": 72.864,
            "unit": "kWh"
        },
        "power": {
            "value": -6903,
            "unit": "W"
        },
        "voltage": {
            "value": 49.03,
            "unit": "V"
        },
        "current": {
            "value": -140.8,
            "unit": "A"
        },
        "temperature": {
            "value": 22.4,
            "unit": "\u00b0C"
        },
        "minCellVoltage": {
            "value": 3.26,
            "unit": "V"
        },
        "maxCellVoltage": {
            "value": 3.27,
            "unit": "V"
        }
    },
    "solar": {
        "approxLoad": {
            "value": 43,
            "unit": "%"
        },
        "approxRemainBattery": {
            "value": 11,
            "unit": "h"
        },
        "power": {
            "value": 6437,
            "unit": "W"
        },
        "voltage": {
            "value": 48.74,
            "unit": "V"
        },
        "current": {
            "value": 143.2,
            "unit": "A"
        },
        "state": {
            "value": "Inverting",
            "unit": ""
        },
        "solarProd": {
            "value": 0,
            "unit": "W"
        }
    }
}

Fields[edit]

  • battery.stateOfCharge (object): The state of charge of the battery.
 * value (float): The battery charge percentage.
 * unit (string): The unit of measurement, "%" for percentage.
 
  • battery.stateOfCapacity (object): The current capacity of the battery.
 * value (float): The battery's capacity in kilowatt-hours (kWh).
 * unit (string): The unit of measurement, "kWh".
 
  • battery.power (object): The current power consumption or production of the battery.
 * value (float): The power in watts (W). A negative value indicates discharge, while a positive value indicates charge.
 * unit (string): The unit of measurement, "W" for watts.
  • battery.voltage (object): The current battery voltage.
 * value (float): The voltage in volts (V).
 * unit (string): The unit of measurement, "V".
 
  • battery.current (object): The current flow from the battery.
 * value (float): The current in amperes (A). A negative value indicates discharging.
 * unit (string): The unit of measurement, "A" for amperes.
  • battery.temperature (object): The temperature of the battery.
 * value (float): The temperature in degrees Celsius (°C).
 * unit (string): The unit of measurement, "°C".
  • battery.minCellVoltage (object): The minimum voltage of a single battery cell.
 * value (float): The minimum voltage in volts (V).
 * unit (string): The unit of measurement, "V".
  • battery.maxCellVoltage (object): The maximum voltage of a single battery cell.
 * value (float): The maximum voltage in volts (V).
 * unit (string): The unit of measurement, "V".
  • solar.approxLoad (object): The approximate load on the solar power system.
 * value (float): The load percentage.
 * unit (string): The unit of measurement, "%".
  • solar.approxRemainBattery (object): The estimated remaining battery charge duration based on current solar input and load.
 * value (float): The remaining battery life in hours (h).
 * unit (string): The unit of measurement, "h" for hours.
  • solar.power (object): The current power output of the solar system.
 * value (float): The power in watts (W).
 * unit (string): The unit of measurement, "W".
  • solar.voltage (object): The current voltage from the solar panels.
 * value (float): The voltage in volts (V).
 * unit (string): The unit of measurement, "V".
  • solar.current (object): The current flow from the solar system.
 * value (float): The current in amperes (A).
 * unit (string): The unit of measurement, "A".
  • solar.state (object): The current state of the solar power system.
 * value (string): The system's state, such as "Inverting".
  • solar.solarProd (object): The current solar production.
 * value (float): The amount of power currently being produced by the solar system in watts (W).
 * unit (string): The unit of measurement, "W".

Example Response[edit]

{
    "battery": {
        "stateOfCharge": {
            "value": 46,
            "unit": "%"
        },
        "stateOfCapacity": {
            "value": 72.864,
            "unit": "kWh"
        },
        "power": {
            "value": -6903,
            "unit": "W"
        },
        "voltage": {
            "value": 49.03,
            "unit": "V"
        },
        "current": {
            "value": -140.8,
            "unit": "A"
        },
        "temperature": {
            "value": 22.4,
            "unit": "\u00b0C"
        },
        "minCellVoltage": {
            "value": 3.26,
            "unit": "V"
        },
        "maxCellVoltage": {
            "value": 3.27,
            "unit": "V"
        }
    },
    "solar": {
        "approxLoad": {
            "value": 43,
            "unit": "%"
        },
        "approxRemainBattery": {
            "value": 11,
            "unit": "h"
        },
        "power": {
            "value": 6437,
            "unit": "W"
        },
        "voltage": {
            "value": 48.74,
            "unit": "V"
        },
        "current": {
            "value": 143.2,
            "unit": "A"
        },
        "state": {
            "value": "Inverting",
            "unit": ""
        },
        "solarProd": {
            "value": 0,
            "unit": "W"
        }
    }
}

Error Handling[edit]

If an error occurs while fetching the data, the API will return a generic HTTP error response (e.g., 500 Internal Server Error).

Example Request[edit]

To retrieve the power system data, make a simple GET request to the following endpoint: GET http://api.deepskychile.com/power

Authentication[edit]

Currently, the API does not require authentication. Any future authentication requirements will be detailed here.

Conclusion[edit]

This API provides easy access to real-time data on the power systems at Deep Sky Chile observatories. The battery and solar power metrics are provided, allowing users to monitor the energy performance and usage in a straightforward manner.

If you need further assistance or have additional questions about using the API, feel free to reach out.