timer-bar-card icon indicating copy to clipboard operation
timer-bar-card copied to clipboard

Using the "button" entity.

Open vtb77 opened this issue 11 months ago • 2 comments

Hi!

I want to use the button type entity and when I implement it I get a date instead of the "PRESS" button. I use this function to restart the ESPs and I wanted to use the ESP status to indicate the end of the restart instead of setting it in a fixed way.

Thanks and good job.

vtb77 avatar Jan 19 '25 16:01 vtb77

Would you mind sharing the configuration you have / a screenshot? This sounds like an interesting use case of the card, but I'm struggling to understand what exactly the card is counting down to in your setup. If there's a good use for the buttons with this card, I'm happy to add some special logic to show the PRESS button instead of the date.

You're not scheduling restarts of the ESP, are you?

rianadon avatar Jan 26 '25 01:01 rianadon

Hello:

I'll start by answering the last question. No, I am not scheduled to reset the device with ESPHome. I simply have a button to restart it in a controlled way when I press it. In the ESPHome I have the following code:

button:
  - platform: restart
    name: "${device_normal_name} Restart"

The card I currently use is the following:

entity: button.mini32_restart

When I press the "PRESS" button it is disabled while the device is restarting and when it is operational again it is enabled. The ESPHome reset takes about 6 seconds, at which point the "PRESS" button becomes active again.

Image

Image

Currently what I have done to solve it is create a script that restarts the ESPHome device ("script.mini32_restart") and I have created a card with your plugin that calls the script in a timed manner. I copy the code I use from your plugin:

entity: script.mini32_restart
type: custom:timer-bar-card
icon: mdi:restart
duration:
  fixed: "0:00:08"
tap_action:
  action: toggle
debug: false

If you need a "video" in GIF format with both buttons, tell me and I'll try to do it somehow.

Thanks and good job. I hope you can help me avoid having to use a script and make the call directly to the device with ESPHome.

vtb77 avatar Jan 27 '25 19:01 vtb77