Apologies for resurrecting this topic, but is this custom component still a working solution 2.5 years later?
I’ve finally updated my Home Assistant and have also updated the code in the repo to work with the newer versions ( 2023.11.3).
This is great, thank you. I’m also running a setup with just one magnetic reed sensor for closed and with your component I’ve got this faking the opening and closing status.
This is the code that I’m using:
cover:
- platform: pcc
covers:
garage_door:
device_class: garage
friendly_name: "Garage Door"
unique_id: garage_door_cover
# travelling_time_down: 17 #not needed with closed sensor
travelling_time_up: 15
value_template: >-
{{ is_state('binary_sensor.garage_door_garage_door_contact', 'on') }}
open_cover:
service: switch.turn_on
target:
entity_id: switch.garage_door_trigger
close_cover:
service: switch.turn_off
target:
entity_id: switch.garage_door_trigger
stop_cover:
service: switch.turn_off
target:
entity_id: switch.garage_door_trigger
Two things that I’ve noticed:
- While home assistant is booting, the cover shows as
open
whilebinary_sensor.garage_door_garage_door_contact
isunavailable
. I would have thought the template would return false in that condition. travelling_time_up: 15
seems to overridevalue_template:
- I can see this by closing the door shortly after opening it. The state stays asopening
for the full 15 seconds, then goes straight to closed.
Great custom component, maybe this can be done with the template platform but I wasn’t able to achieve it - thankyou
For anyone using this in late 2024. ( me, I just started using it. =) )
Noted that when I tried to use it the PCC-entity was not created.
Found in the logs that it had some deprecation warnings and was not thread safe.
Created a pull request that solves these issues and now the entity is created successfully.
Removed SUPPORT_* will be deprecaded in 2025 warning
Note: There is still a unfixed issue when restarting HA that I did not solve (noted in the pull req).