TuyaAPI / cli

🔧 A CLI for Tuya devices
MIT License
266 stars 43 forks source link

send command #5

Closed thib5 closed 5 years ago

thib5 commented 5 years ago

is it possible to send command with the cli api ? like ON/OFF or even RGB for bulb

thanks

codetheweb commented 5 years ago
> tuya-cli help

Usage: tuya-cli [options] [command]

Options:
  -h, --help          output usage information

Commands:
  link [options]      link a new device (for advanced users only)
  get [options]       get a property on a device
  set [options]       set a property on a device
  list                list all locally saved devices
  list-app [options]  list devices from Tuya Smart app (recommended for new users)
  help                output usage information

and

> tuya-cli set -h

Usage: set [options]

set a property on a device

Options:
  -s, --save   save key so you can omit it for subsequent commands
  --id <id>    id of device
  --key [key]  key of device
  --set <set>  value to set
  --dps [dps]  DPS index to set (default: 1)
  -h, --help   output usage information

So you can turn something on or off like this: tuya-cli set --id <id> --key <key> --set true (true for on, false for off).

In theory, you should be able to also set the color of a bulb by using --set "<color-format>" along with a custom --dps option, although it's a bit more complex and I can't help since I don't have a bulb.

thib5 commented 5 years ago

thank you for the on off tips ! for the issue how am I supposed to found out the color format and the dps ?

Thanks

codetheweb commented 5 years ago

I would read through the main discussion thread for TuyAPI starting here.

Sorry I can't help you more, if you figure it out please post the commands so I can add them to the README for other people.

tefracky commented 3 years ago

@thib5 Did you resolved the problem? Do you have an exapmle how to set a RGB color?