HowTo: ESPEasy - execute commands and actions via HTTP, MQTT, UDP and directly

One thing that makes ESPEasy so practical and universal is the ability to read and control various sensors and actuators via commands. Especially in combination with appropriate rules, this results in a tremendous number of possibilities.

To test individual commands and / or to be able to execute them in general, there are several possibilities.

These are described in the following article.

Hints for our lovely english readers: Basically, many of the articles on are translations from the original german articles. Therefore, it may happen here and there that some illustrations are not available in english and that some translations are weird/strange/full of mistakes or generally totaly wrong. So if you find some obvious (or also not obvious) mistakes don't hesitate to leave us a hint about that in the comment section. 
Also please don't get confused, that instead of a "dot" often a "comma" is used as decimal separator. 🙂

Safety instructions

I know the following hints are always a bit annoying and seem unnecessary. But unfortunately, many people who knew it "better" from carelessness lost their eyes, fingers or other things or hurt themselves. In comparison, a loss of data is almost not worth mentioning, but even these can be really annoying. Therefore, please take five minutes to read the safety instructions. Even the coolest project is worth no injury or other annoyance.

Affiliate links / advertising links

The links to online stores listed here are so-called affiliate links. If you click on such an affiliate link and store via this link, receives a commission from the online store or provider concerned. The price doesn't change for you. If you do your purchases via these links, you will support in being able to offer further useful projects in the future. 🙂


Helpful Articles:
Before you start with this article you should have programmed the ESPEasy firmware on the ESP8266 you are using. Information can be found in the following article.
ESPEasy - Flash firmware and configure WLAN access data

Required tools:

Required material:

In the following list you will find all the tools you need to implement this article.

Available commands

To control your ESPEasy device you can use commands from different "sources". On one hand, there are system commands that come from the ESPEasy "operating system" itself. With these you can control general functions such as setting the WLAN login data. A list of these possible system commands can be found at the following link:

In addition, each plugin can bring additional commands. There is no central overview for these commands. But they should be provided by the developer of the plugin.

With plugins of you find this information always on the respective Plugin side on All available ESPEasy plugins can be found at

Execute commands via the serial interface

If you are still connected locally - ie via USB - to your ESPEasy-device, you can use the serial interface to execute commands quickly and easily. Open the serial monitor of your Arduino-IDE or another terminal program. Tips can be found in the article Ardunio - Using the serial interface.

If you have the "Serial Monitor" opened, you can send commands to your ESPEasy-device as shown. It is important that you set the "newline character (CR)".

Execute commands via the web menu

Another way to set commands you have over the web menu is your ESPEasy-devices. Go to the web menu and then Tools tab.

There you will be offered an input field in the upper area, where you can place commands. To submit the command click on "Submit".

Execute commands via a URL call

Commands can also be executed via an appended URL call. The command is simply called in combination with the IP address/domain name of the ESPEasy-device.

If your ESPEasy-device has the IP address and you want to execute the command "testcommand, 1,2,3", this call would look like this:

This is another example of how you can execute a command via URL call.

Execute commands via UDP

This function can (so far) only be used to send commands from one ESPEasy device to another. For this purpose it is sufficient to execute the following command on the sending ESPEasy device.

SendTo , 

Execute commands via rules

Almost all commands can also be used within Rules. I will describe this and general information about Rules in a separate article.

Execute commands via MQTT

Commands can also be posted via an existing MQTT connection and executed by the connected ESPEasy device.

For this you have to configure a MQTT controller on the ESPEasy device. This must also be on the first "slot" of the controllers. In addition, the OpenHAB MQTT controller should be used. Unfortunately, the command execution does not work with the others (as far as known).

Configure your MQTT controller as shown. Of course you have to adjust the controller hostname to your server and if necessary you have to enter username and password.

It is also important that the following is entered under "Controller Subscribe":


%sysname% stands for the name of your ESPEasy device. If your ESPEasy device has the name "pxlBlckLivingroom", for example, this combination causes the MQTT controller to subscribe to all topics starting from "/pxlBlckLivingroom/". So the controller also receives messages about "/pxlBlckWohnzimmer/cmd" which can be used to execute the desired commands.

To summarize: So if your ESPEasy device is called "pxlBlckLivingroom" it is enough to send the desired command to the topic "/pxlBlckLivingroom/cmd".

Additional information

Have fun with the project

I hope everything worked as described. If not or you have any other questions or suggestions, please let me know in the comments. Also, ideas for new projects are always welcome. 🙂

P.S. Many of these projects - especially the hardware projects - cost a lot of time and money. Of course I do this because I enjoy it, but if you appreciate that I share this information with you, I would be happy about a small donation to the coffee box. 🙂

Buy Me a Coffee at   


  1. HI,
    thank you very much for your description!
    I tinker more on the hardware side and don't use any automation software a la open Hab or IO Broker. So my question is this, is it possible to send a device flashed with Tasmota UDP data to a specific IP? I bought a smart socket with energy meter. I want to send this energy data via UDP to another ESP server.
    Can you help me with this, so on the side of Tasmota 😉 🙂 .

    Many thanks and greetings

    1. Hi Mat,
      as far as I know, this cannot be done with UDP. Does it have to be UDP?
      It should actually work via MQTT 🙂 .
      Best regards

  2. Hi, thanks a lot for this article. It is very helpfull because there is a very poor documentation for espeasy on the web. Thanks to you I was able to send my commands via MQTT to Espeasy. It was write nowhere that we have to use the OpenHAB controller for sendig command via MQTT....

    1. Hi kankrola,
      you are welcome. Had the same problem when I tried to fix it and tought it's worth documenting it. I guess the guys behind ESPEasy are already pretty busy at maintaining the development so I'm happy to fill the documentation gap with this a bit. 🙂
      Best regards

Kommentar hinterlassen

Your email address will not be published. Erforderliche Felder sind mit * markiert