Toggle Graph Card

hc_toggle_graph_card extends hc_graph_card with a related toggle. It keeps the sensor’s live numeric reading and project-owned 24-hour background trace, while the card action, active treatment, and unavailable state come from toggle_entity rather than the metric sensor.

Usage

  - type: custom:marao-card
    template: hc_toggle_graph_card
    entity: <your sensor entity>
    name: Heater
    variables:
      toggle_entity: <your switch entity>
      active_color: var(--color-orange)

Remember to take care of indentation

Variable / entry

Variable Default Required Example
entity   Yes sensor.heater_power
name friendly name No Heater
toggle_entity   Yes switch.heater
active_color var(–primary-color) No var(–color-orange)
active_content_color white No white
active_icon_background var(–opacity-contrast-100) No var(–opacity-contrast-100)
inactive_background var(–ha-card-background) No var(–ha-card-background)
inactive_name_color var(–subtext-color) No var(–subtext-color)
inactive_state_color var(–primary-text-color) No var(–primary-text-color)
inactive_icon_color var(–icon-color-default) No var(–icon-color-default)
inactive_icon_background var(–background-icon-color-default) No var(–background-icon-color-default)
show_graph_fill true No true
show_graph_line true No true
show_icon true No true
graph_color Theme card text/accent color No var(–color-orange)
graph_background Transparent No rgba(255, 255, 255, 0.08)

More info

This card inherits the shared Marao graph behavior from hc_graph_card. It requests recorder history once for the displayed sensor, appends its live numeric state, and does not add a native history-graph card or another frontend resource. If history is unavailable, the current reading and related toggle remain usable while the background trace stays neutral.


Marao Dashboard is distributed under the repository's license.