Skip to content

Power Outlet Card

Description

example-image

This is the power-outlet-card. It shows you the state of a power outlet, and if configured, the actual power consumption of the power outlet.

Variables

Variable Default Required Notes
entity
ulm_card_power_outlet_name Set custom Name
ulm_card_power_outlet_icon Set custom Icon
ulm_card_power_outlet_consumption_sensor If you set this sensor, the power-outlet-card shows the energy consumption next to the state.

Usage

- type: 'custom:button-card'
  template: card_power_outlet
  variables:
    ulm_card_power_outlet_consumption_sensor: sensor.power_outlet_livingroom_consumption
    ulm_card_power_outlet_name: Power Outlet Livingroom
  entity: switch.power_outlet_livingroom
Template Code
card_power_outlet.yaml
---
### Card Power Outlet ###
card_power_outlet:
  template:
    - "icon_more_info_new"
    - "yellow"
    - "ulm_translation_engine"
    - "ulm_actions_card"
  variables:
    ulm_card_power_outlet_consumption_sensor:
    ulm_card_power_outlet_name: "[[[ return entity.attributes.friendly_name ]]]"
    ulm_card_power_outlet_icon: "[[[ return entity.attributes.icon ]]]"
  triggers_update: "all"
  custom_fields:
    item1:
      card:
        type: "custom:button-card"
        template:
          - "icon_more_info"
          - "yellow"
        custom_fields:
          item1:
            card:
              type: "custom:button-card"
              template:
                - "yellow"
              variables:
                ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]"
                ulm_input_select: "[[[ return variables.ulm_input_select; ]]]"
              entity: "[[[ return entity.entity_id ]]]"
              icon: "[[[ return variables.ulm_card_power_outlet_icon ]]]"
          item2:
            card:
              type: "custom:button-card"
              template:
                - "yellow_no_card"
              variables:
                ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]"
                ulm_input_select: "[[[ return variables.ulm_input_select; ]]]"
              entity: "[[[ return entity.entity_id ]]]"
              name: "[[[ return variables.ulm_card_power_outlet_name ]]]"
              label: |-
                [[[
                  if (entity.state === "on" && variables.ulm_card_power_outlet_consumption_sensor !== null) {
                    return variables.ulm_translation_state + " • " + states[variables.ulm_card_power_outlet_consumption_sensor].state + "W";
                  } else {
                    return variables.ulm_translation_state;
                  }
                ]]]