Last event device question

Apparently the Last event device gets passed to another rule but you can't use the Last event device condition to check it. Is this expected behavior?

Rule "Test" triggers on virtual switch turned on.

The above rule then runs the rule "Test1".

The log.
Line 1 shows the device turning on(dev1110)
Line 2 shows %device% and %text% from rule Test(app 1094).
Line 3 shows the %device% from rule Test1(app 1262)
Line 4 shows The Else condition from rule Test1 was executed. Last Event Device not on in rule Test1.
Line 5 shows the IF condition was executed from rule Test. Last Event Device was on in rule Test

Edit: my error.
Where is the definition of Last Event Device?

Is it local?

Also, %device% in Rule Test1 is the trigger device for Test1, which has no trigger, so that won’t get set. Perhaps it’s state hanging around from a previous version of Test1.

When you set up last event device you tell it what type of device you want it to look at. Set Exemplar device is the phrasing they use.

I realize the device in Test1 is from rule Test that is the question. If you run a rule from another rule the last trigger device gets passed through. Since it does I assumed you could use the last event device command, but apparently that is not the case. I just want to know is it a bug or will I need to rethink how I use this. @bravenel

Edit:
I don't believe am not aware that is the case.

What gets passed is the last event name, value and time. The device is not passed.

The device could be passed, so that the called rule could do Last Event Device on it. That would be easy to add.

2 Likes

Okay, first time I have needed to do this, I had used the last event name in other rules that was passed over from another rule I can do it that way here, I just thought the last event device would save having to create additional variables to test.

Last event device has very limited and specific uses. But, next release will pass it along...

2 Likes