You are missing the quotes from the example
// this
'value' => $lagenhet->ID, // matches exactly "123", not just 123. This prevents a match for "1234"
// should be
'value' => '"'.$lagenhet->ID.'"', // matches exactly "123", not just 123. This prevents a match for "1234"