Combined Lock Entity?

I’m very new to yaml, so bear with me…Is it possible to create a sensor/entity that’s a combination of a sensor and a lock status. I have a yale YRD 256 lock. One of the entitys (lock.lock_front_door) will report if the door is locked or unlocked…and another sensor (binary_sensor.lock_front_door_access_control_locked_jammed) will report if the lock is jammed or not. It’s a combination of a door lock and door open sensor.

My goal is to create a sensor that I can view on my lovelace dashboard that will report the status of the door:

  • “Open” when door sensor is open
  • “Locked” when door sensor is closed and door lock is locked
  • “Jammed" when deadbolt isn’t seated properly.

Any guidance would be appreicated!

Probably something like:

{% if states('binary_sensor.lock_front_door_access_control_locked_jammed') == 'on' %} # or should it be off?
   Lock is jammed
                        
{% elif states('lock.lock_front_door)') == 'locked' %}
    Locked
                        
{% else %}
    Unlocked
                        
{% endif %}

Thanks! Is this code for a template sensor?

Yes that is correct

1 Like
1 Like