PC State Cards

Both examples were created by Rokanishu.


This example allows you to create cards showing the state of your PC in your dashboard.

image

image

type: entities
entities:
  - entity: binary_sensor.office_motion_sensor_ias_zone
    secondary_info: last-changed
    name: Motion Detected
  - entity: binary_sensor.lumi_lumi_sensor_motion_aq2_ias_zone
    name: Desk Motion Sensor
    secondary_info: last-updated
  - entity: binary_sensor.lumi_lumi_sensor_magnet_aq2_on_off
    secondary_info: last-changed
    name: Office Door
  - type: conditional
    conditions:
      - entity: sensor.hass_desktop_sessionstate
        state_not: Unlocked
    row:
      entity: sensor.desktop_lastactive
      icon: mdi:sleep
      state_color: true
      name: PC Last Active (Off)
  - type: conditional
    conditions:
      - entity: sensor.hass_desktop_sessionstate
        state: Unlocked
    row:
      entity: sensor.desktop_lastactive
      icon: mdi:mouse
      state_color: true
      name: PC Last Active

This example shows specific buttons for when the PC is asleep/off or on.

image

image

square: false
columns: 1
type: grid
cards:
  - type: conditional
    conditions:
      - entity: sensor.hass_desktop_sessionstate
        state_not: Unlocked
    card:
      show_name: true
      show_icon: true
      show_state: false
      type: glance
      entities:
        - entity: script.button_wake_desktop
          name: Desktop WOL
          tap_action:
            action: toggle
          icon: mdi:power
      state_color: false
  - type: conditional
    conditions:
      - entity: sensor.hass_desktop_sessionstate
        state_not: unavailable
      - entity: sensor.hass_desktop_sessionstate
        state_not: unknown
    card:
      show_name: true
      show_icon: true
      show_state: false
      type: glance
      entities:
        - entity: button.desktop_hibernate
          name: Sleep Desktop
          tap_action:
            action: toggle
          icon: mdi:power
        - entity: button.desktop_monitorsoff
          name: Monitors Off
          tap_action:
            action: toggle
          icon: mdi:monitor-off
        - entity: button.desktop_launchhyperion
          name: Run Hyperion
          tap_action:
            action: toggle
          icon: mdi:television-ambient-light
        - entity: media_player.office_tv
          name: Toggle TV
          tap_action:
            action: call-service
            service: media_player.toggle
            target:
              entity_id: media_player.office_tv
      state_color: false