I’ve been working on developing 3 different devices that use an ESP32 for automation and they work with ESPHome. I’ve had some discussions about learning how to use ESPHome from a newbie’s point of view. For me, someone who had done a lot of work years ago in Perl, has used C++, but not since 2010 (probably not since 2008 or so), but does use Python regularly, I’ve found ESPHome a challenge to learn.
A lot of that is because it’s hard to understand just what the YAML file does - is it a configuration file? An OOP language? Is it part config, part C++? I’ve also run into issues like trying to read variables. YAML reads globals like ${globel_variable}, but if that variable is a number I’m using for anything (even an integer I’m using for timing), then I have to treat it more like I’m working with something in C++ and might have to write a lambda to read it or put it in brackets to get the value of it. (I was shown to do that at least once.)
I’ve started looking at what other platforms are out there. I’m not trying to rate them or make statements that one is bad and another good, but I’ve wanted to learn what’s out there so I can make more informed decisions about what platform or system will work best for different purposes. One platform I’m reading about is Tasmota.
I do NOT want to start an ESPHome vs. Tasmota discussion and I feel, STRONGLY, that anyone saying, “Well, then, maybe you should just go use Tasmota for your work,” is missing the point and avoiding an opportunity to discuss things that could lead to improvements in ESPHome.
While I don’t have anything actually working in Tasmota yet, what I have found is that Berry seems to be a serious advantage for that platform. With an API so Berry scripts can access features of Tasmota (and, therefore, issues in the ESP chips), it seems to me having an actual scripting language like this, where programs and functions can be added to an ESP system easily, is strongly desireable.
I’ve had times where it took 20 minutes to compile something when I finished a YAML file for ESPHome. It’s not just a case of writing a YAML file, then uploading it to the target system - ESPHome requires a recompile with every change in the file. Having a console that can be worked with directly, and which includes or allows the use of a scripting language seems like it would be a major advantage for ESPHome and that it would, in some cases, speed up development and, in other cases, make creating complext applications on ESPHome accessible to a lot more people.
Have there been any discussions about using Berry on ESPHome? (Or any other languages - Berry, specifically, though, is designed for systems like an ESP32 or similar SoCs.)
Is this something others thing is worth discussing? I realize for some, things work fine as they are, but, “Works for me,” does not seem to be a legitimate response. It basically means, “I like it, I really don’t care what helps otehrs.”
The YAML file format and trying to work with a cross between C++ and a configuration file can be confusing. A language like Berry would provide more power than lambdas would and would be a clear, unified, language where, in the language, there issues like, “Reference a variable this way in the logger statements, and this way in these functions.”