Hello...
thanks for this project, I got it working with RGB but I have two additional channels, that I'd like to use for two white-strips.
As I understood, the readString-variable contains the "command" or "request" from Homebridge and the additional value.
I'm trying to seperate the brightness-value, if I get the following homebridge-command:
Code: Select all"brightness": {
"status": "http://localhost/api/v1/brightness_s1",
"url": "http://localhost/api/v1/brightness_s1/%s"
}
I modified it to brightness_s1 for switch 1 so I know which switch is controlled.
So far so good,
Til now I'm able to set the white strip on/off and give it a fixed brightness-value, that I also can read as value in Home-App.
But how can I seperate the brightness-value from the requesting string?
Code: Select all //Set brightness White 1
if(readString.indexOf("brightness_s1") >0) {
brightW1 = readString.substring(9).toInt(); //This doesn't work
//brightW1=25; //this worked fine
setW1();
}
I'm not so familar with arduino yet, so I will need some help, please.
...why is it substring(9,15) in Set color section?