Lovelace entity-button

Trying to use an entity button for my garage door but it’s not executing the service…

Tried this:

          - type: entity-button
            tap_action: call-service
            service: switch.turn_on
            entity: switch.sonoff51083

and this:

          - type: entity-button
            entity: switch.sonoff51083
            tap_action: toggle

But it does not trigger the switch…

This one works but it’s a toggle, not a button:

          - type: entities
            title: Security
            show_header_toggle: false
            entities:
              - switch.sonoff51083

What am I missing here?

Try

tap_action:
  action: toggle

I ended up with this in case it helps someone else…

          - type: entity-button
            entity: switch.sonoff51083
            tap_action:
              action: call-service
              service: switch.turn_on
              service_data: 
                entity_id: switch.sonoff51083
1 Like

That’s odd. The documentation doesn’t reflect that yaml shape. Is that 84.0b format?

Yes… sorry… I should have said that - I wasn’t sure it was a new change in 0.84 as I had never used that type of button before.

Hey, thanks for posting this. I was going crazy trying to figure out why my buttons were making all my lights go haywire after the update. Turns out that with the old yaml structure for the entity-button, it wouldn’t throw any errors until you pressed triggered it, causing some kind of trigger loop that made the scene fire repeatedly, or at least thats what it seemed like. And there I thought I had read all the breaking changes carefully and thought of everything when updating my config… :sweat_smile:

I guess the new format makes sense now that I’ve read through it a couple times, but it sure seems like an awful lot of text now just to trigger a scene! That being said, it does look like it’s a lot more flexible and powerful in terms of what you can assign it to do, so I guess with great power comes great responsibility?

1 Like