I’m looking for basic script to control my guest wifi. My idea is to have switch/button in Home Assistant so everybody could easily turn on/off guest wifi.
I have the infrastructure (broker, needed packages, etc..) but unfortunately also 0 experience with RouterOS scripting.
It should listen for some payload like “guest_wifi:on” and “guest_wifi:off” and made appropriate change for wifi3.
Thank you guys. I was scared to do it by myself, anyway it turned out that it’s not that hard.
If anybody wonders how to do it by MQTT (JSON), it can be as easy as this:
:if ($msgData~"\\{\"guest_wifi\":\"disable\"\\}") do={/interface set wifi4 disable=yes}
:if ($msgData~"\\{\"guest_wifi\":\"enable\"\\}") do={/interface set wifi4 disable=no}
Anyway, while researching this topic, I found out that there is unofficial integration called Mikrotik - Router (that uses suggested API) and it does all I could ask for.