Hello!
Can anyone write a JS-Transformation to following Pressac A.C.3phase-Current-Clamp with teh EEP-Profile D2-32-02?
Thanks alot!
Hello!
Can anyone write a JS-Transformation to following Pressac A.C.3phase-Current-Clamp with teh EEP-Profile D2-32-02?
Thanks alot!
I tried (thanks to fruggy 83; New openHab2 EnOcean binding - #615 by fruggy83) following JS-transformation on my own, to see raw data but I’m not an IT-expert…:
(function(inputData) {
var parts = inputData.split('|'),
hexToBytes = function(hex) {
for (var bytes = [], c = 0; c < hex.length; c += 2)
bytes.push(parseInt(hex.substr(c, 2), 16));
return bytes;
};
if(!parts || parts.length != 2)
return null;
var b = hexToBytes(parts[1]);
switch(parts[0]){
case "genericSwitch":
break;
case "genericRollershutter":
break;
case "genericDimmer":
return "DecimalType" + "|" + b[0];
case "genericNumber":
return "DecimalType" + "|" + b[2];
case "genericColor":
break;
case "genericString":
return "DecimalType" + "|" + b[1];
case "genericTeachInCMD":
break;
}
return (inputData);
})(input)
This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.