setStatus — device status word setup.



void setStatus(ID:SUBID, u8 *status[, u8 sizeOfstatus]);

Set up of status status(with size sizeOfstatus) for ID:SUBID device. Depending on the device one byte is sent for simple devices (TRX, HYT) and several bytes (array) for complicated ones.
List of parameters


Device address.


Status forwarded to the device. Literal, variable or pointer to the array can be forwarded as the parameter.


The size of forwarded status (optional parameter).


<item LAMP1="512:8" LAMP2="512:9" DIM="524:19" RGB="524:16" addr="524:248" COND="524:200" name="Test for setStatus function" type="script">

// Example: 1
setStatus(LAMP1, 1); 

// Example: 2
u8 stt_1 = 1;
setStatus(LAMP2, stt_1); 

// Example: 3
setStatus(DIM, {1, 175, 3}); 

// Example: 4
u8 stt_2[] = {0x21, 0x08, 0, 0x22, 0x02};
setStatus(COND, &stt_2); 

// Example: 5
u8 stt_3[] = {1, 200, 200, 0, 10};
setStatus(RGB, &stt_3, 5);

The result of performing this example:

When clicking the element script the lamps LAMP1 and LAMP2 will be switched on, the dimmable lamp DIM will be switched on with brightness of 175 within 3 seconds, RGB lamp RGB within 10 seconds will be switched on and will change the colour to red. Virtual device of conditioner COND will be switched on with the temperature of 24 degrees in dry mode with airflow capacity 3 and position of horizontal and vertical fins 2.