Not sure of the brand of lock you are using, but I have 2 Kwikset locks, and they do not update the state when you lock and unlock them manually, however, my locks have the following sensors that are updated on all changes:
Front Door Lock (sensor.kwikset_touchpad_electronic_deadbolt_alarm_type_44)
Back Door Lock (sensor.kwikset_touchpad_electronic_deadbolt_alarm_type_45)
If the lock is locked by pressing the button on the keypad, the state of the sensor is ‘18’, if it is unlocked by the keypad, the state is ‘19’, if it is manually locked by turning the latch, the state of is ‘21’, and if it is unlocked manually by the latch, the state is ‘22’, and finally, if it is locked by Zwave, the state is ‘24’ and unlocked by Zwave the state is ‘25’
So, home assistant only gets notified of changes when it is locked and unlocked by Z-Wave, so that only covers alarm_type ‘24’ and ‘25’.
So I had to create an automation that monitors the alarm_type sensor on each of the locks, and if the alarm type changes to ‘18’ or ‘21’, I issue the lock.lock service call, even though the lock is already locked, it will change the alarm_type sensor to ‘24’ and thus home assistant will see it as locked.
And just the same, if it changes to ‘19’ or ‘22’ I call the lock.unlock service, so the sensor will change to ‘25’ and Home Assistant will see it as unlocked.
It seems like a lot of work, but really it can all be done in one automation and you never have to worry about it again.
Again, I am not sure what locks you are using, but I am sure other brands have a similar sensor. But if you are using the Kwikset locks, just use the following alarm_type states to know the status.
‘18’, ‘21’ and ‘24’ all mean Locked
‘19’, ‘22’ and ‘25’ all mean Unlocked
I do not believe this is the fault of Home Assistant, but rather I think it could be an Openzwave problem, perhaps with an incomplete profile for the locks, or perhaps it is a manufacturer issue where kwikset is not sending the status value but only updating the alarm_type sensor, but either way, the State value is not being sent to Home Assistant unless it is locked and unlocked by Z-wave.