Hey guys,
Im trying to add a second ESPhome effect to some lights, but getting this error.
ERROR Error while reading config: Invalid YAML syntax:
while parsing a block collection
in "/config/esphome/printer-lamp.yaml", line 47, column 8:
- lambda:
^
expected <block end>, but found '<block sequence start>'
in "/config/esphome/printer-lamp.yaml", line 76, column 9:
- lambda:
^
From what I can find of people having multiple effects, Im doing it right. So whats the issue?
effects:
- lambda:
name: "Breathing Red"
update_interval: 16s #Finetune to your liking with the transition lenght below
lambda: |-
#define Color1 1.0, 0.0, 0.0 //These are the colors defined, feel free to change or extend the list
//if you extend the list, dont forget to add them in the switch loop below
//and remember to adjust the reset counter at the bottom
static int state = 0;
static int color = 1;
auto call = id(printer_lamp).turn_on(); //put the id for your light in here
call.set_transition_length(15000);
if (state == 0)
{
call.set_brightness(0.01);
}
else if (state == 1)
{
call.set_rgb(Color1);
call.set_brightness(1.0);
}
state ++;
if (state == 2){
state = 0;
}
call.perform();
- lambda:
name: RGB Breathing
update_interval: 16s #Finetune to your liking with the transition lenght below
lambda: |-
#define Color1 1.0, 0.0, 0.0 //These are the colors defined, feel free to change or extend the list
#define Color2 1.0, 0.5, 0.0 //if you extend the list, dont forget to add them in the switch loop below
#define Color3 1.0, 1.0, 0.0 //and remember to adjust the reset counter at the bottom
#define Color4 0.5, 1.0, 0.0
#define Color5 0.0, 1.0, 0.0
#define Color6 0.0, 1.0, 0.5
#define Color7 0.0, 1.0, 1.0
#define Color8 0.0, 0.5, 1.0
#define Color9 0.0, 0.0, 1.0
#define Color10 0.5, 0.0, 1.0
#define Color11 0.5, 0.0, 1.0
#define Color12 1.0, 0.0, 0.5
static int state = 0;
static int color = 1;
auto call = id(frontfan).turn_on(); //put the id for your light in here
call.set_transition_length(15000);
if (state == 0)
{
call.set_brightness(0.01);
}
else if (state == 1)
{
switch(color)
{
case 1: call.set_rgb(Color1);
break;
case 2: call.set_rgb(Color2);
break;
case 3: call.set_rgb(Color3);
break;
case 4: call.set_rgb(Color4);
break;
case 5: call.set_rgb(Color5);
break;
case 6: call.set_rgb(Color6);
break;
case 7: call.set_rgb(Color7);
break;
case 8: call.set_rgb(Color8);
break;
case 9: call.set_rgb(Color9);
break;
case 10: call.set_rgb(Color10);
break;
case 11: call.set_rgb(Color11);
break;
case 12: call.set_rgb(Color12);
break;
}
call.set_brightness(1.0);
}
state ++;
if (state == 2){
state = 0;
}
color++;
if(color == 7)
{
color = 1;
}
call.perform();
Thanks guys