I'm trying to notify myself when a robot vacuum gets an error. The thing i am checking is a custom attribute called currentActivity (which is a String) and I want it to send a notification when it changes to the value error
I have the trigger set to Changed and then do the check... in the screen it shows that it matches error BUT I never get the log.
I changed the code that does the sendEvent to
sendEvent(name: "currentActivity", value: activity, isStateChange: true)
and that did not help
I'm at a loss...
I think your actions need an āelseā in between each if statement?
My uneducated guess is that this is going to be some sort of syntax or typo issue. Is āerrorā something thatās selectable or could you try ācontainsā rather than = if itās a string.
thanks you both for your input...my concern with else if is that if two are in error it would only deal with the first one, right....
as is, isn't it 3 separate checks?
again I'm a novice so just asking...
regarding the "contains" , the 3rd one detects that =error is TRUE so it seems that the check matches?
Thx for the assistance!
What log? Do you have logging for this rule enabled? If so, what do Logs say?
Your actions don't have any logging, only what appears to be a notification or possibly TTS device. Does that device work if you send the "deviceNotification" command on its device detail page -- to test?
Also, you probably want these as three separate rules, unless you don't mind multiple notifications for the same device (all devices are going to be checked for a value of "error" any time the value for any device changes -- even if that device changing to "error" wasn't what triggered the rule, and even if you already got a notification for that device, for example). If you only care about notifications, a trigger on "error" instead of "*changed*" and no IF THENs necessary in your actions would be a very simple rule -- or set of rules, one for each device -- to write that sounds like a closer match for what you actually want.
But that wouldn't cause this particular problem, so knowing the above is the only way to troubleshoot and see for sure.
well i separated out into 3 and added a command to set the attribute to error and the rule machine kicks in .... unfortunately i changed 2 things ( new app and added command)
I need to get the robot to hit a real error and see if it still works...
thx for all the help!
That is good, but this was the real question in that case. ![]()
In any case, glad you appear to have it working now! If you discover problems in the future, I would start with this.
FYI there was absolutely nothing in the log.
If you hit "Done" (or "Update Rule" or "Install Rule"), there should at least be a log entry noting the initialization. If not: that was likely the problem. ![]()
interesting..... i didn't know that...
so i disabled the separate ones and reenabled the orig one and did the update rule and save and I did see inits in the log but when I did the set attribute to error from device it STILL did not work. This seems like a bug in rules machine...
What do the log entries for the rule say now?
even though it was idle (below this), i then flipped to error (lower yellow) and back to idle (top yellow)
Is this the exact same rule as above? You don't have a required expression there, but the logs say you do -- and also why it isn't triggering.




