#square conditional

1 messages · Page 1 of 1 (latest)

past hawk
#

i'm trying to make this conditional one square

  - text: Test
    type: custom:text-divider-row
  - type: vertical-stack
    cards:
      - type: conditional
        conditions:
          - condition: state
            entity: sensor.badevarelse_batteri
            state: unavailable
          - condition: or
            conditions:
              - condition: numeric_state
                entity: sensor.badevarelse_batteri
                below: 90
          - type: gauge
            entity: sensor.badevarelse_batteri

just like this one:

#
  - text: Kontor
    type: custom:text-divider-row
  - type: vertical-stack
    cards:
      - square: false
        columns: 4
        type: grid
        cards:
          - aspect_ratio: 1.2/1
            color: rgb(252,255,158)
            color_type: icon
            entity: light.tina_kontor
            icon: mdi:ceiling-light
            name: Tina
            tap_action:
              action: toggle
            hold_action:
              action: more-info
            type: custom:button-card
          - aspect_ratio: 1.2/1
            color: rgb(252,255,158)
            color_type: icon
            entity: light.bo_kontor
            icon: mdi:ceiling-light
            name: Bo
            tap_action:
              action: toggle
            hold_action:
              action: more-info
            type: custom:button-card
          - aspect_ratio: 1.2/1
            color: rgb(252,255,158)
            color_type: icon
            entity: light.hobby_kontor
            icon: mdi:ceiling-light
            name: Hobby
            tap_action:
              action: toggle
            hold_action:
              action: more-info
            type: custom:button-card
          - show_name: false
            show_icon: true
            type: button
            entity: input_boolean.radiator_kontor
          - type: gauge
            entity: sensor.ewelink_th01_luftfugtighed
            name: " "
          - type: gauge
            entity: sensor.ewelink_th01_temperatur
            name: " "

i just cant figure out how

formal eagle
#

A type: conditional is in itself no card. You place the card you want to be conditional under the card key exactly how you would do it without a condition.

But I do see you have an OR condition with only a condition under it. That does nothing. You probably was looking for:

          - condition: or
            conditions:
              - condition: numeric_state
                entity: sensor.badevarelse_batteri
                below: 90
              - condition: state
                entity: sensor.badevarelse_batteri
                state: unavailable
past hawk
#

figured it

#
  • text: Test
    type: custom:text-divider-row
    • square: false
      columns: 4
      type: grid
      cards:
      • type: conditional
        conditions:
        • condition: state
          entity: sensor.badevarelse_batteri
          state: unavailable
        • condition: or
          conditions:
          • condition: numeric_state
            entity: sensor.badevarelse_batteri
            below: 90
            card:
            type: gauge
            entity: sensor.badevarelse_batteri
austere talonBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

formal eagle
#

And that OR is still ding nothing 😉

past hawk
#

🙁

#

the idea was that the "sensor" only shows up if below 10 or becomes unavailble (when battery is dead for to long)

#

but dinner is served... and i get a grumpy face if i dont show

formal eagle
past hawk
#

i think what confused me was that i can add a conditional card

but i will look at it with fresh eyes tomorrow

but is this more correct? (tired so might have f'ed up again)

       - type: conditional
         - condition: or
          conditions:
            - condition: state
              entity: sensor.ikea_of_sweden_tradfri_remote_control_batteri_5
              state: unavailable
            - condition: numeric_state
              entity: sensor.ikea_of_sweden_tradfri_remote_control_batteri_5
              below: 10
          card:
            type: gauge
            entity: sensor.ikea_of_sweden_tradfri_remote_control_batteri_5
#

hmm

#

the blue box at the top..... makes me think that i cant make an OR anyways...

#

but i could always repeat twice and and only have one condition on each

#
          - type: conditional
            conditions:
              - condition: or
                conditions:
                  - condition: state
                    entity: sensor.ikea_of_sweden_tradfri_remote_control_batteri_5
                    state: unavailable
                  - condition: numeric_state
                    entity: sensor.ikea_of_sweden_tradfri_remote_control_batteri_5
                    below: 10
            card:
              type: gauge
              entity: sensor.ikea_of_sweden_tradfri_remote_control_batteri_5

could use an extra set of eyeballs... and fresh brain

covert crystal
#

the "or" is one of the conditions. That statement that all conditions must be "fulfilled" is generic and is why it's phrased that way

past hawk
#

well i will mark this one as resolved as the last code i gave results in some of the switch's show up s low on battery and some unavavilble, some with new battery will for some strange reason go unavailble after some hours displaying 100%... oh well

#

and i cant change to resolved ?🧐 🤪

covert crystal
#

You can. Add the tag