I want OH2 to execute a command (mosquitto_pub.exe) at startup, after it is fully loaded and running. Adding the command to the openhab.bat will not do the right thing - the command will be executed to early, before OH is fully initialized. Is there a proper way to do it? Perhaps a special rule?
The /t argument of timeout specifies the delay in seconds for running my commands after starting openhab.
I am watching this with mosquitto_sub, and indeed 20 seconds after restarting the OpenHab Windows service I get the correct sequence of messages on openhab/start topic.
Now I can implement dynamic state update for my clients (smart switch etc.) when openhab restarts.