Enables you to execute scripts and perform API requests in MikroTik router

Overview

HomeAssistant component: MikroTik API

Validate

The mikrotik_api platform enables you to execute scripts and perform API requests in MikroTik router

To enable MikroTik API platform in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
mikrotik_api:
  host: !secret router_host
  username: !secret router_user
  password: !secret router_pass

Configuration variables:

  • host (Required): URL of router
  • port (Optional): default is 8728
  • username (Required)
  • password (Optional)

Install via HACS

You can find this integration in a store.

Install manually

You need to copy mikrotik_api folder from this repo to the custom_components folder in the root of your configuration, file tree should look like this:

└── ...
└── configuration.yaml
└── secrects.yaml
└── custom_components
    └── mikrotik_api
        └── __init__.py
        └── manifest.json
        └── services.yaml

Note: if the custom_components directory does not exist, you need to create it.

Usage

You will have a 5 new services to call either from Development Tools or from scripts.

params and find_params is key=value scheme. All strings have to be wrapped with a single of double quotes, numbers not. Special case is boolean - no quotes but the string would be True/False ie.: enabled=True or enabled=true

Service: mikrotik_api.call examples

In case you need to disable exact item, you can search for it. Then the command will be call only if find command returns ids, you can also specify find_params to the search.

command: /ip firewall address-list disable
find: /ip firewall address-list
find_params: list="internet" comment="test"
command: /ping
params: address="1.1.1.1" count=3
command: tools ping
params: mac="00:00:00:00:00"
command: /caps-man radio provision
params: .id=0
You might also like...
Aws-lambda-requests-wrapper - Request/Response wrapper for AWS Lambda with API Gateway

AWS Lambda Requests Wrapper Request/Response wrapper for AWS Lambda with API Gat

SickNerd aims to slowly enumerate Google Dorks via the googlesearch API then requests found pages for metadata

CLI tool for making Google Dorking a passive recon experience. With the ability to fetch and filter dorks from GHDB.

WebCash is an experimental new electronic cash ("e-cash") that enables decentralized and instant payments to anyone

Webcash WebCash is an experimental new electronic cash ("e-cash") that enables decentralized and instant payments to anyone, anywhere in the world. Us

A Discord bot that enables using breakout rooms on a server

Discord Breakout Room Bot This bot enables you to use breakout rooms on your Discord server! Note This bot was thrown together within a few hours, so

D(HE)ater is a security tool can perform DoS attack by enforcing the DHE key exchange.

D(HE)ater D(HE)ater is an attacking tool based on CPU heating in that it forces the ephemeral variant of Diffie-Hellman key exchange (DHE) in given cr

Asyncevents: a small library to help developers perform asynchronous event handling in Python

asyncevents - Asynchronous event handling for modern Python asyncevents is a small library to help developers perform asynchronous event handling in m

The Social-Engineer Toolkit (SET) is specifically designed to perform advanced attacks against the human element.

The Social-Engineer Toolkit (SET) The Social-Engineer Toolkit (SET) is specifically designed to perform advanced attacks against the human element. SE

Bill is a bot capable to Chat with you, search everything on web to you, and send message to yours contacts for you.

Bill Bot The inteligent Bot Bill is a intelligent bot, it can chat, search and send messages to you. Chat with You Send messages on WhatsApp for you S

An API that uses NLP and AI to let you predict possible diseases and symptoms based on a prompt of what you're feeling.

Disease detection API for MediSearch An API that uses NLP and AI to let you predict possible diseases and symptoms based on a prompt of what you're fe

Comments
  • Hotspot, Differentiate between A/P/S and D/H

    Hotspot, Differentiate between A/P/S and D/H

    Hi, i'm trying to differentiate HA trigger between A, P, S and D / H status in Hotspot > Hosts status. The reason for this is that there's some clients that only connects and not logged in to my hotspot server, and that messes up the automation. My AP is unifi and my radius server and hotspot server is mikrotik. Currently using unifi counter as trigger but of course i'm getting alot of false positive trigger due to above issue

    Can this be done with this integration? How would i create a sensor then?

    opened by Buster14 3
Releases(v2.0.0)
Owner
Pavel S
Pavel S
AutomaTik is an automation system for MikroTik devices with simplicity and security in mind.

AutomaTik Installation AutomaTik is an automation system for MikroTik devices with simplicity and security in mind. Winbox is the main tool for MikroT

Osman Kazdal 4 Dec 5, 2022
Monitoring plugin for MikroTik devices

check_routeros - Monitoring MikroTik devices This is a monitoring plugin for Icinga, Nagios and other compatible monitoring solutions to check MikroTi

DinoTools 6 Dec 24, 2022
A free sniper bot built to work with PancakeSwap: Router V2

Pancakeswap Sniper Bot PancakeSwap sniper bot. Automated sniping bot to snipe crypto coin launches. How it works The sniping bot can be used in three

null 89 Aug 6, 2022
Python wrapper for Xeno-canto API 2.0. Enables downloading bird data with one command line

Python wrapper for Xeno-canto API 2.0. Enables downloading bird data with one command line. Supports multithreading

_zza 9 Dec 10, 2022
Terminal Bot which will Execute your Commands From telegram bot!

Terminal-Bot see this bot alive: https://t.me/HerokuTerminal_Bot With this bot you can execute system commands on your server. how to config? clone or

Moshe 41 Dec 9, 2022
Simple python program to execute terminal commands on telegram chats directly.

Small python code which can be handy when using telegram and you don't want to use VPS again and again. By configuring the code in your VPS, You can execute commands and get your output within telegram. It can also be very useful in performing Recon.

Veshraj Ghimire 34 Dec 5, 2022
A custom Discord Rich Presence to display when you're studying so you're stupid friends won't disturb you when you're studying.

Studying RPC Description A custom Discord Rich Presence to display when you're studying so you're stupid friends won't disturb you when you're studyin

John Edmerson Pizarra 4 Nov 19, 2022
YouTube bot, this is just my introduction to api and requests, this isn't intended on being an actual view bot.

YouTube bot, this is just my introduction to api and requests, this isn't intended on being an actual view bot.

Aran 2 Jul 25, 2022
Python Wrapper for handling payment requests through the Daraja MPESA API

Python Daraja Description Python Wrapper for handling payment requests through the Daraja MPESA API Contribution Refer to the CONTRIBUTING GUIDE. Usag

William Otieno 18 Dec 14, 2022