It seems that the latest SmartThings hub firmware, version 000.047.00011 firmware version has introduced a bug when emitting an event for the temperature sensor. E.g.
device:emit_event(caps.temperatureMeasurement.temperature(20))
throws the error: Invalid value for Temperature Measurement.temperature value: {value=20} error: Required field missing: unit
NB. emitting an event for the illuminance sensor and the humidity sensor are fine.
Can someone get back to me on this as it is limiting the functionality of a production edge driver.