banner-card icon indicating copy to clipboard operation
banner-card copied to clipboard

Feature Request: [when: {{state(domain.entity)}} , "on/off"]

Open AtticusG3 opened this issue 5 years ago • 1 comments

Is it possible to implement a when statement with reference to another entities state?

eg:

type: 'custom:banner-card'
background: '#B0C2ED'
entities:
  - entity: light.dining_room
    name: Dining
  - entity: script.1561637538159
    icon: 'mdi:lightbulb'
    name: Colour
    action:
      service: script.1561637538159
    when: [{{states("light.dining_room")}},"on"]
heading: "Light"

AtticusG3 avatar Aug 19 '19 12:08 AtticusG3

This is an old request/question but this is already possible with the correct syntax. Try this.

type: 'custom:banner-card'
background: '#B0C2ED'
entities:
  - entity: light.dining_room
    name: Dining
  - entity: script.1561637538159
    icon: 'mdi:lightbulb'
    name: Colour
    action:
      service: script.1561637538159
    when:
      entity: light.dining_room
      state:
        - '='
        - 'on'
heading: "Light"

kernel610 avatar Dec 08 '23 22:12 kernel610