Last Event Device not tied to selected device


In Rule Machine 4.0 It seems when creating a condition with the "Last Event Device", the selected device is ignored.

Created a few global variables for different switches.
Created this below rule where each condition is defined with the "Last Event Device" capability and device selection for each is set to match one of the trigger devices.
Any time I trigger any of the defined trigger devices, all all conditions are triggered for the on or off state respectively.
All "Last Event Device" entries are also listed in the overview without any reference to the selected device.
When trying to edit any of the "Last Event Device" conditions, the previously selected device is not presented.

Doesn't seem to matter if I change triggers per above or below, which to my knowledge is how it should be :slight_smile:

Seems there is a missing reference here, or the device selection should be removed if it's not meant to be part of this functionality.
If the latter is the case off course there is a workaround of creating separate rules with triggers only for the desired device. This does put some limitations or complications on the ease of creating this type of rule though.

Am I misunderstanding the use of this capability and/or making some obvious mistake?


1 Like

Since installing the (from update today I noticed not even my workaround of creating separate rules for each device is no longer working.
I am not sure if this broke or changed in any of the releases,,, though, as I created the now still working rules in
The ones I created before installing the updates are working, however creating new ones trigger with the below error in the logs.

Cloning an existing working rule for another switch, keeping it configured for the same switch, results in the cloned rule not triggering at all and no log entries except for the device events.
Cloning an existing working rule for another switch and updating the trigger, conditions, actions to another switch, result in the cloned rule not triggering at all and no log entries except for the device events.

I'm not sure how else to work around this issue with the "Last device event" capability at this point.
Any pointers?

@bravenel going back to an old thread as I have the same issue as the OP. I'm trying to understand the Last Event Device

The first two conditional actions of this rule are associated with a virtual switch zVS3: zVS3 on and zVS3 off respectively. The last two conditional actions are associated with a virtual switch zVS4: zVS4 on and zVS4 off respectively. You can't tell by how the condition is displayed but I've built the rule twice and am confident I have it correct.

The rule runs but when I try to edit the action I get:

If I swith on zVS3 both conditional actions for zVS3 on and zVS4 on become true. Similar if I switch zVS3 off both conditional actions zVS3 off and zVS4 off become true. Is this a bug? Additionally, can the condition for Last Event Device be updated so the associated device is displayed?

The last event device is set when a rule is triggered, to the device that caused the rule to trigger. I'd like to see the error in the logs.

Your rule as written makes no sense, as it does not discriminate in any way between the two devices, only that the last event device (which ever it was) is on or off.

1 Like

Perhaps I'm applying this wrong. When setting up the Last Event Device you are given the Capability Last Event Device and are asked to Select exemplar device. Is this not the device you would compare against the Last Event Device? i.e. Last Event Device was zVS3 turning on

Edit - I didn't really pay attention to "exemplar." I saw the list and assumed it was the device to compare against the Last Event Device. I see now that the exemplar device sets which attributes are selectable. I have a better understanding of how to use this now.