Skip to content

The Entity History tool

1.0.0 · Output

The Entity History tool is a horizontal or vertical bar chart (sparkline) and displayes some history of an Home Assistant Entity. It is a basic chart, more of a sparkline with only display functionality.

Basic usage

The Entity History tool needs a center position, height, width, and margin to display the history graph. It also needs the number of hours, the number of bars per hour, and the orientation. Last but not least, it needs the entity_index from which the history is displayed

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
- type: 'bar'               # tooltype is 'bar'
  position:                 # Position on (100x100) canvas
    cx: 50                  # cx=50 is center position
    cy: 50                  # cy=50 is center position
    width: 180              # width of total barchart
    height: 55              # height
    margin: 1               # space between bars
  orientation: vertical     # vertical or horizontal
  hours: 24                 # number of hours of history
  barhours: 1               # each bar represents 1 hour
  entity_index: 0           # connect to state of entity 0

Styling

The Entity History tool has support for the following forms of styling:

Method Support Description
classes Using SAK or User defined class definitions
styles Using inline SVG and CSS styles

The Entity History tool is composed of a single object: "bar" and this is the selector for styling:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
- type: 'bar'
  position:
    cx: 50
    cy: 50
    width: 180              # width of total barchart
    height: 55              # height
    margin: 1               # space between bars
  orientation: vertical     # vertical or horizontal
  hours: 24                 # number of hours of history
  barhours: 1               # each bar represents 1 hour
  entity_index: 0
  classes:
    bar:                   # bar selector
      <...>
  styles:
    bar:                   # bar selector
      <...>
Populair properties:

Property Does what? Example
fill Fill color fill: red sets fill to color red
opacity Opacity (stroke/fill) opacity: 0.7 sets the opacity of bar to 70%
stroke-linecap Format end of line stroke-linecap: round sets the endline to round. butt sets it to square

Haptics

The tool supports haptic feedback through user_actions/ tap_action definition

Action Haptic Description
Click haptic Uses the haptic property defined in the user_actions definition of the tool. If not specified, a default of medium is used
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
  tools:
    - type: icon
      position:
        cx: 10
        cy: 10
        align: center
        icon_size: 15
      entity_index: 0
      user_actions:
        tap_action:
          haptic: success
          actions:
            - action: more-info

Possible values for haptic feedback:

Haptic Description
success Indicates that a task or action has completed.
warning Indicates that a task or action has produced a warning of some kind.
failure Indicates that a task or action has failed.
light Provides a physical metaphor that complements the visual experience.
medium Provides a physical metaphor that complements the visual experience.
heavy Provides a physical metaphor that complements the visual experience.
selection Indicates that the selection is actively changing.

Animations

The Entity Barchart tool has support for the following forms of animations:

Method Support Description
colorstops List of state values to set the color for SINGLE bar
colorlists Using a colorlist definition
animations Operator state based animations with class/style styling