Skip to content

Commit c0e7e85

Browse files
Add info on mysensors S_RGBW_LIGHT (home-assistant#1899)
1 parent c68df1b commit c0e7e85

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

source/_components/light.mysensors.markdown

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ S_TYPE | V_TYPE
2929
------------|-------------
3030
S_DIMMER | [V_DIMMER\* or V_PERCENTAGE\*], [V_LIGHT\* or V_STATUS\*]
3131
S_RGB_LIGHT | V_RGB*, [V_LIGHT\* or V_STATUS\*], [V_DIMMER or V_PERCENTAGE]
32+
S_RGBW_LIGHT | V_RGBW*, [V_LIGHT\* or V_STATUS\*], [V_DIMMER or V_PERCENTAGE]
3233

33-
V_TYPES with a star (\*) denote V_TYPES that should be sent at sketch startup. For an S_DIMMER, send both a V_DIMMER/V_PERCENTAGE and a V_LIGHT/V_STATUS message. For an S_RGB_LIGHT, send both a V_RGB and a V_LIGHT/V_STATUS message with a V_DIMMER/V_PERCENTAGE message being optional. Sketch should acknowledge a command sent from controller with the same type. If command invokes a change to off state (including a V_PERCENTAGE or V_RGB message of zero), only a V_STATUS of zero message should be sent. See sketches below for examples.
34+
V_TYPES with a star (\*) denote V_TYPES that should be sent at sketch startup. For an S_DIMMER, send both a V_DIMMER/V_PERCENTAGE and a V_LIGHT/V_STATUS message. For an S_RGB_LIGHT, send both a V_RGB and a V_LIGHT/V_STATUS message with a V_DIMMER/V_PERCENTAGE message being optional. Same principal applies for S_RGBW_LIGHT and V_RGBW.
35+
36+
Sketch should acknowledge a command sent from controller with the same type. If command invokes a change to off state (including a V_PERCENTAGE, V_RGB, or V_RGBW message of zero), only a V_STATUS of zero message should be sent. See sketches below for examples.
3437

3538
For more information, visit the [serial api] of MySensors.
3639

@@ -111,10 +114,10 @@ void incomingMessage(const MyMessage &message) {
111114
### {% linkable_title MySensors 2.x example sketch %}
112115
113116
```cpp
114-
/*
117+
/*
115118
* Example Dimmable Light
116119
* Code adapted from http://github.com/mysensors/MySensors/tree/master/examples/DimmableLight
117-
*
120+
*
118121
* Documentation: http://www.mysensors.org
119122
* Support Forum: http://forum.mysensors.org
120123
*
@@ -170,7 +173,7 @@ void presentation()
170173
171174
void receive(const MyMessage &message)
172175
{
173-
//When receiving a V_STATUS command, switch the light between OFF
176+
//When receiving a V_STATUS command, switch the light between OFF
174177
//and the last received dimmer value
175178
if ( message.type == V_STATUS ) {
176179
Serial.println( "V_STATUS command received..." );
@@ -189,7 +192,7 @@ void receive(const MyMessage &message)
189192
190193
//Update constroller status
191194
send_status_message();
192-
195+
193196
} else if ( message.type == V_PERCENTAGE ) {
194197
Serial.println( "V_PERCENTAGE command received..." );
195198
int dim_value = constrain( message.getInt(), 0, 100 );
@@ -202,11 +205,11 @@ void receive(const MyMessage &message)
202205
} else {
203206
last_state = LIGHT_ON;
204207
last_dim = dim_value;
205-
208+
206209
//Update constroller with dimmer value
207210
send_dimmer_message();
208211
}
209-
212+
210213
} else {
211214
Serial.println( "Invalid command received..." );
212215
return;

0 commit comments

Comments
 (0)