So I had an old Rule Machine rule that tested if my fan was on and if it was it would turn it off. I migrated that rule to the new Rule Machine and it no longer works. Now the test for ON fails even when it is on. The test only passes when it matches the actual speed the fan is set to. Well when I change the fan speed during the day then the rule will fail later unless I set up a bunch of OR tests for all possible fan speeds. Why would ON not just be a simple ON/OFF test regardless of the speed as it was with the old Rule Machine? I guess I could set a Virtual Switch to somehow work around this but it seems silly to have to do so. Am I missing something?
What driver is this fan using, and what does "Current States" on the device detail page look like? Also, what "capability" are you using in your rule for this? If the device has a "switch" attribute that reports "off" or "on," you could treat it like a switch. But if it's a "pure" fan driver, you'll need to look at the "speed" attribute instead, where "on" and "off" are generally two of several possible values.
I think a lot of older drivers did the former or both, while newer ones lean towards just the latter, but if the device reports accurately via some attribute, it should be possible. The questions above will just help figure out how.
It's the community driver as I was having issues with built in one released a few months ago. That's why OLD is in the name.
The fan is running now and shows running on the Dashboard:
Device page also shows running at medium speed.
If I change the rule to test for MEDIUM instead of ON it will then show TRUE.
I can try the build in Bond drivers again and see what happens there. It just used to work great before I tried to move it to the newer rule machine and I already deleted the old one from the Legacy version so I can't create it again.
Okay I changed the rule to use the built in driver and here the driver shows the speed but switch OFF since on this driver the switch is for the light. So not sure how to test for on/off of the fan itself.
I'll just set an IF for each speed I guess.
Look at the
speed attribute when on or off; I'm guessing you'll see either a specific speed (e.g., "medium") or "off" as the value. I seem to remember seeing "on" as an option here in some drivers, maybe just virtual, and was thinking of that above, but I'm not sure that really makes sense unless it's an on/off-only device.
Using the "Fan Speed" capability/condition type in RM plus NOT "off" should work to test for anything that is on. Looks like you may have figured that out above while I was typing.
Just seems like NOT OFF should equal ON. If a switch is ON is not NOT OFF? I need tequila now.
That's because the
speed attribute for this device is probably always either "off" or a specific speed, but never just "on," which would mean just that specific value (I assume "on" would really only happen for just one-speed fans? I have never used any on Hubitat...).
But yeah, I agree that the "switch" attribute as an simple test for on or off certainly makes this a lot easier, but the trend seems to be to reserve that for outlets or lights with newer drivers (maybe to make things less confusing for voice assistants?). The built-in Bond driver is one that follows this path. The community driver may have done it another way.
Maybe that's why some of us had issues early on. Thanks.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.