Closed miguelpruivo closed 2 years ago
Something like this should work:
"getRotationSpeed": { "topic": "test/fan/getRotationSpeed", "apply": "return Math.floor(message/20)*20" },
"setRotationSpeed": { "topic": "test/fan/setRotationSpeed", "apply": "return Math.floor(message/20)*20" },
... rounding down, or possibly better:
"getRotationSpeed": { "topic": "test/fan/getRotationSpeed", "apply": "return Math.floor((message+10)/20)*20" },
"setRotationSpeed": { "topic": "test/fan/setRotationSpeed", "apply": "return Math.floor((message+10)/20)*20" },
... rounding to the nearest value.
Hi, I'm trying to setup my vacumm and added a fan speed toggle for the speed which can have 6 enums as values, so far, it's been working great, the problem is that the UI in the Homekit allows me to toggle "in-between" values from 0-100 and I wanted to lock it to jumps of 20, like
[0, 20, 40, 60, 80, 100]
as the only valid values.In the Roborock homebridge plugin there is something similar and I can effectively only toggle between those, but I'm yet to found a way to do it with mqtt. This is my setup so far for it:
Thank you!