Send MQTT command or execute shell command on startup of mycodo

I’d like to send a MQTT command or execute a shell command, after the raspberry has booted and mycodo is started.
Is there any trigger or builtin function to do this?

The only way I can see to run a bash script at startup with the built-in Mycodo modules would be to setup the Output “On/Off: Shell Script”, and set the startup state to ON, this way whenever Mycodo starts, it will set the Output to ON, which will run whatever bash script you specified in the “On Command” path.

Or, if you want to publish an MQTT message on Mycodo startup, you could do basically the same thing using the “On/Off: MQTT Publish” Output. Set your topic and payload message to what you want, and set the startup state to ON, this way whenever Mycodo starts your mqtt payload is published.

1 Like

Thanks that’s a great idea!