Finally got my garage door opener working with current version of localtuya (3.2.2)
I have the Wofea controller. It only has 3 DPs, 1, 7 and 101.
1 and 101 are both false when closed, true when open and 7 is always 0.
In localtuya integration UI I added DP 1 as a switch, ignoring current etc.
I added DP 101 as a binary sensor for open/close detection. While I could probably just use DP 1, when I toggle the switch it will momentarily switch back until it realises it is still in the open or closed position so the icon in HA UI does as well. Cleaner to use 101.
In my configuration.yaml I added the following cover template:
cover:
- platform: template
covers:
garage_door:
device_class: garage
friendly_name: "Garage Door"
value_template: >-
{% if is_state('binary_sensor.garage_door_status','on') %}
Open
{% else %}
Closed
{% endif %}
open_cover:
service: switch.turn_on
data:
entity_id: switch.garage_door_switch
close_cover:
service: switch.turn_off
data:
entity_id: switch.garage_door_switch
stop_cover:
service: switch.toggle
data:
entity_id: switch.garage_door_switch
icon_template: >-
{% if is_state('binary_sensor.garage_door_status','on') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
I donât use the switch or binary sensor in the UI but I did customise the sensor as a garage_door so would show as Open or Closed instead of on or off anyway.