Community discussions

MikroTik App
 
ilm
just joined
Topic Author
Posts: 2
Joined: Tue Oct 18, 2022 12:49 am

MQTT Subscribe feature

Tue Oct 18, 2022 1:00 am

Use case:
I'm using a CRS112-8P-4S-IN as PoE Switch for a video surveillance system in a private house. Some cameras are indoor and should only be active, when nobody is home.
I want to make sure that the cameras are turned off. For that I wrote a python script, that turns off the PoE using the RouterOS REST API. It is working fine.
But
By using the REST API I have to store credentials with write permissions together with the script. If my server is compromised my switch is collateral damage.
I could write a schedule on the switch and execute it every 5 seconds to check an external HTTP server. But that is just ugly.

Very nice would be the ability of the IoT/MQTT feature to provide a subscribe option to execute a script on a certain topic.

That would also allow me, to play the Mario theme every time someone enters the server room.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11968
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: MQTT Subscribe feature

Tue Oct 18, 2022 1:11 am

With a little more imagination, have the PoE ports shut down when your mobile is registered to Wi-Fi.
The pseoducasual MAC address is not a problem, for the same network, it always remains the same.
 
User avatar
Hominidae
Member
Member
Posts: 309
Joined: Thu Oct 19, 2017 12:50 am

Re: MQTT Subscribe feature

Tue Oct 18, 2022 9:39 am

Use case:
I'm using a CRS112-8P-4S-IN as PoE Switch for a video surveillance system in a private house. Some cameras are indoor and should only be active, when nobody is home.
...next best hack, if this switch is soley used for this set of cameras: use a smart plug, i.e. with tasmota firmware and a local rule to switch its power supply completely.

Who is online

Users browsing this forum: No registered users and 19 guests