Writing a script

Hello, I’m a complete n00b at this, but can someone please inform me how I can write a script that turns on multiple IR devices?
or where I can find more info on this?
thank you!

1 Like

Hi Michael,

there exists the possibility to use the universal TV remote.
This runs a whole collection of IR-codes for e.g. the Power-Button to switch TVs on or off respectively.
Have a look at the “tv.ir” file in the directory “SD-card/infrared/assets”.
There you can see how the “script” is structured.

Now this only works for TVs.
If you want to make it work with other devices you may try to modify this script (make a backup before you start). Replace the existing entries by the ones you want to send (make sure you stick to the naming convention).
Note, that only the predefined buttons are supported (Power, Mute, VOL+, VOL-, CH+, CH-).

Creating a new scripe besides the existing TV script is not possible (at least i couldnt do it).

Hope this helps :slight_smile:

You can write a script that runs on your computer and controls the flipper via the CLI using this python package.

1 Like

Hi Astra,
I just tried same thing over CLI without python, and noticed that “duty_cycle” in CLI command “ir” is required in range of 0-100, but in the saved .ir files, there is as decimal number (just divided by 100). I understand that range 1-100 (percentile) is better for users to read and understand, and 0-1 (coefficient) is better to use in code, but are there any plans to standardize this value over theese two use-cases in official FW? It isn’t such a big deal, but it could be helpful to beginners if theese values were standardized, and it is not that hard to ensure backward compatibility for .ir files (if value >1 then it is range 0-100, else it is 0-1)…

Thanks, Lukas.

Hi, yes, we plan to unify that in the future CLI refinement

1 Like