What triggered the event my app just received?

Interesting discussion :slight_smile:

Seems you've got a reasonable workaround, but thought I'd throw this out anyway.

Does device.updateDataValue() work from an App?

It was mentioned here - Device routine returns null - that you can manipulate a device Data object (update / get) from an App. Not sure if that's just getDataValue() though or whether you can write to it ....

If you can then couldn't you set something in there each time the device is updated from your App to show what events you want to ignore afterwards. Then ignore any subsequent events until it's cleared?

MQTT Status Change ON, 50% ->
virtualdevice.updateDataValue("MQTTEvents", "ON, 50%")
virtualdevice.on()
virtualdevice.setLevel(50)

Then as the events come back from the Virtual Device compare them to what you've stored and remove them until there's none left. When there's none left, or a non-matching event comes through, you know that this was from somewhere else and you should send a CMD out.

(I've not played with HE Groovy for a while so this may be b0ll0x in which case just ignore it)