xiaohongshu
xiaohongshu
ha-conditional-cards
Implements conditional visibility for Home Assistant dashboard cards using state, numeric_state, screen, user, time, and/or conditions via Conditional Card wrapper and per-card visibility property. Use when asked to "hide card when", "show only if", "user-specific dashboard", "mobile vs desktop c...
Full skill instructions
Works with Lovelace YAML dashboards and conditional/visibility card configurations.
Control card visibility dynamically based on states, users, screen size, and complex conditions.
Home Assistant provides two approaches for conditional visibility:
visibility property on any cardBoth support multiple condition types:
Use this skill when you need to:
Do NOT use when:
type: conditional
conditions:
- condition: state
entity: person.john
state: home
card:
type: entities
entities:
- light.bedroom
type: entities
entities:
- light.bedroom
visibility:
- condition: state
entity: person.john
state: home
conditions to conditional card or visibility to any cardSee Condition Types Reference below for all available conditions and syntax.
| Condition | Parameters | Use Case |
|---|---|---|
state | entity, state | Show when entity has specific state |
numeric_state | entity, above, below | Show when sensor in range |
screen | media_query | Show based on screen width |
user | users (list of user IDs) | Show for specific users only |
time | after, before | Show during specific time window |
and | List of conditions | All conditions must be true |
or | List of conditions | At least one condition must be true |
type: conditional
conditions:
- condition: state
entity: binary_sensor.motion_living_room
state: "on"
card:
type: camera
entity: camera.living_room
visibility:
- condition: state
entity: climate.living_room
state_not:
- "off"
- unavailable
Note: Native conditional cards don't support attribute conditions. Create a template sensor instead.
# In configuration.yaml
template:
- sensor:
- name: "AC Mode Cool"
state: "{{ state_attr('climate.living_room', 'hvac_mode') == 'cool' }}"
# In dashboard
visibility:
- condition: state
entity: sensor.ac_mode_cool
state: "True"
type: entities
entities:
- climate.bedroom
visibility:
- condition: numeric_state
entity: sensor.temperature
above: 18
below: 30
visibility:
- condition: numeric_state
entity: sensor.battery
below: 20 # Show when battery < 20%
visibility:
- condition: numeric_state
entity: sensor.humidity
above: 40
below: 60 # Show when 40% < humidity < 60%
visibility:
- condition: screen
media_query: "(max-width: 600px)"
visibility:
- condition: screen
media_query: "(min-width: 1280px)"
visibility:
- condition: screen
media_query: "(min-width: 601px) and (max-width: 1279px)"
# Mobile (portrait)
media_query: "(max-width: 600px)"
# Tablet (portrait)
media_query: "(min-width: 601px) and (max-width: 900px)"
# Desktop
media_query: "(min-width: 1280px)"
# Landscape orientation
media_query: "(orientation: landscape)"
# Portrait orientation
media_query: "(orientation: portrait)"
visibility:
- condition: user
users:
- 1234567890abcdef # User ID (not username)
type: entities
entities:
- switch.advanced_settings
visibility:
- condition: user
users:
- 1234567890abcdef # Admin user 1
- fedcba0987654321 # Admin user 2
Finding User IDs:
/config/person/USER_ID_HEREvisibility:
- condition: time
after: "06:00:00"
before: "22:00:00"
visibility:
- condition: time
after: "22:00:00"
before: "06:00:00"
visibility:
- condition: time
after: "09:00:00"
before: "17:00:00"
weekday:
- mon
- tue
- wed
- thu
- fri
visibility:
- condition: and
conditions:
- condition: state
entity: person.john
state: home
- condition: numeric_state
entity: sensor.temperature
below: 18
- condition: time
after: "06:00:00"
before: "23:00:00"
visibility:
- condition: or
conditions:
- condition: state
entity: person.john
state: home
- condition: state
entity: person.jane
state: home
visibility:
- condition: and
conditions:
# Show during daytime...
- condition: time
after: "06:00:00"
before: "22:00:00"
# ...AND (someone is home OR security is armed)
- condition: or
conditions:
- condition: state
entity: person.john
state: home
- condition: state
entity: alarm_control_panel.home
state: armed_away
type: conditional
conditions:
- condition: state
entity: binary_sensor.motion_living_room
state: "on"
card:
type: camera
entity: camera.living_room
# Mobile: Compact view
type: custom:mushroom-chips-card
visibility:
- condition: screen
media_query: "(max-width: 600px)"
# Desktop: Detailed view
type: grid
columns: 3
visibility:
- condition: screen
media_query: "(min-width: 1280px)"
type: entities
entities:
- switch.developer_mode
visibility:
- condition: user
users:
- 1234567890abcdef # Admin user ID (Settings → People → URL)
For more patterns (low battery alerts, temperature warnings, occupied rooms, time-based controls), see references/advanced-patterns.md.
Cannot check attributes directly - Create template sensor to expose attribute as entity state.
No template conditions - Create template binary sensor instead.
Always visible in edit mode - Must exit edit mode to test visibility behavior.
For detailed workarounds, see references/advanced-patterns.md.
| Issue | Solution |
|---|---|
| Card not hiding | Exit edit mode, check entity state, verify YAML indentation |
| User condition fails | Use user ID (not username), find in Settings → People → URL |
| Time condition fails | Use 24-hour format "23:00:00", check HA timezone |
| Numeric condition fails | Verify sensor has numeric state (not "unknown") |
| Screen condition fails | Test on actual device (not browser resize) |
For detailed troubleshooting, see references/advanced-patterns.md.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience