Mark,
Works like a charm! It now detects charging status and SOC correctly. Please see the logs attached with all situations you suggested.
Patrick