Count number of times a door got opened

It’s not a unit conversion, it’s a type conversion.
Item.state is a state type that needs to be further converted to a number with as Number or a string(for example) with .toString

Does that make sense? I’m on the phone and can’t highlight the syntaxes.

postUpdate and sendCommand commands accept many types as arguments depending on the item type as the conversions to a valid state are done in the background.