I'm guessing the capture action works only with the "level" attribute, which despite showing up in the current driver (changed in 2.1.6) isn't actually supported and will throw the error you see above with any setLevel command--try it manually from the device page and see. I'm not sure if the capture action just prefers to capture level instead of speed or (and this is what is guess but I haven't played around with it enough to know) just doesn't support speeds or "true" fans at all.
So I don't really have a solution (except a complicated workaround of saving and restoring with a variable and a bunch of conditionals), just an explanation of what the problem is. I really wish the fan capability suported level (the fact that the Hampton Bay driver has this capability at all is a mistake, I was told). I'm sure they have their reasons for not doing so, but it makes it a lot easier when it does.
I believe you're on to something, and I believe at one time it did... At least before the driver change, in this last update, A similar Rule in RM3.0 would restore the fan to the original speed when requested
Even when using Google Home I could say " Hey Google, Set the Breakfast Nook Fan Speed to 50%" and it would do it. Checked today and all that is available is On & Off.
Edit: I just checked via the KOF Fans Device page that I cannot use the "Set Level" dialog. But when I use "Set Speed" dialog, the "Current States" is still reporting the changing levels in 25% increments as well as the current speed.
So I am "thinking" this was due to a driver change? not a RM bug. Either that or RM needs to catch up to the Driver??? LOL!
This driver was changed in 2.1.6, some of which Mike explained here: Hampton Bay Fan Controller - setLevel broken. The old driver implemented setLevel, so it definitely would have worked here. The new one doesn't, though he apparently accidentally left an artifact of that in 2.1.6. Really made things easier when it did (I understand it has to round the value somewhere but I wonder what other disadvantages there are to having it since it seems like there are also disadvantages to not--and this is really a general comment about the fan capability, not this driver in particular which now finally more or less matches the others).
If possible, I would like setLevel to be functional in the HBFC driver (child fan driver). Without it, Amazon Alexa cannot easily set the fan speed, IIRC. I believe setLevel was added back to many of the Z-wave fan controller drivers for the same reason. SetLevel also properly works in the Lutron Caseta Fan Controller driver. Let’s not lose this capability, please.
Before this update, I could treat the fan like a dimmer and "dim" the speed. This allowed me to use a variable, which does not seem to be the case with set speed (or, at least I can't figure it out).
@bravenel While you are looking into it... The driver also has a glaring omission... The device supports fan direction, but the driver does not provide a way to set the direction.
Could this be added (either to the driver or the to-do list for the driver). Thanks very much!!!