# SetLightingControllerIp

Calling this method commands the lighting controller to use a new IP address.

There are 2 ways to set the new IP address, depending on wether the current address is known or not:

* Set the new IP address using the existing IP address
* Reset the lighting controller to revert to a known IP address, to use that for setting a new IP

After running this command, the communication to the lighting controller will stop working, since the IP address and port has changed. The communication is restored when the new IP address has been configured in the module twin (either by deployment, or by changing the IP address manually).

### **Method Name:**

SetLightingControllerIp

### **Payload:**

The direct command takes the following properties:

* **newIpAddress**: New IP address to set (required)
* **useDefaultSettings**: Optional, and defaults to false. If this is true, the communication to the lighting controller will be done using the existing TCP connection, with the currently configured IP address and port. Otherwise, it is assumed that the lighting controller was reset, and that the default IP and port is used for communication.

#### **Reset of lighting controller (unknown current IP address)**

Factory default of the lighting controller sets the IP address is *192.168.0.2* on default port *40001*. While this is not always convenient, the IP address and port can be changed, using the following procedure:

1. Reset the PD3 controller, by pressing reset button, using something pointy (toothpick, etc.)
2. Recycle power on the PD3 controller by disconnecting it from the power supply for 5 seconds
3. Call direct command **SetLightingControllerIp** on SceneControllerModule with the following payload, where expected response is "ok":

```
   { 
        "newIpAddress": "xxx.xxx.xxx.xxx"
   }
```

4. Configure the LightingController in the Twin configuration (either manually or by deployment) to configure the new IP address.
5. Recycle power on the PD3 controller by disconnecting it from the power supply for 5 seconds
6. Test new IP calling direct command **CallLightingController** on SceneControllerModule with the following payload, where expected response starts with "@00O":

```
   { 
       "command": "@00M"
   }
```

#### **Changing already known IP address**

To set a new IP address of a lighting controller, where the current IP address is already known, do the following:

1. Call direct command **SetLightingControllerIp** on SceneControllerModule with the following payload, where expected response is "ok":

```
   { 
        "newIpAddress": "xxx.xxx.xxx.xxx",
        "useDefaultSettings": true
   }
```

2. Recycle power on the PD3 controller by disconnecting it from the power supply for 5 seconds
3. Reconfigure the LightingController in the Twin configuration (either manually or by deployment) to configure the new IP address.
4. Test new IP calling direct command **CallLightingController** on SceneControllerModule with the following payload, where expected response starts with "@00O":

```
   { 
       "command": "@00M"
   }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tricloudnexus.io/edge/nexus-modules/data-connector-modules/scenecontrollermodule/direct-commands/setlightingcontrollerip.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
