Do you know any VERY SIMPLE add-on that recognizes the service hassio.addon_stdin ?
Please, let me know.
I have searched for some on the internet, but they are too complex to understand where to start. Docs isn’t very clean about everything that is needed to develop an add-on with this functionality.
It doesn’t seem incompatible with any other configuration.
It seems to require stdin: true too.
startup doesn’t matter.
The entrypoint is a shell script (CMD [ "./run.sh" ]). Once there, the input can be sent to any programming language I want.
I used curl to send the input from the shell script to my nodejs webserver that is running as a service (/etc/services.d/...).
I haven’t tested removing that option yet.
I am developing an add-on that works based on some requests.
My first attempt was to expose a webserver to work as REST API, but I read a little about ingress and didn’t understand how I could invoke my endpoints. I don’t know whether ingress is a requirement for exposing REST API.
Then I read about hassio.addon_stdin and found it quite simple on how to use it.
So, at the moment, I am using hassio.addon_stdin to request some tasks that doesn’t require any response.
I will study later how to respond to the requests properly. Currently, I am thinking on sending events ( POST /api/events/<event_type> )