Closed migabc closed 7 years ago
You cannot. RotationSpeed is a percentage type. See https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js#L1604-#1613
You would need to write an handler that converts the values 0,1,2 into the range 0-100 (e.g. 0,50,100) and that in both ways.
Hi, As you suggested, I wrote a handler for this.
onHKValueChange(field, oldValue, newValue) {
log('INFO: onHKValueChange(' + field + ", " + oldValue + ", " + newValue + ")");
if (field==="RotationSpeed") {
// RotationSpeed is DPT5.001 Percentage (0..100)
// need to convert to DPT5 Integer (0,1,2)
var knxValue = (newValue*2/100);
this.myAPI.knxWrite("RotationSpeed", knxValue, "DPT5"); // send the new knxValue to the KNX bus
It is working fine.
Thanks, Miguel
Great to hear.
Hi,
My Fan has 3 positions 0 -> Off 1 -> Low Speed 2 -> High Speed
How can I set the RotationSpeed to go from 0, 1, 2 (Like a 3 position switch)?
How can I limit DPT5 between 0 and 2?