Variable not showing correct value in rule

Hey there, I'm having a bit of trouble with a global variable in my code. For some reason, it doesn't seem to be showing up as the correct value. I've double-checked my code and everything seems to be in order, so I'm not sure what the problem could be. Has anyone else run into this issue before? Any advice or suggestions would be greatly appreciated! Thanks in advance for your help.

This is from my dashboard, it's DishRun in the bottom corner.

Here is the actual rule, the first line in the IF statement says it's False

I can confirm I have 5 notifications on my phone.

"Did the dishwasher start" at 10:39 (x2), 10:44, 10:49
then
"The dishwasher check is being cancelled" 10:49

So some duplication, but only heard audio twice. I do see that line 2 can be removed to get rid of the first duplication, actually I feel this rule written in a bad way, but it's the variable I"m confused by.

I would first confirm that the variable is indeed set to false on the variables page then refresh the dashboard. Other than that I've no clue sorry.

I'd be more skeptical of the dashboard showing the correct value than the rule. I'd look at the source of truth, the actual variables page, to confirm which one is right.

2 Likes

Ok thank you for the feed back, I ran out of time that following morning to do any testing, but live testing last night, where I shut it down BEFORE the rule was running, saw the live variable update and the rule reflect this, so never ran. Will continue to test further.

Ok I"m back and here is the update, I waited for the rule to run, give it 2 times before I got up to deal with but clicked to update the variable, as seen below from the main settings.

image

The following is the rule again and captured AFTER the variables, this clearly shows the variable as False, whereas I see it as True

I am confident I will hear another warning of it being cancelled. Yes, I have not cleaned up the code as of yet.

Can you reproduce the problem if you manually update the variable? My inkling is rule corruption or a bug. If you can reproduce, turn on logging for the rule, toggle the variable, and then post the logs. Also, grab a screenshot of the variable change from the "Location Events" tabs on the logs page.

1 Like

Hey there... yes manually affecting the variable sees the above rule affected and shows the correct values. I reset the variable and turned on logging (3 statuses) for the rule that updates things. Then proceeded to run as per usual.

The events are completely empty for this log, so some type of corruption would seem to be correct. Here is the output from the logs for this rule.

Could you post the full rule including any required expressions and triggers?

Here is the entire rule, it's very simple. I either double-push a physical button, but would scan an NFC tag.

1 Like

What about the main rule that's the issue?

Can you show the whole rule and verify that logging is turned on? Your rule for setting the variable appears to be working correctly. Only anomaly I see is that the variable was updated twice after the button press.

Ok I just double pushed the sonoff button, and checked the variable, both dashboard and main settings show true (as expected).

image

and here is the main rule again, now it's telling me it's as it should be.

I am going to reset this , and wait for the time check to happen as that's where it seems to fail. Could the fact the rule is running be preventing the update?

Ok I did reset the variable to be False, waited for the trigger to go off. I double clicked, verified the variable table showed correctly, then checked the rule and it was correct this time, I can see the rule reset itself and set the local variable "TimesRun" to 0. I can't explain why this is different than the other day. I fee like my HE has been testing my patience, but we are hopeful it gets back to normal sooner than later.

I do thank you for looking into this with me.

Brett

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.