Home

Awesome

Circle Sensor Card

hacs_badge

Custom component for lovelace which can be used as a card or an element on a picture-elements card.

Circle Sensor Examples

Note: When including this file in your ui-lovelace.yaml you must use type: module

Config

NameTypeDescriptionDefault
typestringcustom:circle-sensor-cardRequired
entitystringsensor.temperatureRequired
show_cardbooleanRender as a cardfalse
namestringName to display above sensor valuenone
minnumberMinimum value0
maxnumberMaximum value100
font_stylelistCSS style properities to apply to fontnone
fillstringBackground color of circlergba(255, 255, 255, .75)
stroke_widthnumberWidth of circle value indication ring6
stroke_colorhex codeDefault stroke color#03a9f4
stroke_bg_widthnumberWidth of background strokenone
stroke_bg_colorhex codeDefault stroke bg color#999999
color_stopsobjectSensor value to color mapping (see below)none
gradientbooleanWhether to smoothly transition between color stopsfalse
unitsstringCustom units of measurementnone
attributestringAttribute element of entity to use instead of its statenone
attribute_maxstringUse attribute element of entity as maxnone
show_maxbooleanDisplay the max valuefalse

Color stops

A mapping from value to color. If gradient is set to true, mid-stop colors will be calculated on a linear gradient from one stop to the next.

color_stops:
  50: '#84B821'
  100: '#D43214' 

Installation

Step 1

Install circle-sensor-card by copying circle-sensor-card.jsfrom this repo to <config directory>/www/ on your Home Assistant instance.

Example:

wget https://raw.githubusercontent.com/custom-cards/circle-sensor-card/master/circle-sensor-card.js
mv circle-sensor-card.js /config/www/

Step 2

Link circle-sensor-card inside you ui-lovelace.yaml.

resources:
  - url: /local/circle-sensor-card.js?v=0
    type: module

Step 3

Add a custom card or custom element in your ui-lovelace.yaml using type: custom:circle-sensor-card

Example

- type: custom:circle-sensor-card
  entity: sensor.outside_temperature
  max: 120
  min: 30
  stroke_width: 10
  gradient: true
  units: ' '
  attribute: 'ambient'
  attribute_max: 'feels_like'
  show_max: true
  font_style:
    color: red
    font-size: 1.5em
    text-shadow: '2px 2px black'
    font-family: 'Trebuchet MS'
  color_stops:
    50: '#55FF55'
    75: '#5555FF'
    100: '#FF5555'
  style:
    top: 50%
    left: 50%
    width: 75px
    height: 75px