Im new to esphome and i have a problem about lambda calls, On Fan Components theres a lambda call to retrive the current speed of a Fan then do something according to speed. the code is below.
// Within lambda, get the fan speed and conditionally do something
if (id(my_fan).speed == 2) {
// Fan speed is 2, do something here
} else {
// Fan speed is not 2, do something else here
}
Can someone tell me where to paste or edit this code? because i already paste it on my ESPHOME module device code and its comming up with errors… could someone tell me what am i missing?
My goal is to get the fan speed then turn ON one of my 3 relay switch according to fan speed. hope someone can help me.
I’ve seen mideahvac.yaml code contains lambda calls to allow you to select the fan speed from the ESPHome Web UI. Perhaps it’ll give you some clues.