I have a garage door I am trying to control. It is made up of a binary_sensor and a switch. The sensor is the open/closed state, and the switch acts like pressing the physical button in the garage. When it is “on” the contacts are closed to start the opener, but it has to get back to the “off” state to reset.
All of this is going through an ISY994 and I have a program that will automatically turn the switch off after 1 second of being on.
I am using this switch template in my main configuration.yaml file to join the 2 controls into 1:
switch:
- platform: template
switches:
garage_door_kubota:
friendly_name: "Garage Door Kubota"
value_template: "{{ is_state('binary_sensor.garage_door_1_window_alarm', 'Open') }}"
turn_on:
service: switch.turn_on
target:
entity_id: switch.garage_door_1_binary_switch
turn_off:
service: switch.turn_off
target:
entity_id: switch.garage_door_1_binary_switch
icon_template: >-
{% if is_state('binary_sensor.garage_door_1_window_alarm', 'Open') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
I still have the independant switch and sensor displayed so I can make sure the combined switch is doing what I want (which it isn’t yet). I do get an icon of a closed garage door, but when the switch is in the “on” state, the icon stays blue instead of turning yellow. When the sensor displays “Open” the door icon doesn’t change to the open icon.
Any ideas on what I might be missing?
Thanks,
John Vickers