2.You don’t actually need the {% else %} but I would normally use it to be safe
1.Not sure if it will work. you may need to use the `to_state", e.g. something like this:
Ok, I tweaked it one more time, and added a condition
- alias: Keypad One Time Use for codes 16 through 18
trigger:
- platform: state
entity_id:
- sensor.lock_front_door_deadbolt_alarm_level
- sensor.lock_back_door_deadbolt_alarm_level
- sensor.lock_garage_door_lock_alarm_level
condition:
- condition: template
value_template: '{{ trigger.to_state.state | int > 15 }}'
action:
- service: script.turn_on
entity_id: >-
{% set code_slot = states.trigger.to_state.state %}
{{ 'script.door_keypad_' ~ code_slot ~ '_delete' }}
I’ve been pulling ideas and scripts from a various posts on here related to zwave door locks. After I test this and a bit more of the package I’ll post it on here.