I was thinking of making a Mikrotik Router Binding, which would be able to use the Mikrotik API to interact with the router, one use case I can think of is similar to the Network binding, to use the DHCP server on the Mikrotik to check if a device is online, as well as maybe pull some stats from the Mikrotik like throughput so one can put internet upload/download or number of devices on the network etc on the OH dashboard.
These are just a few of the ideas I have, would be nice to know if there are other people who would like to interact with their Mikrotik routers and what functionality would be expected with the binding.
Unfortunately in V6.44 of RouterOS Mikrotik removed the option “http-content-type”. Meanwhile they at least updated the documentation accordingly, pointing to the option “http-header-field” as a replacement. I tried to rewrite my script, but whatever I send as header field results in a “bad request” response. Multiple “http-header-field” entries are not permitted, the parameters need to be listed, comma seperated.
Does anyone have the same issue, or even has a solution for that? I would be very grateful for every hint how to solve this.
Issue solved: Multiple header fields are not needed. As @Tema pointed out here (Mikrotik RouterOS HTTP request to OH) a few hours ago, the string defining the media type needs to be in lower case entirely.
I have started working on a binding for Mikrotik routers.
Would be great to recap what would be the most appreciated by users.
I found these:
System statuses (voltage, temperature, version, uptime, free memory etc…)
Interface status (disabled, mac address, etc…) What would make most sense for you to have for each interface? I plan to add enable/disable command also, but first I want to have everything to be working correctly and reading states only
Device presence based on MAC address and wireless registration table.
Basically any information could be fetched from the router (which you can access through terminal), so implementing all of them is not possible and would not make sense. Though that’s why I’m planning to add a command_execute channel where you can execute terminal commands and a json response is generated, so everyone can execute everything on the router directly from openHAB.