Skip to content

Meteorological (Met) information

Add met

Description:

Used to add a new met interface

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/add/met

Request body:

Note: After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

The request body should be sent as form-data and it should contain the device information as illustrated in the section below:

Field name Description Type
met_name Name of the met str
met_type The type of met str
met_token [Optional] Token that will be used to update the met. If not specified, a random token will be generated str
update_period How often the met will be updated. This time is used to calculate the met status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

JSON format

{
    "met_name":"Test met",
    "met_type":"Oi",
    "met_token":"f5d6dsewwds",
    "update_period":120
}

Request example:

None

Response

{
    "success": {
        "met_id": 191683571546635,
        "met_token": "df45g56df6"
    }
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Met count

Description:

Used to get number of Mets available

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/count

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

None

Response

{
    "success": {
        "mets": 3
    }
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

List mets

Description:

Used to list all the Mets for the user

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/list

Request body:

Note: After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

None

Request example:

None

Response

{
    "success": [
        {
            "met_id": 581661500259116,
            "met_name": "Testing",
            "met_type": "Custom",
            "met_status": "Offline",
            "met_temperature": 0.0,
            "met_pressure": 0.0,
            "met_humidity": 0.0,
            "met_precipitation": 0.0,
            "met_voltage": 0.0,
            "met_current": 0.0,
            "met_power": 0.0,
            "met_soc": 0.0,
            "met_details": {},
            "update_period": 60,
            "last_modified": 1661507459,
            "met_token": "d0be24c0055fd5b3505209006be257aa21c0c5a8",
            "notification_enabled": true,
            "alarms": [
                {
                    "alarm_id": 1684265911731,
                    "device_id": 581661500259116,
                    "alarm_name": "Met temp alarm",
                    "alarm_enabled": true,
                    "alarm_threshold_value": 10.0,
                    "alarm_condition": ">=",
                    "alarm_trigger_time": null,
                    "alarm_repeat_delay": 300,
                    "alarm_akn": null,
                    "update_time": 1684265911,
                    "alarm_triggered": false,
                    "condition_parameter": "temperature"
                }
            ],
            "whatsapp_enabled": null,
            "temperature_units": "",
            "pressure_units": "",
            "humidity_units": "",
            "precipitation_units": "",
            "voltage_units": "",
            "current_units": "",
            "power_units": "",
            "soc_units": "",
            "sms_enabled": null
        },
    ]
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Field name Description Type
met_name Name of the met str
met_type The type of met str
met_token Token that will be used to update the met. If not specified, a random token will be generated str
met_details met details which will be stored as a json object json
met_status Device status json
met_temperature Meteorological temperature json
met_pressure Meteorological pressure json
met_humidity Meteorological humidity json
met_precipitation Meteorological precipitation json
last_modified Indicates the latest update time in epoch json
notification_enabled Indicates if the notifications have been enabled for the interface json
whatsapp_enabled Indicates if whatsapp notifications have been enabled for the interface json
sms_enabled Indicates if sms notifications have been enabled for the interface json
temperature_units Temperature units json
pressure_units Pressure units json
humidity_units Humidity units json
precipitation_units Precipitation units json
voltage_units Voltage units json
current_units Current units json
power_units Power units json
soc_units State of charge units json
update_period How often the met will be updated. This time is used to calculate the met status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Met Status

Description:

Used to get met status

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/status

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/met/status?met_id=65698658484984584&met_token=fds654gf654gdf56gdf654gdf

Json body example

{
    "met_id": 65698658484984584,
    "met_token": "fds654gf654gdf56gdf654gdf"
}

Response

{
    "success": {
        "met_id": 581661500259116,
        "met_name": "Testing",
        "met_type": "Custom",
        "met_status": "Offline",
        "met_temperature": 0.0,
        "met_pressure": 0.0,
        "met_humidity": 0.0,
        "met_precipitation": 0.0,
        "met_voltage": 0.0,
        "met_current": 0.0,
        "met_power": 0.0,
        "met_soc": 0.0,
        "met_details": {},
        "last_modified": 1661507459,
        "update_period": 60,
        "notification_enabled": true,
        "whatsapp_enabled": null,
        "sms_enabled": null,
        "temperature_units": "",
        "pressure_units": "",
        "humidity_units": "",
        "precipitation_units": "",
        "voltage_units": "",
        "current_units": "",
        "power_units": "",
        "soc_units": "",
        "alarms": [
            {
                "alarm_id": 1684265911731,
                "device_id": 581661500259116,
                "alarm_name": "Met temp",
                "alarm_enabled": true,
                "alarm_threshold_value": 10.0,
                "alarm_condition": ">=",
                "alarm_trigger_time": null,
                "alarm_repeat_delay": 300,
                "alarm_akn": null,
                "update_time": 1684265911,
                "alarm_triggered": false,
                "condition_parameter": "temperature"
            }
        ]
    }
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Field name Description Type
met_name Name of the met str
met_type The type of met str
met_token Token that will be used to update the met. If not specified, a random token will be generated str
met_details met details which will be stored as a json object json
met_status Device status json
met_temperature Meteorological temperature json
met_pressure Meteorological pressure json
met_humidity Meteorological humidity json
met_precipitation Meteorological precipitation json
requested_state_time Used to indicate the last requested state time for the met json
last_modified Indicates the latest update time in epoch json
notification_enabled Indicates if the notifications have been enabled for the interface json
whatsapp_enabled Indicates if whatsapp notifications have been enabled for the interface json
sms_enabled Indicates if sms notifications have been enabled for the interface json
temperature_units Temperature units json
pressure_units Pressure units json
humidity_units Humidity units json
precipitation_units Precipitation units json
voltage_units Voltage units json
current_units Current units json
power_units Power units json
soc_units State of charge units json
update_period How often the met will be updated. This time is used to calculate the met status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Met update

Description:

Used to update met status

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/update/met

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/update/met?met_id=191679387165463&met_token=201679387120404&met_temperature=26&met_pressure=35&met_precipitation=68&met_humidity=50

Json body example

{
    "met_id": "581661500259116",
    "met_token": "d0be24c0055fd5b350520",
    "met_details": "{}",
    "met_temperature": 26,
    "met_pressure": 35,
    "met_precipitation": 68,
    "met_humidity": 50,
    "met_voltage": 12.3,
    "met_power": 70,
    "met_current": 12,
    "met_soc": 91
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Met history

Description:

Used to get met history data

Request

Request method:

GET

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/history

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Field name Description Type
min_epoch_tm_sec Minimum time for history record str
max_epoch_tm_sec [Optional] Maximum time for history data. This is set to current epoch time if not specified str
met_id [Optional] met ID. All met history will be returned if not specified str

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/met/history?min_epoch_tm_sec=1641502593

Json body example

{
    "min_epoch_tm_sec": 1641502593,
    "max_epoch_tm_sec": 1999999999,
    "met_id": 65897465466
}

Response

{
    "success": [
        {
            "met_id": 581661500259116,
            "met_name": "Testing",
            "min_time": 1684266548,
            "max_time": 1684267031,
            "met_type": "Custom",
            "data": [
                {
                    "met_temperature": 46.0,
                    "met_pressure": 55.0,
                    "met_humidity": 5.0,
                    "met_precipitation": 25.0,
                    "met_voltage": 20.0,
                    "met_current": 10.0,
                    "met_power": 15.0,
                    "met_soc": 5.0,
                    "met_details": "46",
                    "update_time": "2023-05-16T21:49:08"
                },
                {
                    "met_temperature": 26.0,
                    "met_pressure": 35.0,
                    "met_humidity": 50.0,
                    "met_precipitation": 68.0,
                    "met_voltage": 12.0,
                    "met_current": 12.0,
                    "met_power": 70.0,
                    "met_soc": 5.0,
                    "met_details": "{}",
                    "update_time": "2023-05-16T21:57:11"
                }
            ]
        }
    ]
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Field name Description Type
met_id met ID str
met_name Name of the met str
met_type The type of met str
min_time Minimum history time available str
max_time Maximum history time int
data Array containing met history data. json

Met edit

Description:

Used to edit met information

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/edit/met

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Field name Description Type
met_name Name of the met str
met_type The type of met str
met_token [Optional] Token that will be used to update the met. If not specified, a random token will be generated str
voltage_units Voltage units json
current_units Current units json
power_units Power units json
soc_units State of charge units json
update_period How often the met will be updated. This time is used to calculate the met status. If no updates are received withing this period, the device status will be regarded as offline. An email will be sent to the user if notifications are enabled when the status changes. str

Note:

Only the met owner can edit the interface information.

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/edit/met?met_id=545467565849421245489&met_token=5fgd94dgfd6fsd8d986gd6dg&met_name=met&update_period=300

Json body example

{
    "met_id": 581661500259116,
    "met_token": "d0be24c0055fd5b350520",
    "met_name": "met",
    "update_period": 300,
    "temperature_units": "",
    "pressure_units": "",
    "humidity_units": "",
    "precipitation_units": "",
    "voltage_units": "",
    "current_units": "",
    "power_units": "",
    "soc_units": ""
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Delete met

Description:

Used to delete met

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/delete/met

Request body:

The request info should be sent as params or json body and it should contain the device information as illustrated in the section below.

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/delete/met?met_state=true&met_token=df45ddddsdaewg56df6&met_id=301659085216623

Json body example

{
    "met_id":301659085216623,
    "met_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Enable alerts

Description:

Used to enable interface alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/enable/alerts

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/met/enable/alerts?met_token=df45ddddsdaewg56df6&met_id=301659085216623

Json body example

{
    "met_id":301659085216623,
    "met_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Disable alerts

Description:

Used to disable interface alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/disable/alerts

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/met/disable/alerts?met_token=df45ddddsdaewg56df6&met_id=301659085216623

Json body example

{
    "met_id":301659085216623,
    "met_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Enable whatsapp

Description:

Used to enable interface whatsapp alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/enable/whatsapp

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/met/enable/alerts?met_token=df45ddddsdaewg56df6&met_id=301659085216623

Json body example

{
    "met_id":301659085216623,
    "met_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Disable whatsapp alerts

Description:

Used to disable interface whatsapp alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/disable/whatsapp

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/met/enable/alerts?met_token=df45ddddsdaewg56df6&met_id=301659085216623

Json body example

{
    "met_id":301659085216623,
    "met_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Enable sms alerts

Description:

Used to enable interface sms alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/enable/sms

Request body:

None

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/met/enable/alerts?met_token=df45ddddsdaewg56df6&met_id=301659085216623

Json body example

{
    "met_id":301659085216623,
    "met_token": "df45ddddsdaewg56df6",
}

Disable sms alerts

Description:

Used to disable interface sms alerts

Request

Request method:

POST

Headers:

Content-type: application/json

URL

https://spoilerinterface.com/interface/met/disable/sms

Request body:

None

Note:

After authenticating, a cookie will be set on the response and this can be used to make further request without including the api_key in the request params.

Request example:

Params example

https://spoilerinterface.com/interface/met/enable/alerts?met_token=df45ddddsdaewg56df6&met_id=301659085216623

Json body example

{
    "met_id":301659085216623,
    "met_token": "df45ddddsdaewg56df6",
}

Response

{
    "success": "success"
}

Field description

The response information contains a success key which indicates that the met interface has been added successfully