Picture elements: conditions OR or AND?

I was not sure after reading the documentation: if I have multiple conditions, do they all need to be true (AND) or does any of them need to be true (OR)?

Right now looking for OR, but would be great if I can specify it case by case.

If you are talking about the conditional element, each entity can have only one state or state_not condition and they are ANDed together to determine if the element is shown.

If you need OR logic you will have to create a template binary sensor with that logic and then use it as the conditional entity for the element.

e.g. Using the last example on the page you linked to, with this sensor:

binary_sensor:
  - platform: template
    sensors:
      dad_or_daughter:
        friendly_name: "Dad or daughter"
        value_template: >-
          {{ is_state('sensor.presence_daughter', 'home') or is_state('sensor.presence_dad', 'not_home') }}

To make the example or logic:

type: picture-elements
image: /local/House.png
elements:
  # conditionally show TV off button shortcut when dad's away OR daughter is home
  - type: conditional
    conditions:
      - entity: binary_sensor.dad_or_daughter
        state: "on"
    elements:
      - type: state-icon
        entity: switch.tv
        tap_action:
          action: toggle
        style:
          top: 47%
          left: 42%
2 Likes

Ah yes, I missed that example. Would be nice if I can use the template directly in the picture-element card, but for now fine as a workaround, Thanks!