I’m wondering whether it’s possible to determine, which of the two cron expresions (or more generally, which triggers.id) has triggered the rule. (Of course triggers.id doesn’t work, otherwise, I wouldn’t have asked )
To my knowledge, but that might have changed since my last update, cron does not give you an event.itemName type of trigger.
But you can use the following in your code:
this.event === undefined in combination with this.event = undefined
The code will then trigger if the event is undefined (which for cron is the case) and reset after the code did run to undefined.
I use this methodology based on this previous discussion.
Above will only help though with one cron trigger, not be able to decide which of the two triggered.
You could do that though maybe with a if clause that looks into the timestamp?
The short answer is no. If you have two time based triggers, there is no way to distinguish which one triggered the rule. You also cannot tell the difference between a time based trigger and a manual trigger.
You can tell the difference between an Item/Channel/Thing trigger by testing for what variables are defined on event like @chrismast mentions.
That’s actually not the case in UI rules and it’s a source of consternation. I’m not sure what to do about that yet. But in the UI, you get the raw event, same as you’d get in the JSR223 type rules (Nashorn, Jython, etc.). I don’t like it when it works that differently.