Clooos / Bubble-Card

Bubble Card is a minimalist card collection for Home Assistant with a nice pop-up touch.
MIT License
1.44k stars 39 forks source link

button entity's do not toggle as intended #496

Closed ElDingo424 closed 1 month ago

ElDingo424 commented 2 months ago

Problem: add button entity and set action to toggle (Same as you would using standard button card)

Code:

     - entity: button.living_room_speaker_on_2
        name: false
        icon: mdi:power-on
        tap_action:
          action: toggle

Throws error:

Service button.turn_off not found

Clooos commented 2 months ago

Hi, as a temporary workaround you can use the button.press service instead of toggle, but I will change that.

ElDingo424 commented 2 months ago

I was able to get it to work, but found I also had to call the entity again as a target. Using just the button.press service also errors.

   - entity: button.living_room_speaker_off
                        name: false
                        icon: mdi:power-off
                        tap_action:
                          action: call-service
                          service: button.press
                          target:
                            entity_id: button.living_room_speaker_off
Clooos commented 2 months ago

Yes indeed you need to add the entity_id when you use a service, this is normal. I'm glad that I helped, but like I said I will add the possibility to use toggle for the button entity as well.

Clooos commented 1 month ago

Hi again, I've reconsidered what I've said, the toggle action is exactly the same HA use and the way you did it is the right way to achieve that.