Skip to content

Execute sequence of commands on Tasmota device from command-line

License

Notifications You must be signed in to change notification settings

macie/tasmota-cmd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tasmota-cmd

tasmota-cmd allows to execute sequence of commands on Tasmota device connected to network. With it you can automate setup of Tasmota devices.

Usage

Program reads commands from stdin, line by line. Each line should be in format command=value.

Most basic usage is to write sequence of commands to file:

$ cat tasmota_setup
Hostname=mydevice

# comment line (like this) and empty lines are ignored
FriendlyName=My First Device

and use that file as an input:

$ ./tasmota-cmd 192.168.1.101 <tasmota_setup
> GET http://192.168.1.101/cm?cmnd=Hostname%20mydevice
< {"Hostname":"mydevice"}

> GET http://192.168.1.101/cm?cmnd=FriendlyName%20My+first+device
< {"FriendlyName1":"My First Device"}

Also it can be used in interactive mode, where user enter one command at once. To exit that mode user need to write EOF character (press Ctrl+D). Example:

$ ./tasmota-cmd mydevice.lan
Status=8
> GET http://mydevice.lan/cm?cmnd=Status%208
< {"StatusSNS":{"Time":"1970-01-01T00:01:13"}}

Installation

The instruction is for Linux. On different OSes, you may need to use different commands

  1. Download latest stable release from GitHub:

    wget https://github.com/macie/tasmota-cmd/releases/latest/download/tasmota-cmd
  2. (OPTIONAL) Verify downloading:

    wget https://github.com/macie/tasmota-cmd/releases/latest/download/tasmota-cmd.sha256sum
    sha256sum -c tasmota-cmd.sha256sum
  3. Set execute permission:

    chmod +x tasmota-cmd
  4. Move to directory from PATH environment variable:

    mv tasmota-cmd /usr/local/bin/

Development version

git clone [email protected]:macie/tasmota-cmd.git
cd tasmota-cmd
make install

Development

Use make (GNU or BSD):

  • make - run checks
  • make test - run test
  • make check - perform static code analysis
  • make install - install in /usr/local/bin
  • make dist - prepare for distributing
  • make clean - remove distributed artifacts
  • make cli-release - tag latest commit as a new release
  • make info - print system info (useful for debugging).

Versioning

tasmota-cmd is versioned according to the scheme YY.0M.0D (calendar versioning). Releases are tagged in Git.

License

MIT