So I’m using fans and controlling them with the Bond Hub. It works great however you can’t test for ‘on’. In a conditional test you can specify NOT OFF and that covers all the various speeds but for a trigger there is no NOT option so I need to trigger on all the various possible fan speeds. Any way to either make ON be true if any speed is set or add a NOT option to the trigger?
If your fan device reports the "switch" attribute as "on" or "off" matching the state you're looking for, you could use that instead of the "fanSpeed" attribute (which, as you've probably noticed, is typically either "off" or the set speed, at least for devices that support multiple speeds). Whether a device/driver does this or not varies a bit, as the modern approach seems to be the "pure" Fan Control capability with only the "fanSpeed" attribute, but a lot of older drivers (and possibly some newer community drivers too) use "Switch" since that's a pretty widely usable capability for apps/automations/etc. that don't have specific support for fans.
That being said, going back to your rule, one way to do this regardless would be adding a trigger for each event you care about (e.g., one each for "low," "medium," and "high" or whatever your device actually reports, besides, of course, "off"). Another is triggering on "changed" and using conditionals in your actions (essentially what you are trying to do in your triggers now but can't because they represent events and not states, though they may case some resultant state and in this case does, and you can check that), like "IF Fan is NOT Off THEN" ... "END-IF".
Of course, if you share the specific automation you're trying to create -- i.e., what your goal is -- someone may have specific ideas better suited to your particular use case.
This is what I do. All my automations control the virtual fan. Then I have a rule that sets the actual fan controlled by the Bond hub to whatever the virtual fan is set to.
{edit} This doesn't really help, as you are right, you can't test for on. I thought the virtual fan had a switch option but it doesn't. You can test for changed and then look at what speed as your first action. Which is how I control my fan now
I never considered this option as I always assumed you could get no feedback from the device. You are right, however, my Bond fan has a custom attribute called switch. So that would seem to work, never tried it however.
Just seems like Hubitat should say yes it’s ON if it’s set to any speed. Or that it should have a NOT option on the trigger. Either would fix this. I thought about a virtual switch but that’s really a work around and inevitably it will get out of sync.
Clasically, triggers in Rule Machine need to refer to either specific events (e.g., fan speed attribute with a value of low, fan speed attribute with a value of medium, etc.) or any event for a particular attribute (e.g., fan speed). These are events (just things that happen), not conditions, so a "NOT" isn't offered as an option for the trigger itself. The two solutions I mentioned would work, given how RM triggers and conditionals work.
But thinking about this again, I remembered that Rule Machine recently-ish introduced conditional triggers. These are evaluated after the particular trigger event. Therefore, an easy way to do that in your case should be to do a "*changed*" trigger for the fan speed and enable the conditional trigger, adding "ONLY IF fan speed is NOT off." Something like this:
This is not that different from the second solution I mentioned above (at least if you only have one trigger event, as it sounds like you do), but it does save a couple lines in your actions and might look a bit cleaner if that was part of the hesitation.
@TArman that worked. Thanks. Haven’t ever used that function. Interesting that it will test to on there but only for a specific speed else where. At any rate thanks!