You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to build a button-card with embedded button-cards to control a esphome cover.
My final goal ist to create a button-card-template, but first things first :-)
tap_action is set to stop cover motion, double_tap_action to open it.
The hold_action is used to call a script on the esp starts opening the cover, waits 250ms, then stops the cover.
The script is set to restart when called repeatedly. That means that as long as the hold_action reruns the script fast enough, the cover stop command will not be reached. Therefore the cover is moving as long as the GUI-button is pressed.
Using this method is safer because it does not depend on a stop command from HA coming though.
There is only one embedded up-button in the moment to keep it simple, and the actions of the container button are only in place to demonstrate the differing handling of repeat in the embedded button.
Both buttons work as described ... mostly.
Holding the embedded button down runs the script only once, resulting in the Icon color of outer and embedded button flashing to yellow and the cover moving only for 250ms.
If the icon color change code in the embedded button is removed, repeat work for the embedded button.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to build a button-card with embedded button-cards to control a esphome cover.
My final goal ist to create a button-card-template, but first things first :-)
tap_action is set to stop cover motion, double_tap_action to open it.
The hold_action is used to call a script on the esp starts opening the cover, waits 250ms, then stops the cover.
The script is set to restart when called repeatedly. That means that as long as the hold_action reruns the script fast enough, the cover stop command will not be reached. Therefore the cover is moving as long as the GUI-button is pressed.
Using this method is safer because it does not depend on a stop command from HA coming though.
There is only one embedded up-button in the moment to keep it simple, and the actions of the container button are only in place to demonstrate the differing handling of repeat in the embedded button.
Both buttons work as described ... mostly.
Holding the embedded button down runs the script only once, resulting in the Icon color of outer and embedded button flashing to yellow and the cover moving only for 250ms.
If the icon color change code in the embedded button is removed, repeat work for the embedded button.
I'm not sure if this is a bug or a feature.
Update
replacing
with
does the job ... even in the templated version
updated update
sadly the "workaround" only works for state related formating.
changing background style based on entity.attributes.current_position also brakes hold_action repeat in the embedded card
update end
esphome
Beta Was this translation helpful? Give feedback.
All reactions