Make rule with 196 if-statements more generic

I cannot type it out for your, but I would like to believe that the right REGEX transformation will allow you to parse the string as needed.
You seem to get all the info you need in a string with the first four digits your connected to your item name and the last one your command.
You can piece together item names from strings, this post here is imho an excellent guide:

REGEX can be tricky, but there are REGEX validators online (e.g., regex101) and the documentation hopefully gives you a start.
So in short:
creating a string with “Tex_GV_Z”+REGEX(here-comes-expression-for-getting-device-number converting it to a item object replace the string in your sendCommand with another REGEX that gives you the relevant digit, may just collapse your code into a more manageable size.
Sorry that I am unable to give more concrete examples but hopefully the pointers above will allow you to proceed.