Device:emit_event - bug introduced in hub firmware 000.047.00011

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.

1 Like

Hi Wesley, do you know if there is a workaround for this bug? I.e. by supplying a value for the unit.

That’s the only solution.

How would I modify the code below to supply a value for the unit?

device:emit_event(caps.temperatureMeasurement.temperature(20))

device:emit_event(caps.temperatureMeasurement.temperature({value=20,unit="C"}))

Thanks @w35l3y! your coder works a treat. Thanks very much :ok_hand:

1 Like