How to create two sensors for last changed for a lock sensor which have two values

Home Assistant doesn’t have a service to set a sensor’s state. To circumvent this limitation, someone create a python_script called set_state.py that allows you to set a state (or an attribute).

To use it, you will first have to install the python_script integration.