custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.97k stars 242 forks source link

How to turn_on switch on tap_action? #670

Closed Bagunda closed 1 year ago

Bagunda commented 1 year ago

Checklist

Describe the bug Failed to call switch/turn_on service. must contain at least one of entity_id, device_id, area_id.

Version of the card Version: 3.4.2

To Reproduce This is the configuration I used:

type: custom:button-card
entity: switch.shtora_spalni_target_position_0
show_name: false
tap_action:
  action: call-service
  service: switch.turn_on
  service_data:
    entity_id: switch.shtora_spalni_target_position_0
color_type: card
color: rgb(66, 134, 244)
icon: mdi:eye-off-outline

Screenshots image

Expected behavior Based on the documentation and examples, this should have worked. Although this is not the case in the examples.

Desktop (please complete the following information):

Mariusthvdb commented 1 year ago

please update to 3.5.0 first and then check again? syntax seems correct, so maybe the incompatibility issue going on