Skip to content

Cloud control for IR devices #283

Answered by uzlonewolf
Ameb asked this question in Q&A
Feb 12, 2023 · 2 comments · 7 replies
Discussion options

You must be logged in to vote
import tinytuya
import json

tinytuya.set_debug()

c = tinytuya.Cloud()

device_id = '...'

ir_cmd = {
    "control":"send_ir",
    "head":"010ed20000000000040015004000ad0730",
    "key1":"002$$0020E0E0E01F@%",
    "type":0,
    "delay":300
}

cloud_cmd = {
  "commands": [
    {
      "code": "ir_send",
      "value": json.dumps(ir_cmd)
    },
  ]
}

res = c.sendcommand(device_id, cloud_cmd)

print(res)
print('')
print( json.dumps(res, indent=2) )

If you have remotes programmed/defined you can also send keys:

import tinytuya
import json

tinytuya.set_debug()

c = tinytuya.Cloud()

device_id = '...' # Smart IR (IR blaster)

# Get a listing of all programmed remotes
#res = c.cloudrequest( '…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@Ameb
Comment options

@uzlonewolf
Comment options

@uzlonewolf
Comment options

@Ameb
Comment options

@uzlonewolf
Comment options

Answer selected by Ameb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants