This is excellent. And what is best, that it remembers state between HA restarts.
Now the problem is that my covers are RF based, and there are 3 separate RF codes needed for each cover: one for up, one for down and one for stop (the RF codes can be sent out through MQTT via an RF bridge running Tasmota). I tried making mqtt switch with ON state or up code and OFF state for stop code, and respectively for down/stop code, but it doesn’t work because when I hit up arrow in lovelace it just moves a bit then stops.
But looking through your code this can be modified easily.
Edit: Since I moved the time-based functionality to an ESPHome node, which works much better as it’s being done in hardware, I’m archiving this repository and stop maintaining it.
Anyone feel free to fork it and continue development as needed.
You have to set RF-sending scripts to open, close and stop the cover.
For example, you can use an RF-Bridge running Tasmota firmware to send out RF codes, with RF-based motor roller shutters to do this.
For proper icon display (opened/closed) customization can be added to configuration.yaml based of what type of covers you have, either one by one, or for all covers at once:
Great work everyone. Finally we are starting to see a complete timed cover component. One thing: I use broadlink component to open, close and stop my covers. Is there a way to incorporate these either by making the cover_time_based have a stop switch or for cover_rf_time_based to call services so that a switch can be called without creating scripts for each action.
Thank you.
edit: After some testing with the cover_rf_time_based component I must say that this is a great addition to homeassistant. The cover state changes only after the curtains are fully opened or closed. The slider moves accordingly in real time. Both down and up buttons are always available during an ascend or descend. This is just perfect. Thank you @robi and @davidramosweb
I also thought that it would be great to be able to specify some services directly.
But going through Davis’s code made me realize that the requirement to create the scripts is a way to stimulate people to adapt the component to their custom requirements straight in Home Assistant, without the need to learn programming in Py. One can create a script for anything. You can have any customly developed thing over there to move your curtains which easily embed in your script and then hook it into the time based cover component. You can even embed automations into scripts etc. this gives best flexibility.
There are literally dozens of cover-moving systems out there which weren’t designed originally to be integrated into a smart home system, it’s nearly impossible to create a custom component for each type. Now this is a more universal solution for such cases.
A bit of update on the rf version: removed (commented out) stopping in auto_stop_if_necessary because that prevents sending out the trigger again if needed. Sometimes it may happen that due to RF interference the signal is not received by the cover, and since there’s no feedback from the cover itself, HA will assume the cover changed state while this might not be true. In such cases the user wishes to send out the trigger again, this was followed by a stop until now.
(this came from the double-switch approach, there it was required, here it is not).
First, I want to thank you both for your custom_component.
I’m trying to install it, I need RF version because I have 3 switchs. I write the example configuration, but I receive this error. I’ve tried to change indentation, but doesn’t work.
Hi all
Can someone explain a bit more what this component does? I just tried to go to github but it is not working right now.
I have an awning which is working with a tuya wifi gang. It only reports open and close status though and if it is half opened the state is known. What I am missing is to know how much the awning is opened, as a percentage or even as seconds. For example if the awning is completely open then to report 100% or 30 seconds and if it is half opened 50% or 15 seconds.
Except from the above is there anything else that this component would offer in my setup?
It is intended for covers which do not report back anything. Their status is assumed by the last commands which were issued. One has to measure the time the cover needs to open and close respectively, thus Home Assistant can assume based on the time passed between the commands (say open and then stop) the percentage the cover is opened. And vice-versa, setting a position through Home Assistant will do nothing else than send a stop command after the corresponding percentage of time has passed since the open command.
As long as you can control your awning with open/close or open/stop/close commands, you can use this component. But it won’t take in account the real state reported by your switches.
Aliases is optional. If you don’t want to let Home Assistant name the entity_ids of your covers by your friendly name, but want to enforce your own entity_id name.
The fix broke positioning, so I made a different approach. Update cover.py, delete __pycache__ folder and restart HA (RF version).
Also added to debug logging the cover names so we can differentiate in the log which cover does what.
Thank you for this.
I’ve been struggeling with cover templates the last few days and just couldn’t find a way to make the cover aware of it’s position.
Is it possible with your custom component to set the cover to a specific position? I use it to control my shades and sometimes I would like them to go down for about 50%. If so, could you give an example on how to do this?
Edit:
Okay, just tried it out and it’s worting great so far!
And I noticed the slider when clicking the entity.
Now I have to figur out how to get the slider on the dashboard, below the cover buttons…
(Any pointers apreciated!)