Hi
I have a GPIO switch that open the gate of my house. I want to set it as a lock.
Usually I use the homekit to control my home.
I saw the Lock Template in home assistant examples, but I didn’t succeed it.
This is my code:
switch:
- platform: rpi_gpio
ports:
18: relay1
23: relay2
24: relay3
25: relay4
lock:
- platform: template
name: Gate
value_template: "{{ is_state('switch.relay4', 'on')}}"
lock:
service: switch.turn_off
target:
entity_id: switch.relay4
unlock:
service: switch.turn_on
target:
entity_id: switch.relay4
I can’t see the Gate as a lock in home assistant and can’t see it in home kit.
HELP?