MCPcopy Index your code
hub / github.com/dylandoamaral/uptime-card

github.com/dylandoamaral/uptime-card @v0.16.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.16.0 ↗ · + Follow
92 symbols 184 edges 13 files 17 documented · 18% updated 6mo agov0.16.0 · 2024-03-20★ 3364 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Uptime Card

A minimalist card inspired by the reddit status UI to display binary sensors in a nice way.

Install 🏠

:warning: Versions 0.x.x are not very stable and still have many bugs, please create an issue if you encounter a bug or have a feature request.

HACS (recommended)

This card is available in HACS (Home Assistant Community Store).

Manual install

  1. Download and copy uptime-card.js from the latest release into your config/www directory.
  2. Add the resource reference inside your configuration.yaml with URL /local/uptime-card.js and type module.
  3. Add the custom card to your panel and 🚀.

Configuration ⚙️

Uptime card is highly customizable.

Global config

Name Type / Options Default Since Description
entity (required) string v0.0.1 Specify entity ID of the sensor
attribute string v0.5.0 Set the attribute name if the state to monitor isn't the default one.
ok string or string[] v0.0.1 Specify the on state(s) for the entity, either ok or ko should be set if entity isn't a binary sensor. More info.
ko string or string[] v0.0.1 Specify the off state(s) for the entity, either ok or ko should be set if entity isn't a binary sensor. More info.
none string or string[] v0.14.0 Specify the none state(s) for the entity. More info.
icon string icon attribute || mdi:heart v0.0.1 Specify a custom icon from mdi icons or an image from /local path (since v0.4.0), e.g. mdi:home
ko_icon string icon option || icon attribute || mdi:heart v0.2.0 Specify a custom icon for ko status, e.g. mdi:home
none_icon string icon option || icon attribute || mdi:heart v0.14.0 Specify a custom icon for none status, e.g. mdi:home
hours_to_show number 24 v0.0.1 Set the number of hours to show, you can go to the minute, you can go up to the minute (1 minute == 0.0167 hours_to_show). :warning: It is deprecated and should be replaced by duration.
update_interval number 30 v0.0.1 Set the minimum update interval for the card in seconds.
title_template string [[[ return entity.attributes.friendly_name; ]]] v0.8.0 Set the template for the title. More info.
average_template string % v0.5.0 Set the template for the average. More info.
severity number 100 v0.0.1 Set a threshold in percentage to specify when a bar both ok and ko is red instead of yellow.
status_template string [[[ return variables.current ]]] v0.1.0 Set the template for the status. More info.
title_adaptive_color true/false false v0.0.2 Make the title color adapt with the entity color.
status_adaptive_color true/false false v0.0.2 Make the name color adapt with the entity color.
icon_adaptive_color true/false false v0.0.2 Make the name color adapt with the entity color.
tooltip_adaptive_color true/false false v0.1.0 Make the name color adapt with the entity color.
color_thresholds list of thresholds v0.4.0 Set the color thesholds.

Bar config

Parent key: bar

Name Type / Options Default Since Description
height number 46 v0.0.1 Set the height of the bars.
round number 1 v0.0.1 Set the round radius for the bars.
spacing number 4 v0.0.1 Set the spacing between the bars.
amount number 36 v0.0.1 Set the number of bars.

Color config

Parent key: color

Name Type / Options Default Since Description
ok color  #45C669 v0.0.1 Set the ok color.
ko color  #C66445 v0.0.1 Set the ko color.
half color  #C6B145 v0.0.1 Set the half color.
none color  #C9C9C9 v0.0.1 Set the none color.
title color  grey v0.0.2 Set the title text color, title_adaptive_color must be false.
status color  grey v0.0.2 Set the status text color, status_adaptive_color must be false.
icon color  var(--state-icon-color) v0.0.2 Set the icon text color, icon_adaptive_color must be set to false.
ko_icon color same as icon v0.15.0 Set the ko icon text color, same as icon if not set, icon_adaptive_color must be set to false.
tooltip color  grey v0.1.0 Set the tooltip text color, tooltip_adaptive_color must be false.
footer color  #AAAAAA v0.15.0 Set the footer text color.

Show config

Parent key: show

| Name | Type / Options | Default | Since | Description | | -------- | :------------: | :-----:

Extension points exported contracts — how you extend this code

HTMLElementTagNameMap (Interface)
(no doc)
src/types/global.ts
Point (Interface)
(no doc)
src/types/card.ts
ApiPoint (Interface)
(no doc)
src/types/card.ts
Attributes (Interface)
(no doc)
src/types/card.ts
Repartition (Interface)
(no doc)
src/types/card.ts

Core symbols most depended-on inside this repo

isOk
called by 9
src/uptime-card.ts
getStatus
called by 8
src/uptime-card.ts
attachBlink
called by 5
src/uptime-card.ts
getPropertyValue
called by 4
src/editor.ts
template
called by 4
src/utils.ts
updateData
called by 3
src/uptime-card.ts
getCssColor
called by 3
src/uptime-card.ts
clip
called by 2
src/utils.ts

Shape

Method 58
Interface 26
Class 4
Function 4

Languages

TypeScript100%

Modules by API surface

src/uptime-card.ts45 symbols
src/editor.ts17 symbols
src/types/config.ts11 symbols
src/types/card.ts8 symbols
src/types/editor.ts6 symbols
src/utils.ts4 symbols
src/types/global.ts1 symbols

For agents

$ claude mcp add uptime-card \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page