Automatic scene Activation

Hello,

using a dashboard button I am calling a scene from HA to VeraPlus, however, it asks me to activate the scene manually - is there any way to avoid this, so after pressing the button the scene runs directly?

For instance, I am using this code, but would prefer to run it via custom:button card

      - type: button
        show_name: true
        show_icon: true
        icon: mdi:blinds-open
        entity: scene.roleta_loznice_100
        name: 100%

Snímek obrazovky 2023-04-21 235903

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: scene.turn_on
  target:
    entity_id: scene.new_scene_2
  data: {}
1 Like

@nickrout this works!

thanks a million!

1 Like

@nickrout

I am trying to put the scene using custom: button-card, however, it returns an error: “Failed to call service/turn_on must contain at least one of entity_id, device_id, area_id”

Snímek obrazovky 2023-04-26 170452

Do you know how to update the code?

  - show_name: true
    show_icon: true
    type: custom:button-card  #I just changed button -> custom>button-card
    tap_action:
      action: call-service
      service: scene.turn_on 
      target:
        entity_id: scene.brana_kuryr
    icon: mdi:garage-open-variant
    name: Kurýr
    data: {}

Found the solution: replace ‘target’ with ‘service_data’

however, show_state does not work…

  - show_name: true
    show_icon: true
    type: custom:button-card
    tap_action:
      action: call-service
      service: scene.turn_on
      service_data:
        entity_id: scene.brana_kuryr
    icon: mdi:garage-open-variant
    show_state: true
    name: Kurýr
    data: {}

I suggest you ask on the custom button card support channel (I guess that is github)