# Warnings

Retrieve the latest or historical device warnings/faults.

URL: **`http://LIVEX_IP_ADDRESS/api.php?get=warnings&from=YYYYMMDD`**

Method: **`GET`**

Request Parameters:

* **`from`** - (`Optional`) Date as `YYYYMMDD`. If empty, return only current active warnings/faults.

Response Format: **`JSON`**

## Response Example

```javascript
[["2019-10-14 10:27:35",[17921,17408,17443,18928]],["2019-10-14 11:28:19",[]],["2019-10-14 12:13:33",[18918]]]
```

## Response Parameters

```
[
    [
        "LOGTIME",
        [VALUE, ...]
    ],
    ...
]
```

**`LOGTIME`** - (`String`) Timestamp when the warnings were logged\
\&#xNAN;*Format:* *`YYYY-MM-DD hh:mm:ss`*

**`VALUE`** - (`Integer`) Inverter warning/fault ID active at time logging\
\&#xNAN;*All warning/fault IDs are documented in the batterX ID Protocol*

## Examples

#### **`JavaScript Example (jQuery)`**

```javascript
$.get({
    url: "http://LIVEX_IP_ADDRESS/api.php?get=warnings&from=20191014",
    success: function(response) {
        console.log(response);
    }
});
```

#### **`PHP Example`**

```php
$response = file_get_contents("http://LIVEX_IP_ADDRESS/api.php?get=warnings&from=20191014");
$jsonArray = json_decode($response, true);
var_dump($jsonArray);
```

#### **`Python Example (requests)`**

```python
import requests
response = requests.get("http://LIVEX_IP_ADDRESS/api.php?get=warnings&from=20191014")
jsonArray = response.json()
print(jsonArray)
```
