Skip to content

Instantly share code, notes, and snippets.

@svyatogor
Last active January 3, 2026 18:18
Show Gist options
  • Select an option

  • Save svyatogor/7839d00303998a9fa37eb48494dd680f to your computer and use it in GitHub Desktop.

Select an option

Save svyatogor/7839d00303998a9fa37eb48494dd680f to your computer and use it in GitHub Desktop.
Convert SmartIR Broadlink commands to Tuya
@Jody1818
Copy link

I used the code and it does not add "ir_code_to_send":
should I do it menually? am I doing something wrong?
is it not a must?

@sneakysandals
Copy link

I got the script to run but have the same issue as @Jody1818 where none of the lines in the output have "ir_code_to_send"

Also all the output IR codes are wildly different from the original .json codes.

@Wobak
Copy link

Wobak commented Aug 27, 2025

I used the code and it does not add "ir_code_to_send": should I do it menually? am I doing something wrong? is it not a must?

I got the script to run but have the same issue as @Jody1818 where none of the lines in the output have "ir_code_to_send"

Also all the output IR codes are wildly different from the original .json codes.

The codes are different because they're not encoded in the same format, so it's completely normal.
The ir_code_to_send is not added because you should add it to your climate platform like this (in the configuration.yaml):

climate:
  - platform: smartir
    name: "My AC"
    device_code: 8888
    controller_data: "zigbee2mqtt/UFO-R11 Test/set/ir_code_to_send"

In that case the payload needed just needs to be the IR code.

@matthuisman
Copy link

For issue with invalid int, its because some temps dont have a command in the source file:
eg:
https://raw.githubusercontent.com/smartHomeHub/SmartIR/refs/heads/master/codes/climate/1281.json

        "static": {
          "16": "",
          "17": "JgAGAWk0DA0NDQ4mDQ4NJg4MDQ0NDg0mDiYNDg0MDQ0OJg4nDA4NDQ0MDg0NDQwODQ0NDA4NDQ0NDQ0NDQwOJw0NDQ0NDgwNDQ0ODA0NDScNDQ4MDQ0NDg0mDiYNJw0oDCgNJw0mDicMDg0NDScNDQwODQ0NDA4NDQ0NDQ0NDScNJw0NDQ4MDQ0NDgwNDQ0ODSYODQwNDQ4NDA0NDg0MDQ0ODQwNDg0mDicMDg0NDQwODQ0NDA4NDQ0MDg0NDQ0NDQ0NDA4NDQ0NDQ0NDQ4MDQ0NDgwNDQ0ODA0NDQ4MDQ0NDg0MDQ0ODQwNDQ4NDA0NDiYODQ0MDSgNDA4nDCgNDA4NDQ0MKA0ADQU=",

these should simply be skipped.
I suggest the script is updated to do that.
eg.
if isinstance(value, str):
becomes
if isinstance(value, str) and value:

@vincenzoca69
Copy link

I tried the conversion but with the tuya sensors the conversion files don't work. Does anyone have any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment