Volvo on Call: how do I access lock status in a script?

Am new to Home Assistant, so apologies if this is straightforward…

Am writing some basic scripts to check the status of things before going in to ‘Night Mode’. Mostly working, though I’m sure there’s a brilliant way to do this with templates etc.

While the VoC reports the status ‘Locked’ or ‘Unlocked’ in the standard Lovelace entities card (binary_sensor.xxxxx_door_lock), I can’t seem to access the value through a Script.

Should I somehow turn the entity / value into a device or variable, is am I just reading the value wrong?

Thanks in advance!