Zwave Scene Number - Command or Update?

received command will only trigger on a command.

charged will trigger only if the item changes state regardless of whether the charge came from a command or an update.

received update will trigger any time the Item gets updated regardless of whether the update causes the Item to change or not. A command will usually cause an update a well.

so, unless the item in question is not configured with autoupdate=false, a received update rule will trigger for commands because the command causes and update.

that won’t work because typically NULL and UNDEF do not get saved to the database. and .previiusState just returns data from the database.

If the rule is triggered by changed, then the previousState implicit variable will have NULL if the state changed because of restoreOnStartup.

Design Pattern: Group Based Persistence could help with this.