But even when this evaluates to false, the sensor always shows Locked. I tested evaluating {{ is_state(âsensor.computer_lastsystemstatechangeâ, âSessionLockedâ) }} in the dev tools and it evaluate to false, so I guess it should be UnlockedâŚ
A binary_sensor with device_class: lock will show as unlocked when the state is on. This can be seen here:
Edit: whenever you are debugging template sensors, make sure you utilize developer tools â states, instead of looking at various screens in the UI. The âstatesâ page will show you the actual state of the entity instead of the âtranslatedâ state that the frontend uses. If you look at your new template sensor on that page, you will realize your template is doing what you expect.
Thanks for the quick reponse, unfortunately even when I change my condition to ânotâ state: '{{ not is_state("sensor.computer_lastsystemstatechange", "SessionLocked") }}', the binary_sensor doesnât update when lastsystemstatechange changes to SessionLocked.
When looking in developer tools for the history of state changes for computer_lastsystemstatechange, here is what I get where the yellow is when I locked my computer.