Rule Machine Switch on and Stays on Not working

I have a Leviton DZ15S switch. I've got it setup, via Rule Machine, with an event trigger of "turns on and stays on for 15mins." The action following that event is to turn the exact same switch off.

A few days ago, this rule just stopped working. In the logs, it will show, from Rule Machine, that the switch turned on, but if I wait more than 15mins, and then manually turn it off, the logs from Rule Machine state that the action was canceled because the switch didn't stay on for 15 mins (even though it clearly did). I tried to update the platform to the latest (2.3.9.200 on HE 7). However, that failed and left me with a boot that got stuck at "updating drivers." I ended up playing with safe mode and downgrading all the way to 2.3.7.146.

After the downgrade, the rule in Rule Machine still wouldn't work. What is odd is that I have the exact same rule in place for two other Leviton DZ15S switches. It works fine for those other two switches.

But, it gets even stranger:

-Writing the same rule in Basic Rules works fine
-Changing the switch in the RM rules that do work, to this particular switch, makes those rules not work. Changing the switch back makes the rule work again.
-Cloning the RM rules that work and setting the cloned rule to work with the problem switch does not work.
-Building a rule in Rule Machine from the Basic Rule also does not work

I've removed the device from my zwave network and re-joined it. Still no change.

I'm running out of ideas of what is going on here, and I'm suspicious that the failed update and this Rule Machine issue are somehow related.

Anyone have a clue where to go next?

  • Turn on all logging for the rule and switch.
  • Screenshot the rule and post it
  • Trigger the rule, then go into logs and at the top of the screen filter the display to just show the device and rule.
  • Screenshot the section of logs where it fails and post that here too

Seeing a screenshot of the rule and logs will help someone see what's going on.

1 Like

Logs are not very useful.

app:413 2024-11-10 10:09:39.603 PM infoEvent: Downstairs Bathroom Fan switch off
dev:161 2024-11-10 10:09:39.549 PM infoDownstairs Bathroom Fan was turned off [physical]
dev:161 2024-11-10 10:09:39.546 PM infoBasicReport value: 0
dev:161 2024-11-10 10:09:39.541 PM debugparse description: zw device: 1F, command: 2003, payload: 00 00 00 , isMulticast: false
dev:161 2024-11-10 10:09:39.454 PM debugparse description: zw device: 1F, command: 8201, payload: , isMulticast: false
app:413 2024-11-10 09:47:28.948 PM infoEvent: Downstairs Bathroom Fan switch on
dev:161 2024-11-10 09:47:28.886 PM infoDownstairs Bathroom Fan was turned on [physical]

In this case i had to physically turn off the switch.

Can you share another log with the switch on for more than 15 minutes?

UPDATE: I just setup a similar test rule and the first time turned on the switch, like yours, it did not actually run. Then I ran it manually once with Ā« Run Actions Ā» and afterwards, I pressed on Ā« Update Rule Ā». After this, it ran successfully.

I'm not clear on your request for a run greater than 15mins. What I posted was a run of more than 15 mins. As far as I can tell, the fan will just keep running. Are you looking for something specific? Are you looking for a different duration of time for the event to wait?

I will try your other idea. However, I'm not sure if it works that it explains why. Given that taking a rule that works on another switch, and changing the switch in that working rule to my problem switch causes the working rule to fail, I'm forced to believe that there is something wrong with the switch or something very deep in the database that is messed up. However, I would have hoped that excluding and including the switch would have fixed that, but it didn't work either.

Here is what I get from a similar rule after the steps I outlined:

The 9:25 and 9:27 were my initial runs where the rule, like yours, didnā€™t run.

Then at 9:28 I ran it manually.

At 9:29, I re-ran the rule and as you can see at timestamp 9:29:07:950, the trigger was initiated (I set it to 15 seconds for quicker testsā€¦).

Since I donā€™t see that Ā« waiting Ā» event in your log, I can only conclude that the rule is not running. So nothing is being sent to the switch to get it to turn off.

I'm still running platform 2.3.7.146. If you are running a new one, you might get different messaging. Before I downgraded my platform (see original post on why), I was getting that message.

I did try the "run action" "update rule" thing. Nothing changed.

Note that app:413 is that rule, so the event is triggered for the rule. It just doesn't seem to see the time out. Again, it is only for this particular, physical switch. Is it possible for the switch to somehow be bad and not register something? I don't see how, given that the it only sends and "on/off" signal. Rule Machine needs to keep track of the time--I think. So why isn't it for this switch, and only this switch?

From what Iā€™m seeing, I donā€™t have the impression the issue is with the switch. I ran my test on the latest hub platform (2.3.9.200). Might I recommend that you give it a try to see if the problem remains in that version?

I'm very reluctant to upgrade platform right now. The last time I tried to upgrade to that version, it very nearly bricked my hub. I had to downgrade to this version to get the hub working again.

I'm inclined to wait a release or two before I try again.

This is, however, why I suspect something in the database. When I tried to upgrade to .200, I did it because this rule wasn't working. The upgrade failed and it stuck at "25% upgrading drivers." Incremental downgrades also didn't work and hung at the same place. Only when I went into the advanced area and did the major downgrade (it safe mode) did the hub work again. My understanding is that a database issue can cause this, but I'm no real expert on that. That is why I thought excluding the switch and including it again might clean up the database, but alas, no.

Ah yes, that would be a problem! Did you try doing a database restore? That will typically resolve database corruption issues.

Yup. I tried going back several saved versions, but the only one that worked at all was this older one.

Is there any way to scrub a database to make sure there aren't oddities in it and clean them out?

I think you are combining two different things. There is the platform version (you are on 2.3.7.146), and there is the database backups (under Settings -> Backup and Restore). I am referring to the later. Restoring a backed-up database will scrub it and ensure there arenā€™t oddities in it and clean them out.

1 Like

To be clear, I did both a downgrade of the platform and database restore. Nothing worked until I downgraded the platform.

Ok. So as I understand it, with this earlier version of the platform, you are seeing this rule machine issue and you are currently unable to update to the latest version of the platform.

Unless someone has a better idea, I would recommend that once you are able to update to the latest platform, you try this again. Until then, I think you mentioned that it worked with Basic Rules, so I would recommend you use that as a workaround (or permanent solution if it does what you needā€¦).

As I was messing around with things the other day, I noticed something really odd. This switch was using the Generic Z-Wave Switch driver (just like all my other switches of the same make and model). However, if I physically actuated the switch, the driver wouldn't register it. If I pushed the "on" or "off" button in the driver, it did. Not at all clear on why. However, I switched drivers to Jeff Page's Universal Z-Wave Switch Driver (link), and now it seems to work.

I'm still not clear what is going on with this switch and why it won't work with the generic driver like all the others, but I do have it working.

2 Likes