I have a kwikset deadbolt and I have the lock and unlock commands working on the home screen.
Although, when you unlock the lock manually, it does not display the correct state on the toggle switch.
So I noticed,
lock.kwikset_touchpad_electronic_deadbolt_locked_10_0 is the state which is locked
sensor.kwikset_touchpad_electronic_deadbolt_alarm_type_10_0 = 22
which means locked and 21 means unlocked.
What I would like to have:
the toggle on the homescreen of HA when the sensor state is 22 the toggle is switched to the locked position and vice versa with 21 and the toggle still unlocks/locks the deadbolt. Is this possible?
or what I could live with:
a way to change the sensor bubble sensor.kwikset_touchpad_electronic_deadbolt_alarm_type to locked instead of 22.
trigger:
platform: state
entity_id: sensor.kwikset_touchpad_electronic_deadbolt_alarm_type
to: ‘22’
action:
platform: state
entity_id: lock.kwikset_touchpad_electronic_deadbolt_locked_10_0
to: ‘locked’
- platform: template
sensors:
bdlockstatus:
friendly_name: 'Back Door'
value_template: >
{% if is_state('sensor.back_door_alarm_type_2_0', '21') or is_state('sensor.back_door_access_control_2_9', '1') %}
locked manually
{% elif is_state('sensor.back_door_alarm_type_2_0', '22') or is_state('sensor.back_door_access_control_2_9', '2') %}
unlocked manually
{% elif is_state('sensor.back_door_alarm_type_2_0', '18') or is_state('sensor.back_door_access_control_2_9', '5')%}
locked with keypad
{% elif is_state('sensor.back_door_alarm_type_2_0', '19') or is_state('sensor.back_door_access_control_2_9', '6') %}
unlocked with keypad
{% elif is_state('sensor.back_door_alarm_type_2_0', '0') and is_state('lock.back_door__2_0', 'locked') %}
locked with Home Assistant
{% elif is_state('sensor.back_door_alarm_type_2_0', '0') and is_state('lock.back_door__2_0', 'unlocked') %}
unlocked with Home Assistant
{% else %}
{{ states.sensor.bdlockstatus.state }}
{% endif %}
Automations will not set the state of the lock. You could use something like this:
- alias: Back Door Locked With Keypad
trigger:
- platform: state
entity_id: sensor.kwikset_touchpad_electronic_deadbolt_access_control_10
from: '2'
to: '5'
- platform: state
entity_id: sensor.kwikset_touchpad_electronic_deadbolt_alarm_type_10
from: '22'
to: '18'
action:
- service: lock.unlock
entity_id: lock.garage_door_locked_11_0