Migrating to the new Rule Machine and new rules aren't working

I have two identical rules, one on Rule Machine legacy that I've been using for years with no issue. I decided to try to migrate my temperature rules to the new rule machine in case the legacy one gets deprecated.

I created an identical rule in the new Rule Machine and made sure I installed it. Here are the two rules, can anyone tell me why the new Rule never runs? Does the new Rule machine have access to the old Modes?

I had paused the legacy one for the last couple nights and had to enable it and pause the new rule each night because the new one wasn't working no matter what I did.

New:

Legacy:

This looks like it should work, I'd say so the best first step is what it usually is: enable all logging for this rule, and see what Logs, filtered to just this rule (and maybe trigger deivce events if nothing there), show for clues.

This isn't really something to worry about. It already is. All that means is new users can't install it, and you can't create brand new 3.0 rules. Existing installs, including their rules, will remain and keep working.

2 Likes

Thanks for the response. I'll enable logging and see what I see.

Probably a dumb comment but make sure you disable the old rule.

I figured it out. It seems the else if doesn't evaluate properly in the Rule Machine.

Earlier in the day the Heat was turned on because the temp went below the weekend_min_temp variable as expected. Then it continued running and never turned off because it's skipping the final ELSE clause for whatever reason. Here it should have hit the final ELSE clause but it was "skipped".

Am I doing something wrong here?

2024-12-01 02:39:30.839 PMinfoAction: END-IF

app:12282024-12-01 02:39:30.835 PMinfoAction: Thermostats: Upstairs Thermostat --> Mode: off (skipped)

app:12282024-12-01 02:39:30.831 PMinfoAction: ELSE (skipping)

app:12282024-12-01 02:39:30.827 PMinfoAction: END-IF

app:12282024-12-01 02:39:30.823 PMinfoAction: Thermostats: Upstairs Thermostat --> Mode: heat --> Heat: 75.0 --> Cool: 80.0 (skipped)

app:12282024-12-01 02:39:30.818 PMinfoAction: ELSE-IF (Temperature of Greta's Room Sensor(75.74) is <= weekend_min_temp(67.0)(F) [FALSE]) THEN (skipping)

app:12282024-12-01 02:39:30.796 PMinfoAction: Thermostats: Upstairs Thermostat --> Mode: cool --> Heat: 60.0 --> Cool: 67.0 (skipped)

app:12282024-12-01 02:39:30.790 PMinfoAction: IF (Temperature of Greta's Room Sensor(75.74) is >= weekend_max_temp(999.75)(F) [FALSE]) THEN (skipping)

app:12282024-12-01 02:39:30.770 PMinfoAction: IF (Mode in Day, Evening, Morning [TRUE]) THEN

app:12282024-12-01 02:39:30.739 PMinfoTriggered: Temperature of Greta's Room Sensor(75.74) changed

app:12282024-12-01 02:39:30.699 PMinfoEvent: Greta's Room Sensor temperature 75.74

1 Like

Oh this is actually a different rule than what I originally posted. Here is the rule where I caught the issue:

The same thing is happening with all my temperature rules.

Platform Version: 2.3.9.201
Hardware Version: C-5

Let me know if you need anything else or if you see something wrong with my logic here.

Thanks!

Oh my gosh, my fault. I think I'm ending the If statement before the ELSE! That's probably what's doing it.

I'm not sure why it's failing, but I'd try nesting that last "Else" under the "Else If" and then close with the 2 End-Ifs -- very similar to the rule you originally posted.

Jinx - posted same time

Ha! Yup that was it.

For the rule I posted about originally, it looks like I closed the IF properly there.

I just noticed that the rule is setting the Heat temp to 57 instead of 75 degrees so it never kicks on. I wonder if there's an issue with the new Rule Machine and my thermostat.

I'm using the GoControl Zwave Thermostat:

Ok here we go. Watching the thermostat as I trigger the rule, it's actually getting set to 75 degrees and then to 57 degrees immediately afterwards. I got some debug logs:

dev:12024-12-01 04:15:35.258 PMdebugcmd:ThermostatSetpointReport(value:[57]), desc:zw device: 02, command: 4303, payload: 01 09 39 , isMulticast: false

dev:12024-12-01 04:15:34.101 PMdebugcmd:ThermostatSetpointReport(value:[60]), desc:zw device: 02, command: 4303, payload: 02 09 3C , isMulticast: false

dev:12024-12-01 04:15:29.871 PMdebugfanOn()

dev:12024-12-01 04:15:29.870 PMdebugsetThermostatFanMode(on)

dev:12024-12-01 04:15:29.354 PMdebugsetCoolingSetpoint(60.0)

dev:12024-12-01 04:15:29.338 PMdebugsetHeatingSetpoint(75.0)

dev:12024-12-01 04:15:28.822 PMdebugheat()

dev:12024-12-01 04:15:28.821 PMdebugsetThermostatMode(heat)

So from what I see, it sets the heat to 75.0 here:

dev:12024-12-01 04:15:29.338 PMdebugsetHeatingSetpoint(75.0)

Then checks the value and it's set to 57:

dev:12024-12-01 04:15:35.258 PMdebugcmd:ThermostatSetpointReport(value:[57]), desc:zw device: 02, command: 4303, payload: 01 09 39 , isMulticast: false

This does not happen with the legacy Rule Machine, which is very very odd...

One more troubleshooting note, if I set the thermostat to 75 from the Devices page, it works as expected and sets the thermostat to 75 and stays there. Only when the app is triggered does it set to 75 and then 57 immediately afterwards.

Okay! I have been setting both a Heat setpoint and Cool setpoint in the same step. If I remove the Cool setpoint from the step, it works as expected! I wasn't setting the Cool setpoint to 57, I have no idea where that number came from. I at first thought there was some kind race condition that caused the setpoint number to be transposed (75 vs 57) but I changed the rule to 70 instead of 75 and it was still resetting the thermostat to 57.

Anyway, I split up the setpoints in two different steps and that did the trick!