Understanding Code and Error

I have been trying to get some code working for sometime now, mostly by cut, paste & edit as I am not a programmer, but learning as I am going. I can’t seem to find any examples or good tutorials that explain the different parts of the Lambda code, or at least this detail of it. I have this bit of code under the Binary Sensor:

But when I compile it, I keep getting this error:

Is there somebody that can explain what is going on here? I am not sure what the “open” & “stop” are referring too.

Also, any good recommendations on more info on stuff like this? I have searched through ESPhome.io, but it does not seem straight forward, or have found any books on ESPhome. Any suggestion would help.

You are trying to call open() and close() on the A4899 stepper motor driver component. This conponent only knows how to control a motor (let’s say the axle).

To see the list of functions that you can invoke here (eg set_target), see this page: Stepper Component

The open and close are available for the Cover component so I guess what you are missing is a link between your stepper motor and a Cover.

Regarding lambda’s: that is the “advanced” part of esphome. In many cases lambda’s should not be needed. In order to understand how this works you need some (basic) knowledge on C/C++

1 Like