Entity button card error

Is it possible to use this inside an entity-button card?

          - type: entity-button
            name: Prova Luce
            icon: mdi:lightbulb
            tap_action:
              action: call-service
              service: light.xiaomi_miio_set_scene
              service_data:
                entity_id: light.philips_5
                data:
                  scene: '4'                
            entity: light.philips_5

I get error…

Remove the hyphen at the top.

No, the error is about the data entry…

So you get the error when you press the button? Try removing data: and align scene: '4' with entity_id: above. I don’t think you need data: for a service call in a lovelace card since service_data: is already required.

Yes, it works… Thanks!

With the entity-button card is it possible to have more than one service-call entry?
What i would like to have is the chance to toggle the light and also (when the light is on) to choose between scenes… I don’t think it could be possible but i try to ask… :slight_smile:
Which can be a card to do this?

Nope, you’d need separate buttons for that. Alternatively, you could create an input_select and use those to trigger automations based on which value you select in the card.

1 Like