Shinobi

How to use MQTT to trigger Shinobi

Now Shinobi can subscribe to MQTT events and trigger Shinobi events as well as send out its own MQTT events.

As of writing this article this feature is only found in the dashboard-v3 branch. The default Shinobi installation location is /home/Shinobi.

Shinobi has two new sections relating to this. MQTT Inbound and MQTT Outbound. As the names imply one is for recieving MQTT events and the other is for sending them out. Here's how to use them.

1. To reveal the features you will need to open terminal and run these commands. In future you may not need to do some steps.

cd /home/Shinobi
npm install [email protected]
node tools/modifyConfiguration.js addToConfig='{"mqttClient":true}'
pm2 restart camera.js

2. Now that its enabled Login to Shinobi and open your Account Settings. You should now see MQTT Inbound and MQTT Outbound sections.

1. Set the Enable toggle to Yes and click Add New.

2. Now you should see a row of fields.

  • Host : Generally this is the IP Address of your MQTT Server.
  • MQTT Subscription Key : the handler in your MQTT that you want to get triggers from.
  • Type : Select what kind of message will be coming to your Shinobi server. At the time of writing this article you can do Plain and Frigate.
    • If you choose to use Frigate you will need to set the MQTT Subscription Key to frigate/events
  • Monitors : Select which Monitors will be triggered.

1. Set the Enable toggle to Yes and click Add New.

2. Now you should see a row of fields.

  • Host : Generally this is the IP Address of your MQTT Server.
  • MQTT Subscription Key : the handler in your MQTT that you want to send triggers to.
  • Message From : Select that will trigger on your MQTT Subscription Key.
  • Monitors : Select which Monitors will be triggered. Some actions will ignore this field because they do not apply to a Monitor directly.

Currently not on Dashboard v3? You can switch by running the following. Be sure to backup any manual changes you made to the core files before doing this. If you made no changes then you can proceed.

cd /home/Shinobi
git reset --hard
git checkout dev
sh UPDATE.sh
pm2 restart camera.js

Want to switch back to dev or master? Easy. Just follow the same steps above but replace dashboard-v3 with dev or master .

ShinobiDocs

All content is property of their respective owners.