Hello. I would like to use blinds controlled by 433MHz transmitter. The control protocol has quite complicated timing and I was only able to get it working by modification of C++ program at markisol/Markisol.ino at 9cc13ec5d3d22195338b0c3d53bc853951cf1b29 · akirjavainen/markisol · GitHub . I also have some complicated logic already created in ESPhome like checking for sun elevation and wind forecast. Now I would like to incorporate that .ino program into esphome yaml. I know it is possible, I can do lots of lambdas in C++, but I never succeded with C++ function definitions in esphome. Is there any tutorial or examples how to include whole .ino standalone program into esphome? Thank you very much!
Continuation: I was able to include .ino program as .h in esphome .yaml. I included definition of custom component in yaml:
custom_component:
- lambda: |-
auto my_custom = new MyCustomComponent();
return {my_custom};
Now if I put any commands (transmissions) in loop() of that .h, then it is performed. However, if I call function in loop() of .h file like:
sendMarkisolCommand(SHADE_STOP_EXAMPLE);
how do I call that function on yaml? I tried:
on_boot:
priority: -100
then:
- lambda: sendMarkisolCommand(SHADE_DOWN_EXAMPLE);
- delay: 3s
- lambda: sendMarkisolCommand(SHADE_STOP_EXAMPLE);
But this does not call function defined in .h file. I also tried
- lambda: my_custom.sendMarkisolCommand(SHADE_DOWN_EXAMPLE);
and
- lambda: custom_component.sendMarkisolCommand(SHADE_DOWN_EXAMPLE);
but getting errors.
So how do I call function defined in .h file from lambda in .yaml?
Thanks