Skip to content

Instantly share code, notes, and snippets.

@cwrau
Created October 13, 2024 11:42
Show Gist options
  • Save cwrau/6a7d58a1087426041300149d84979852 to your computer and use it in GitHub Desktop.
Save cwrau/6a7d58a1087426041300149d84979852 to your computer and use it in GitHub Desktop.
type: horizontal-stack
cards:
- type: custom:plotly-graph
refresh_interval: 1
hours_to_show: current_day
config:
modeBarButtonsToRemove:
- select2d
- lasso2d
- toImage
displaylogo: false
layout:
showlegend: true
xaxis:
showticklabels: true
dtick: 1000
visible: true
gridcolor: RGBA(200,200,200,0.15)
zerolinecolor: RGBA(200,200,200,0.15)
type: number
fixedrange: true
range:
- 5000
- -5000
yaxis:
showticklabels: true
dtick: 1000
visible: true
gridcolor: RGBA(200,200,200,0.15)
zerolinecolor: RGBA(200,200,200,0.15)
scaleanchor: x
scaleratio: 1
fixedrange: true
range:
- 0
- 7500
entities:
- entity: ""
fn_var1: >-
$ex vars.sensor_name_prefix =
"sensor.everything_presence_lite_4f0b90_";
fn_var2: >-
$ex vars.number_name_prefix =
"number.everything_presence_lite_4f0b90_";
fn_var3: $ex vars.is_inch_unit = false;
- entity: ""
name: Target1
marker:
size: 10
symbol: star-diamond
line:
shape: spline
width: 5
x:
- >-
$ex { var x = hass.states[vars.sensor_name_prefix +
"target_1_x"].state; var y = hass.states[vars.sensor_name_prefix +
"target_1_y"].state; if (x == 0 && y == 0) { return -9999 }; if
(vars.is_inch_unit) { x = x * 25.4 }; return x; }
"y":
- >-
$ex { var x = hass.states[vars.sensor_name_prefix +
"target_1_x"].state; var y = hass.states[vars.sensor_name_prefix +
"target_1_y"].state; if (x == 0 && y == 0) { return -9999 }; if
(vars.is_inch_unit) { y = y * 25.4 }; return y; }
- entity: ""
name: Target2
marker:
size: 10
symbol: star-diamond
line:
shape: spline
width: 5
x:
- >-
$ex { var x = hass.states[vars.sensor_name_prefix +
"target_2_x"].state; var y = hass.states[vars.sensor_name_prefix +
"target_2_y"].state; if (x == 0 && y == 0) { return -9999 }; if
(vars.is_inch_unit) { x = x * 25.4 }; return x; }
"y":
- >-
$ex { var x = hass.states[vars.sensor_name_prefix +
"target_2_x"].state; var y = hass.states[vars.sensor_name_prefix +
"target_2_y"].state; if (x == 0 && y == 0) { return -9999 }; if
(vars.is_inch_unit) { y = y * 25.4 }; return y; }
- entity: ""
internal: false
name: Target3
marker:
size: 10
symbol: star-diamond
line:
shape: spline
width: 5
x:
- >-
$ex { var x = hass.states[vars.sensor_name_prefix +
"target_3_x"].state; var y = hass.states[vars.sensor_name_prefix +
"target_3_y"].state; if (x == 0 && y == 0) { return -9999 }; if
(vars.is_inch_unit) { x = x * 25.4 }; return x; }
"y":
- >-
$ex { var x = hass.states[vars.sensor_name_prefix +
"target_3_x"].state; var y = hass.states[vars.sensor_name_prefix +
"target_3_y"].state; if (x == 0 && y == 0) { return -9999 }; if
(vars.is_inch_unit) { y = y * 25.4 }; return y; }
- entity: ""
name: Zone1
mode: lines
fill: toself
fillcolor: RGBA(20,200,0,0.06)
line:
color: RGBA(20,200,0,0.2)
shape: line
width: 2
x:
- $ex hass.states[vars.number_name_prefix + "zone_1_begin_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_1_begin_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_1_end_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_1_end_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_1_begin_x"].state
"y":
- $ex hass.states[vars.number_name_prefix + "zone_1_begin_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_1_end_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_1_end_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_1_begin_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_1_begin_y"].state
- entity: ""
name: Zone2
mode: lines
fill: toself
fillcolor: RGBA(200,20,0,0.06)
line:
color: RGBA(200,20,0,0.2)
shape: line
width: 2
x:
- $ex hass.states[vars.number_name_prefix + "zone_2_begin_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_2_begin_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_2_end_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_2_end_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_2_begin_x"].state
"y":
- $ex hass.states[vars.number_name_prefix + "zone_2_begin_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_2_end_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_2_end_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_2_begin_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_2_begin_y"].state
- entity: ""
name: Zone3
mode: lines
fill: toself
fillcolor: RGBA(600,350,0,0.06)
line:
color: RGBA(600,350,0,0.2)
shape: line
width: 2
x:
- $ex hass.states[vars.number_name_prefix + "zone_3_begin_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_3_begin_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_3_end_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_3_end_x"].state
- $ex hass.states[vars.number_name_prefix + "zone_3_begin_x"].state
"y":
- $ex hass.states[vars.number_name_prefix + "zone_3_begin_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_3_end_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_3_end_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_3_begin_y"].state
- $ex hass.states[vars.number_name_prefix + "zone_3_begin_y"].state
- entity: ""
name: Coverage
mode: lines
fill: tonexty
fillcolor: rgba(168, 216, 234, 0.15)
hoverinfo: none
line:
shape: line
width: 0.7
dash: dot
x:
- 0
- $ex 7500 * Math.sin((2 * Math.PI)/360 * 60)
- 6500
- 5500
- 4500
- 4000
- 3000
- 2000
- 1000
- 0
- -1000
- -2000
- -3000
- -4000
- -4500
- -5500
- -6500
- $ex -7500 * Math.sin((2 * Math.PI)/360 * 60)
- 0
"y":
- 0
- $ex 7500 * Math.cos((2 * Math.PI)/360 * 60)
- $ex Math.sqrt( 7500**2 - 6500**2 )
- $ex Math.sqrt( 7500**2 - 5500**2 )
- $ex Math.sqrt( 7500**2 - 4500**2 )
- $ex Math.sqrt( 7500**2 - 4000**2 )
- $ex Math.sqrt( 7500**2 - 3000**2 )
- $ex Math.sqrt( 7500**2 - 2000**2 )
- $ex Math.sqrt( 7500**2 - 1000**2 )
- 7500
- $ex Math.sqrt( 7500**2 - 1000**2 )
- $ex Math.sqrt( 7500**2 - 2000**2 )
- $ex Math.sqrt( 7500**2 - 3000**2 )
- $ex Math.sqrt( 7500**2 - 4000**2 )
- $ex Math.sqrt( 7500**2 - 4500**2 )
- $ex Math.sqrt( 7500**2 - 5500**2 )
- $ex Math.sqrt( 7500**2 - 6500**2 )
- $ex 7500 * Math.cos((2 * Math.PI)/360 * 60)
- 0
raw_plotly_config: true
title: Live persons detected maptype
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment