Hi,
I just can’t get a garage door in Hassio. My components are a switch.garagentor and a binary_sensor.garagentor. With the example from the home assistant website it doesn’t work.
What should I do?
Hi,
I just can’t get a garage door in Hassio. My components are a switch.garagentor and a binary_sensor.garagentor. With the example from the home assistant website it doesn’t work.
What should I do?
cover:
- platform: template
covers:
garage_door:
friendly_name: "Garage Door"
position_template: "{{ states('binary_sensor.garagentor') }}"
open_cover:
service: switch.turn_on
data:
entity_id: switch.garagentor
close_cover:
service: switch.turn_off
data:
entity_id: switch.garagentor
stop_cover:
service: switch.turn_on
data:
entity_id: switch.garagentor
icon_template: >-
{% if states('binary_sensor.garagentor')|float > 0 %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
Change your position_template...
to:
value_template: "{{ is_state('binary_sensor.garagentor', 'on') }}"
Position template expects 0 to 100.
Value template expects true/false. As you have a binary sensor, this is the one you want.
Also change your icon template to:
icon_template: >-
{% if is_state('cover.garage_door', 'open') %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
it works. Thank you
I also have my devices in homekit. The garage door is shown as a blind in the home app. Can i still change that?
That’s odd according to this: https://www.home-assistant.io/integrations/homekit/#supported-components
If your cover is an open/close type it should be reported as a garage door. Position types are reported as a window covering.
Try the suggestions in the troubleshooting section to reset it as it may have cached your original configuration when you were using a position template. https://www.home-assistant.io/integrations/homekit/#troubleshooting
what does that mean exactly? Is this possible with my devices?
@tom_l Could you help me here out please? Everything is working for me, except that the state is reversed… Thats my code:
cover:
- platform: template
covers:
garagentor:
friendly_name: "Garagentor"
device_class: garage
value_template: "{{ is_states('binary_sensor.garagentor', 'on') }}"
open_cover:
service: switch.turn_on
data:
entity_id: switch.shelly_shsw_1_944c34
close_cover:
service: switch.turn_off
data:
entity_id: switch.shelly_shsw_1_944c34
stop_cover:
service: switch.turn_on
data:
entity_id: switch.shelly_shsw_1_944c34
icon_template: >-
{% if states('binary_sensor.garagentor') == "on" %}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
My binary_sensor is working and showing as expected: off for closed, on for open. Here is a screenshot of my binary_sensor
The only thing that is confusing me is the attribute “on: true”, does this just define the Boolean variable for on and off, or does it say that it is always on?
Your template has an extra ‘s’. Should be:
value_template: "{{ is_state('binary_sensor.garagentor', 'on') }}"
oh man … that’s what happens when you change the example from position_template to value_template… im dumb.
Thank you mate!
mmh I do not get the status from my sensor… Did you improve this one so far? Which components did you use?