smarter device_variable update