Mikrotik Binding: Any feature requests? Ability to disable and enable interfaces from openHAB

@matmai and @ilo

Do you or anyone else have any feature requests for this binding? I just added the ability to enable and disable INTERFACES, so whilst everything is fresh in my head, now is a good time to look at adding more functionality. Please give a brief example of how the feature would be used, you can see what is implemented in the API by looking here but a lot more is possible then what is documented, basically any terminal command can be run from the API so if you know the terminal command that works, give the example command/s:

If anyone does not like the idea of a binding turning interfaces off, then the best idea is for you to make sure the API user only has READ access level and not FULL. To do this in winbox V4.1 you do the following:

SYSTEM>USERS>ACTIVE USERS> Here you will see the user that openhab is connected with by looking at the VIA column and seeing the line with API listed, make sure it has the level of access that you wish to grant openHAB. To change or create a User, just go back to the user tab and adjust as needed.

In case someone wants to know the use case for disabling an interface/port/wifi/ssid, this is so I can setup a kill switch to turn off my sons internet to all his devices. Just press a zigbee switch and his gaming PC and tablet and TV all loose connectivity. An expire timer can auto re-enable the connectivity after a set time or the switch can be pressed again.

Another use case would be to turn on and off a guest WIFI for when you do not need the extra SSID.

Just tested the ability to turn on and off the ‘Kid Control’ features of the router which would require adding a new thing type called ‘Kid Control’ most likely….

The API call is:

`routeros.sendAPICommand(“/ip/kid-control/disable .id=ChildsNameHere”);`

With Kid Control you can assign multiple devices that the Child uses/owns and when you disable the ‘KID’ you disable the limitations you have placed on all the devices at the same time. You can specify start and end times for each day of the week and data/speed limits. If you give them no access times, then this can create a kill switch for all their devices that you can bulk turn on and off via an openHAB rule.

You can disable ports on the router, you can disable wifi, but if you want to disable a larger number of network connections than is available on your router directly, then the Kid Control can be used and then this frees up the ports on the router to be used for more important tasks.

Add an action to send any command?

@jimtng What use case would you use that for that the binding can not currently do? I am not keen on adding a fully unlimited doorway into sending terminal commands unless there is no other way to implement a feature that people will use.

So far I have added:

  • Ability to enable and disable interfaces.
  • Added support for VLAN interfaces.
  • Added support for VETH virtual ethernet ports that are used to sending data to and from a docker container running on your router device.
  • A channel that tells you when the device has new firmware available to trigger a rule/action.