This is an external engine that exposes Home Assistant entities and services to JavaScript scripts. It works by connecting to HASS WebSocket API, and encapsulates all available entities as JS objects to be able to simply interact with them using JavaScript.
Scripts are constantly monitored in the scripts
directory. They will be loaded when the service is started, reloaded when modified, and unloaded when deleted (also before reload).
JSON files will also be monitored and (re)loaded automatically. Scripts are notified when this happens. This provides a way to configure the scripts (and change their configuration on-the-fly), if your scripts want to support this.
Why
If you are used to JavaScript and do not want to go through the learning curve of Python and YAML templates (or just prefer JS for your automations), this comes to be a very handy tool that adds the capability to use JavaScript for your more complex automations, that may not be easily (or possible at all) implemented using templates.
After waiting for a proper JS integration and seeing that attempts were stalled for a long time, I decided to run my own one.
Installation and usage
Please refer to the github project page for details.
This is functional but still under development. Please let me know if you have some issues, including with the installation steps.