# Smart Lighting

## Set Smart Light State

<mark style="color:green;">`POST`</mark> `http://localhost:9990/lighting`

This method sets the current smart lighting state.

#### Request Body

| Name  | Type   | Description       |
| ----- | ------ | ----------------- |
| state | string | some\_state\_here |

{% tabs %}
{% tab title="200 " %}

```
some_state_here
```

{% endtab %}
{% endtabs %}

```javascript
{
    "state": "lights"
}
```

### Lighting States

| State         | Description                                                    |
| ------------- | -------------------------------------------------------------- |
| `restore`     | Toggle 'Restore' lights when there is no active event          |
| `lights`      | Toggle 'Emergency' lights when emergency vehicle lights are on |
| `panic`       | Toggle 'Panic' lights                                          |
| `available`   | Toggle lights when unit status is changed                      |
| `unavailable` | Toggle lights when unit status is changed                      |
| `enroute`     | Toggle lights when unit status is changed                      |
| `onscene`     | Toggle lights when unit status is changed                      |
| `busy`        | Toggle lights when unit status is changed                      |
| `left`        | Toggle the left turn signal lights                             |
| `right`       | Toggle the right turn signal lights                            |
| `hazard`      | Toggle the hazard lights                                       |

### Local Port

The local port (`9990` by default) can be modified in the bodycam configuration section.

![Sonoran CAD - Bodycam Port](https://232668649-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4pGN81fb4R6zFhodcu%2F-MkidiYq2c-OzjChyC8-%2F-MkiePoUrXPZkFx7T64m%2Fimage.png?alt=media\&token=2d7b30b2-b955-4faf-a062-fa3d47fa4a18)
