Conditional card based on enabled/disabled entities?

sadly i need some more help :slight_smile:
i have some cameras i install only when i leave for some days (i don’t like to have indoor cameras connected when i’m home, so i install them only when i leave to see my cats :))
When i disconnect them, i disable them in HA to avoid flooding my logs. But i’d also like to hide the cards in lovelace showing the videos. So i gave a look to conditional cards. That’s good, i can control them with entities states (like lights).
So i need to have the information about cameras being disabled. How the hell should i do??
I thought about templates binary sensors, but what should i use to check if an entity is enabled?
i just tried with this,

  - binary_sensor:
    - name: "Internal Cams Installed"
      state: "{{ camera.foscam_outcam_lan_80.state is defined }}"

but (i) this is not giving me the correct boolean value; and (ii) this is logged as any other sensor, can’t i avoid logging this sort of info? i just want the information :slight_smile:

Thanks a lot

I think when u disable an entity its state becomes None
So a check for that should suffice.

{{ != None }}
1 Like

Thanks, this works!
However, it seems that even hidden cards basically “takes the place”, so remaining cards are not shown freely (basically, they do not use all the available space, like if hidden cards were still there). Do you think this is something can be sorted out?

It should not do that. What is the code for the card? Maybe a custom card thats acting up?
Edit: Just tested this on a default card and custom card. Both went away and freed up all the space so the cards remaining folded into place.

This is weird.
I just tried also removing all the part related with browser_mod but i still see the space used by hidden cards.
Please see here my conditional cards code (i removed the browser_mod part)

      - type: conditional
          - entity: binary_sensor.internal_cams_installed
            state: 'on'
          show_state: false
          show_name: true
          name: Telecamera Studio
          camera_view: auto
          type: picture-entity
          entity: camera.studycamera_hd_stream

Just an example of what i mean (it’s the same with real entities used and images shown):
These are the cards while drawing them

As you can see the first two cards (not conditional) are not taking the space:

But if i totally remove the code of the last three cards i get this:

Thanks for your help :slight_smile: