Tasmota API via HTTP using Curl

Tasmota has a huge catalog of commands that can be run via the serial console, MQTT, or HTTP. These commands are great for scripting purposes. The easiest way I've found to send a command is with Curl.

curl http://192.168.1.142/cm?cmnd=POWER+TOGGLE

The API will answer in JSON which is easily digestible with JQ.

curl -s http://192.168.1.142/cm?cmnd=STATUS+8 | jq
Tags:
Leave A Reply - 3 Replies
Replies
February 7th 2022 - lh61

Hi,

I found that curl was even better than wget for iterative commands for instance this single command will close all my 12 RollerShutters

curl -q "http://192.168.1.1[31-42]/cm?cmnd=ShutterClose"

Curl is available on my Android phone and this command works fine from a Terminal prompt but I still didn't find a way to stick it as a shortcut on the Home screen, the same way I can do it with a Browser bookmark.

September 28th 2022 - anwa

For bash/command line shortcuts have a look at https://wiki.termux.com/wiki/Termux:Widget

October 11th 2024 - Helmut

Your "curl" examples brought me on the right way, thank's

All content licensed under the Creative Commons License