ABnSultan
(ABnsultan)
August 13, 2020, 6:06pm
1
hello, I have two entity one is Broadlink rf to open the garage and the other one is a contact sensor to know the state of the garage open/close
i want to combine them to looks like this image, notice bottom right corner with a click I can open and close the garage while knowing its state.
is there’s a way to achieve that?
it’s easy to achieve that in Lovelace but when using Homekit Bridge it’s a different story
tom_l
August 13, 2020, 6:13pm
2
Have you tried a template cover?
ABnSultan
(ABnsultan)
August 13, 2020, 7:15pm
3
i did after reading your comment never knew about such thing
here’s my code
cover:
- platform: template
covers:
garage_door:
friendly_name: "Garage Door"
position_template: "{{ states('binary_sensor.contact_garage') }}"
open_cover:
service: switch.toggle
data:
entity_id: switch.switch_garage_door
close_cover:
service: switch.toggle
data:
entity_id: switch.switch_garage_door
icon_template: >-
{% if states('binary_sensor.contact_garage') == "on"%}
mdi:garage-open
{% else %}
mdi:garage
{% endif %}
it work on my lovelace but on homekit it show the state of the switch not the sensor
does my code need changing?
tom_l
August 13, 2020, 7:38pm
4
Replace this:
position_template: "{{ states('binary_sensor.contact_garage') }}"
With this:
value_template: "{{ is_state('binary_sensor.contact_garage', 'on') }}"
The position template requires a number from 1 to 100. The value template is used with binary on/off open/closed sensors
ABnSultan
(ABnsultan)
August 13, 2020, 8:35pm
5
thanks, but the main problem still the same it show the state of the switch not the sensor
tom_l
August 13, 2020, 8:48pm
6
It shouldn’t. The template determines the state. Maybe there’s an issue with the template cover. This person is having the same issue:
What if you replace the value template with: '{{ false }}'
Does the cove change to closed?
Is your sensor on or off when the cover is open?
ABnSultan
(ABnsultan)
August 13, 2020, 9:00pm
7
yeah just tested opening the sensor do change to open and closing change to close
but when clicking it will change from open to close even though the sensor is open
but when closing the sensor the state remain close so that a good thing
now that i know the sensor do change the state how can i disable the switch from changing the state XD
tom_l
August 13, 2020, 9:08pm
8
As I said, the switch should never change the state, only the value template should. There could be an issue with the integration. You can open an issue here:
Tekka90
(Tekka90)
August 14, 2020, 7:40am
9
FYI, I created an Issue as suggested by tom_I.
opened 07:36AM - 14 Aug 20 UTC
The problem
First I'm using 0.113.3 instead of 0.114.0 because the last one is not working with my rfxcom (I guess this...
Please add any additional info you might have