in the template check in developer tools, it shows the state correctly, but not in the binary sensor?
I want it in a binary sensor, as I don’t want it to be able to lock/unlock in that card, only show the state.
Make sure your code is under binary_sensors:NOTsensors:
Your lock state will return locked or unlocked, which is not a valid state for a binary_sensor (on/off)
You therefore need to adjust your template as such (assuming on means unlocked here, amend as necessary)