Rule: received update 'source'?

@Kai I’m pretty sure this is OH2 related and not binding related, though perhaps @chris can chime in.

Is there any way to differentiate from an update whether it was called because of a poll r called because a device initiated it? For example, with my switches/dimmers, the first tap will trigger a change event (as the state has changed). However, a subsequent tap will trigger an update event…but so does polling, etc. So there’s no way to see if it’s the switch sending that information from a physical event, or if it’s sending that info because it was requested from the binding.

This makes it tricky to make some more complicated rules from the switches. What makes it even trickier is that now it seems that my switches will actually have 2 update events when they’re tapped now.

Ideally, it’d be super handy to know what caused the update from within a rule context.

This is related to OH 1 so I could be totally off base but my understanding was that a value that was retrieved by a poll like you are mentioning would be an update whereas a deliberately initiated change would be a command and that is how you would tell the difference.

Just as @rlkoshak says: If you want something to happen, you have to use commands, not state updates. So you will naturally have a command issues by a switch (be it physical or in a UI) and a resulting state update by the device (the dimmer or whatever).

If that is the case, then here is my next question. Why doesn’t my “received a command” rule trigger when I tap my switch? Here’s an example rule:

rule "TAP Entryway" when Item Switch_Entryway received command then logInfo("MasterOFF", "Entryway switch command") end

If I change that to received update, it will fire, and if I change it to changed it will fire if the state of the switch changes (i.e. from on to off) but not on subsequent taps.

If this switch is a UI, it will most certainly trigger a command.
If it is a zwave device, then it is because triggering devices are not yet properly supported in ESH.

Ah, so how it supposed to work is not quite how it works yet. That makes more sense. I gathered from the zwave logs that it’s possible, as the devices do seem to send the command in that sense (the logs showed a message).