Rule Machine Bug: Toggle Not Working For Virtual Switches

C-8, 2.3.9.200, Rule Machine 5.1

It seems that "Toggle" turns on a virtual switch, but doesn't turn it off.
I tried adding a real switch, and it worked as expected.

Enable all logging for the rule, and provide output of the logs filtered to just this rule.

Also, provide a screenshot of the "Events" page for this rule showing (at least) the times when the rule actions ran.

There is no reason this wouldn't work with a virtual switch if it works with a real one. RM doesn't care about the driver; it just looks at the current value of the "switch" attribute and sends the command (on or off) that should put it in the opposite state. What makes a virtual switch different is that you might have an "auto-off" option enabled that would be confusing things for the rule, among other possibilities why a rule might not work as expected, and all the above should help with figuring that out.

2 Likes

It would be very easy for you to duplicate.

Not if there isn't actually a problem to duplicate. :wink:

Rule: (run using "Run Rule Actions" on demand)
Screenshot 2024-11-07 at 09.46.40

Logs:
Screenshot 2024-11-07 at 09.46.50

Device events: (showing commands and events as expected)

Rule 5.1 works as I described above, as evidenced by my logs and the outcome, so the above information (plus maybe the value of the "Enable auto-off" setting on your virtual switch) would be necessary to figure out what's happening for you. Without that, there is nothing to go by. In other words:

5 Likes

Ok, maybe it wasn't that easy-you'd need a similar button device for the trigger to duplicate.
I'll mess with it later and get logs, etc.

edit: autooff is not enabled.

I got it working with a real lr device that I managed to pair (having a dickens of a time, brought on by attempting multiple pairings at once).

At first the real device was behaving as the virtual device, but after adjusting the driver to what I wanted, ie, scenes enabled, button programming disabled, led 100%, etc, it started working correctly.

Restoring the settings to the way they were resulted in no change! So, I'm not looking a gift horse in the mouth. I have my work cut out for me trying to smartstart 10 switches.

It probably has something to do with the attribute change trigger and toggle action in the rule, but I'm not going to pursue in the interest of 'science'. :slight_smile:

I'll mark it as 'solved', and leave it at that. :slight_smile:

If you do need further assistance in the future, this information will probably be necessary for others to help:

1 Like

Yeah, I'm in the middle of smartstart hell at the moment, hence my 'as long as it works' outlook at the moment.