custom-cards / button-card

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

Problem to call scene turn_on #800

Open Truble187 opened 7 months ago

Truble187 commented 7 months ago

Discussed in https://github.com/custom-cards/button-card/discussions/799

Originally posted by **Truble187** November 12, 2023 Hey guys, if I want to call a scene turn on service, I get alway an error and I don't know why. ``` tap_action: action: call-service service: scene.turn_on target: entity_id: scene.diningroom_scene2 ``` Error: ![image](https://github.com/custom-cards/button-card/assets/79580773/2e478703-a4f9-4a4c-984c-d91a92e5cd50) The scene works, if I call it over the developer setting.
Mariusthvdb commented 7 months ago

you are using the incorrect syntax:

use:

  tap_action:
    action: call-service
    service: scene.turn_on
    data:
      entity_id: entity

if your button-card holds a scene as entity, or replace entity in the entity_id line with your actual scene entity_id

Truble187 commented 7 months ago

you are using the incorrect syntax:

use:

  tap_action:
    action: call-service
    service: scene.turn_on
    data:
      entity_id: entity

if your button-card holds a scene as entity, or replace entity in the entity_id line with your actual scene entity_id

Thanks but the error is the same ;(

Mariusthvdb commented 7 months ago

Please post full button-card yaml and format correctly using the code ticks

Truble187 commented 7 months ago

Hey, here is the yaml:

type: custom:button-card
entity: scene.diningroom_scene1
name: Pandemonium
show_name: false
layout: name_state
tap_action:
  action: call-service
  service: scene.turn_on
  data:
    entity_id: scene.diningroom_scene1
styles:
  card:
    - background-image: url("/local/img/scene/scene1.png")
    - background-size: cover
Mariusthvdb commented 7 months ago

just tested this:

type: custom:button-card
entity: scene.dining_table_gedimd
tap_action:
  action: call-service
  service: scene.turn_on
  data:
    entity_id: entity

and it works as expected.

are you sure your scene has the correct entity_id there?

fwiw, I also tested the HA syntax, which IS supported with the latest button-card version (sorry, it wasnt before)

type: custom:button-card
entity: sun.sun
name: scene concentreren
tap_action:
  action: call-service
  service: scene.turn_on
  data: {}
  target:
    entity_id: scene.dining_table_concentreren

and works perfectly.

torbenan commented 7 months ago

I'm experience the same issue. The sceen is not activated My yaml ` type: custom:button-card icon: mdi:lightbulb-outline size: 30% color: grey show_entity_picture: true name: Køkken 0 entity: input_number.koekken_scene state: