nervetattoo / banner-card

A fluffy banner card for Home Assistant 🥰
MIT License
609 stars 57 forks source link

How to call a scene as a button? #127

Closed Yarden92 closed 3 years ago

Yarden92 commented 3 years ago

My Tuya double curtains isn't reflected correctly to HA, so I've created Tap-To-Run methods on my Tuya which are reflected as scenes in HA:

scene.open_blinds
scene.stop_blinds
scene.close_blinds

and so if I call a service (from Developer Tools) such as:

service: scene.turn_on
target:
  entity_id: scene.open_blinds

this will open up (both) my blinds

how can I add this to the banner card to get a button for it like this:

I've tried these without luck:

Test1 (doesn't work):

  - entity: scene.open_blinds
    name: open blinds
    value: hass:arrow-up
    action:
      service: scene.turn_on
      target:
        entity_id: scene.open_blinds

Test2 (doesn't work):

  - entity: scene.open_blinds
    name: open blinds
    value: hass:arrow-up
    tap_action:
      action: call-service
      service: scene.turn_on
      service_data:
        entity_id: scene.open_blinds
rosskyl commented 3 years ago

I've got this that works for me.

  - action:
      service: scene.turn_on
    entity: scene.night_time
    value: mdi:bed-empty
Yarden92 commented 3 years ago

@rosskyl Nice thank you very much that worked!