Hi,
not sure, if this question is still open.
Would be great, if you could paste the full code line, that is not working correctly.
I would assume, that this should work:
set LCD_Driver line 20.0 { my @a = split( " ", ReadingsVal( "SolarCharger", "state", "default");; if( @a >= 3 ) { return( $a[2] ) } else { return( "default" );; } }