Script decimal to hexadecimal convertion and then sending the value to the KNX bus
INTRODUCTION
This guide is done to explain how to build a script that will process and convert a group of decimal characters to hexadecimal and finally trigger a Scenario component that will send the entered pin to the KNX Bus.
Script overview
First create the variable that stores the hexadecimal values that will be added later on to the total value that will send to the KNX bus.
Create the new function “scorporate_dec“, then create the variable called “pin“, this last variable will gather the value of the Text entry.
Then create three new variables, this three variables will split the value displayed on the info component in three parts.
The three variables are processed to be converted to hexadecimal, then function will add a 0 on every missing character whenever the characters entered are less then 2.
Three new variables are created, in this portion of the script the variables will take the hexadecimal value and add the character “0x” to the value.
Click the link below to download the script project and try it your self.