Yes, when the ld2450 was first introduced, an initial esphome firmware was made with extensive testing and support from many enthusiasts.
In the latest official firmware, there is also support for the app’s dynamic area display, and a raw firmware area division, which makes this sensor much more user-friendly.
How can I make such map? It’s a nice visual overview of the zones and I don’t know how to get/enable it. Thanks
Hello, here is my config. I will try change revert config as your suggest at tonight. and let u know. thank you
Hello,
Here my lovelace code. change your entity
Here is the code I developed for the visualisation using the Plotly Graph Card addon:
I have updated the code to increase the Y-range of the chart to 7500mm as the latest firmware for the LD2450 seems to have increased its range:
Yep, it looks like your Zone X Begin and End values need to be swapped.
X-Begin should be 1000
X-End should be 3000
Hi gus, good to see you. I’m thinking that if I just need regions, maybe I can set it up so that x-begin and x-end can be in any order, and use the code to determine the smaller value and the larger value to create the region.
Otherwise it looks too weird to show the chart but no target exists.
I wonder if this setting would be too weird.
this is lovely, thank you so much!
I got the Same issue:
Rebooting...
[I][logger:354]: Log initialized
[C][ota:473]: There have been 7 suspected unsuccessful boot attempts.
[D][esp32.preferences:114]: Saving 1 preferences to flash...
[D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[I][app:029]: Running through setup()...
[I][i2c.arduino:183]: Performing I2C bus recovery
E (5286) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (5286) task_wdt: - loopTask (CPU 0)
E (5286) task_wdt: Tasks currently running:
E (5286) task_wdt: CPU 0: IDLE
E (5286) task_wdt: Aborting.
abort() was called at PC 0x420452b5 on core 0
Core 0 register dump:
MEPC : 0x4038296a RA : 0x40387c5c SP : 0x3fc93870 GP : 0x3fc8f400
TP : 0x3fc7799c T0 : 0x37363534 T1 : 0x7271706f T2 : 0x33323130
S0/FP : 0x3fc9389c S1 : 0x3fc9389c A0 : 0x3fc938a8 A1 : 0x3fc9388a
A2 : 0x00000000 A3 : 0x3fc938d5 A4 : 0x00000001 A5 : 0x3fc97000
A6 : 0x7a797877 A7 : 0x76757473 S2 : 0x3fc973e4 S3 : 0x7fffffff
S4 : 0x3fc90848 S5 : 0x3fc90838 S6 : 0x3fc90840 S7 : 0x3fc90838
S8 : 0x00000000 S9 : 0x00000000 S10 : 0x00000000 S11 : 0x00000000
T3 : 0x6e6d6c6b T4 : 0x6a696867 T5 : 0x66656463 T6 : 0x62613938
MSTATUS : 0x00001801 MTVEC : 0x40380001 MCAUSE : 0x00000007 MTVAL : 0x00000000
MHARTID : 0x00000000
Stack memory:
3fc93870: 0x00000000 0x00000000 0x3fc93888 0x4038d636 0x3fc90840 0x3fc90838 0x3fc90030 0x3fc914cc
3fc93890: 0x3fc9389c 0x3fc914e8 0x3fc93888 0x34303234 0x35623235 0x00000000 0x726f6261 0x20292874
3fc938b0: 0x20736177 0x6c6c6163 0x61206465 0x43502074 0x34783020 0x35343032 0x20356232 0x63206e6f
3fc938d0: 0x2065726f 0x00000030 0x3c0d0000 0x064ad539 0x600c2000 0x3c0de000 0x3fc97000 0x420452b8
3fc938f0: 0x00000000 0x00000000 0x00000000 0x000014a6 0x00000ff7 0x00000fc5 0x3fca28b0 0x00000000
3fc93910: 0x00000000 0x3fc97000 0x3fc93b7c 0x00000001 0x00001881 0x80000007 0x3fc9b73c 0x403801ee
3fc93930: 0x00000001 0x3fc93938 0xffffffff 0x3fc9c1b4 0x3fc9c1b4 0x00000000 0x3fc9394c 0xffffffff
3fc93950: 0x3fc9394c 0x3fc9394c 0x00000000 0x3fc93960 0xffffffff 0x3fc93960 0x3fc93960 0x00000000
3fc93970: 0x3fc93974 0xffffffff 0x3fc93974 0x3fc93974 0x00000000 0x3fc93988 0xffffffff 0x3fc93988
3fc93990: 0x3fc93988 0x00000000 0x3fc9399c 0xffffffff 0x3fc9399c 0x3fc9399c 0x00000000 0x3fc939b0
3fc939b0: 0xffffffff 0x3fc939b0 0x3fc939b0 0x00000000 0x3fc939c4 0xffffffff 0x3fc939c4 0x3fc939c4
3fc939d0: 0x00000000 0x3fc939d8 0xffffffff 0x3fc939d8 0x3fc939d8 0x00000000 0x3fc939ec 0xffffffff
3fc939f0: 0x3fc939ec 0x3fc939ec 0x00000000 0x3fc93a00 0xffffffff 0x3fc93a00 0x3fc93a00 0x00000000
3fc93a10: 0x3fc93a14 0xffffffff 0x3fc93a14 0x3fc93a14 0x00000000 0x3fc93a28 0xffffffff 0x3fc93a28
3fc93a30: 0x3fc93a28 0x00000000 0x3fc93a3c 0xffffffff 0x3fc93a3c 0x3fc93a3c 0x00000000 0x3fc93a50
3fc93a50: 0xffffffff 0x3fc93a50 0x3fc93a50 0x00000000 0x3fc93a64 0xffffffff 0x3fc93a64 0x3fc93a64
3fc93a70: 0x00000000 0x3fc93a78 0xffffffff 0x3fc93a78 0x3fc93a78 0x00000000 0x3fc93a8c 0xffffffff
3fc93a90: 0x3fc93a8c 0x3fc93a8c 0x00000000 0x3fc93aa0 0xffffffff 0x3fc93aa0 0x3fc93aa0 0x00000000
3fc93ab0: 0x3fc93ab4 0xffffffff 0x3fc93ab4 0x3fc93ab4 0x00000000 0x3fc93ac8 0xffffffff 0x3fc93ac8
3fc93ad0: 0x3fc93ac8 0x00000000 0x3fc93adc 0xffffffff 0x3fc93adc 0x3fc93adc 0x00000000 0x3fc93af0
3fc93af0: 0xffffffff 0x3fc93af0 0x3fc93af0 0x00000000 0x3fc93b04 0xffffffff 0x3fc93b04 0x3fc93b04
3fc93b10: 0x00000000 0x3fc93b18 0xffffffff 0x3fc93b18 0x3fc93b18 0x00000001 0x3fc93b2c 0xffffffff
3fc93b30: 0x3fc9ea48 0x3fc9ea48 0x00000000 0x3fc93b40 0xffffffff 0x3fc93b40 0x3fc93b40 0x00000000
3fc93b50: 0x3fc93b54 0xffffffff 0x3fc93b54 0x3fc93b54 0x00000001 0x3fc93b68 0xffffffff 0x3fc9a25c
3fc93b70: 0x3fc9a25c 0x00000000 0x3fc93b7c 0xffffffff 0x3fc93b7c 0x3fc93b7c 0x00000000 0x3fc93b88
3fc93b90: 0x00000000 0x00000000 0x00000000 0x3fc93ba0 0xffffffff 0x3fc93ba0 0x3fc93ba0 0x00000000
3fc93bb0: 0x3fc93bb4 0xffffffff 0x3fc93bb4 0x3fc93bb4 0x00000001 0x00000001 0x00000000 0x0001ffff
3fc93bd0: 0x00000000 0xb33fffff 0x00000000 0x00000000 0x3fc93bdc 0x00000000 0x00000000 0x00000000
3fc93bf0: 0x3fc93bf4 0xffffffff 0x3fc93bf4 0x3fc93bf4 0x00000000 0x3fc93c08 0xffffffff 0x3fc93c08
3fc93c10: 0x3fc93c08 0x00000001 0x00000001 0x00000000 0x0001ffff 0x00000000 0xb33fffff 0x00000000
3fc93c30: 0x00000000 0x3fc98874 0x3fc988dc 0x3fc98944 0x00000000 0x00000000 0x00000001 0x00000000
3fc93c50: 0x00000000 0x00000000 0x420bb55a 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
ELF file SHA256: 0000000000000000
Rebooting...
I assume that’s an issue with Partition size.
Bought those C3 boards which should be Luatos boards with 4MB SPI Flash.
Because after those 10 unsuccesfull boots it switches to Safe mode and connects to WiFi to wait for OTA. I can flash the OTA via ESP Home. but still reboots the same.
there is no easy way to change partitions in configuration.yaml for ESPhome is there?
Did you try changing the board type to the following as suggested?
esp32:
board: esp32-c3-devkitm-1
I have purchased the following ESP32 C3 boards and here is my ESPHome YAML that works on them and it is based on the YAML from the Screek 2A code:
How is the static detection with the recent firmware?
I’ve ordered in the past Sensor 2A, but after testing and chatting with Screek folks, verdict was it is not good for static detection. Any changes? I see that Everything Presence Lite is using LD2450 mmWave sensor by default.
I always can switch to DFRobot SEN0395 mmWave Sensor, but it is pricy. So, the question remains - how is static detection with LD2450, without it where is not use for my project
Everything Presence Lite looks very similar to the 2A code, unfortunately there is no mention of acknowledgements or sources.
Recent firmware has slightly improved the static capabilities, but it’s still a limited form.
Hi, from the information of the device, the device is in good working condition, the problem is on top of the HA parsing information, it’s possible that the networking information of the device has changed, try to remove 2A in HA and then re-add it in (since the auto discovery of the device occurs only for the first time, you may have to write down the IP of 2A and then add this IP by using ESPHome’s manual add.) and see if the if the situation changes. Rebooting the HA might be good too.
we make a small guide about re-add 2a to ha.
Hello @screek-workshop
How often does Stable/Beta Yaml etc. get updated on github?
i see you have a newer beta firmware on the workshop site than the one on github.
In fact community releases have been completing these features for some time, and in general we update the public firmware relatively infrequently if there is no particular need to do so. This is because they may lead to unpredictable behavior.
For anyone looking for one in inches (think I got everything but I may have missed a conversion here or there):
type: custom:plotly-graph
title: Target Positions
refresh_interval: 1
hours_to_show: current_day
layout:
height: 230
margin:
l: 50
r: 20
t: 20
b: 40
showlegend: true
xaxis:
dtick: 39
gridcolor: RGBA(200,200,200,0.15)
zerolinecolor: RGBA(200,200,200,0.15)
type: number
fixedrange: true
range:
- 160
- -160
yaxis:
dtick: 39
gridcolor: RGBA(200,200,200,0.15)
zerolinecolor: RGBA(200,200,200,0.15)
scaleanchor: x
scaleratio: 1
fixedrange: true
range:
- 300
- 0
entities:
- entity: ''
name: Target1
marker:
size: 12
line:
shape: spline
width: 5
x:
- $ex hass.states["sensor.screek_human_sensor_2a_34ec3c_target1_x"].state
'y':
- $ex hass.states["sensor.screek_human_sensor_2a_34ec3c_target1_y"].state
- entity: ''
name: Target2
marker:
size: 12
line:
shape: spline
width: 5
x:
- $ex hass.states["sensor.screek_human_sensor_2a_34ec3c_target2_x"].state
'y':
- $ex hass.states["sensor.screek_human_sensor_2a_34ec3c_target2_y"].state
- entity: ''
name: Target3
marker:
size: 12
line:
shape: spline
width: 5
x:
- $ex hass.states["sensor.screek_human_sensor_2a_34ec3c_target3_x"].state
'y':
- $ex hass.states["sensor.screek_human_sensor_2a_34ec3c_target3_y"].state
- 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["number.screek_human_sensor_2a_34ec3c_zone1_x_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_x_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_x_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_x_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_x_begin"].state / 25.4
'y':
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_begin"].state / 25.4
- entity: ''
name: Zone2
mode: lines
fill: toself
fillcolor: RGBA(200,0,255,0.06)
line:
color: RGBA(200,0,255,0.2)
shape: line
width: 2
x:
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_begin"].state / 25.4
'y':
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_begin"].state / 25.4
- entity: ''
name: Zone3
mode: lines
fill: toself
fillcolor: RGBA(200,120,55,0.06)
line:
color: RGBA(200,120,55,0.2)
shape: line
width: 2
x:
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_begin"].state / 25.4
'y':
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_begin"].state / 25.4
- entity: ''
name: ExZone
mode: lines
fill: toself
fillcolor: RGBA(255,0,0,0.15)
line:
shape: line
width: 1
color: RGBA(255,0,0,0.2)
x:
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_begin"].state / 25.4
'y':
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_end"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_begin"].state / 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_begin"].state / 25.4
- entity: ''
name: Coverage
mode: lines
fill: tonexty
fillcolor: rgba(168, 216, 234, 0.15)
line:
shape: line
width: 1
dash: dot
x:
- 0
- $ex 295 * Math.sin((2 * Math.PI)/360 * 60)
- 177
- 157
- 118
- 79
- 39
- 0
- -39
- -79
- -118
- -157
- -177
- $ex -295 * Math.sin((2 * Math.PI)/360 * 60)
- 0
'y':
- 0
- $ex 295 * Math.cos((2 * Math.PI)/360 * 60)
- $ex Math.sqrt( 295**2 - 177**2 )
- $ex Math.sqrt( 295**2 - 157**2 )
- $ex Math.sqrt( 295**2 - 118**2 )
- $ex Math.sqrt( 295**2 - 79**2 )
- $ex Math.sqrt( 295**2 - 39**2 )
- 295
- $ex Math.sqrt( 295**2 - 39**2 )
- $ex Math.sqrt( 295**2 - 79**2 )
- $ex Math.sqrt( 295**2 - 118**2 )
- $ex Math.sqrt( 295**2 - 157**2 )
- $ex Math.sqrt( 295**2 - 177**2 )
- $ex 295 * Math.cos((2 * Math.PI)/360 * 60)
- 0
raw_plotly_config: true
Edit: fixed to convert zones from mm to in.
Edit again: Here’s one that only shows detected targets (i.e., if x=0 and y=0 it won’t be shown). The plot title indicates how many are detected as well. What a powerful card!
type: custom:plotly-graph
title: |
$fn ({ hass, vars }) => {
const nums = ["1", "2", "3"];
let detection_count = 0;
vars.target_states = [];
nums.forEach(num => {
const xpos = hass.states[`sensor.screek_human_sensor_2a_34ec3c_target${num}_x`].state;
const ypos = hass.states[`sensor.screek_human_sensor_2a_34ec3c_target${num}_y`].state;
if (xpos != 0 || ypos != 0) {
vars.target_states.push([xpos, ypos]);
detection_count += 1;
}
else {
vars.target_states.push([NaN, NaN]);
}
}
)
if (detection_count == 0) {
return "No targets detected";
} else if (detection_count == 1) {
return "1 target detected";
} else {
return `${detection_count} targets detected`;
}
}
refresh_interval: 1
hours_to_show: current_day
layout:
height: 230
margin:
l: 50
r: 20
t: 20
b: 40
showlegend: true
xaxis:
dtick: 39
gridcolor: RGBA(200,200,200,0.15)
zerolinecolor: RGBA(200,200,200,0.15)
type: number
fixedrange: true
range:
- 160
- -160
yaxis:
dtick: 39
gridcolor: RGBA(200,200,200,0.15)
zerolinecolor: RGBA(200,200,200,0.15)
scaleanchor: x
scaleratio: 1
fixedrange: true
range:
- 300
- 0
entities:
- entity: ''
name: Target1
marker:
size: 12
line:
shape: spline
width: 5
x:
- $ex vars.target_states[0][0]
'y':
- $ex vars.target_states[0][1]
- entity: ''
name: Target2
marker:
size: 12
line:
shape: spline
width: 5
x:
- $ex vars.target_states[1][0]
'y':
- $ex vars.target_states[1][1]
- entity: ''
name: Target3
marker:
size: 12
line:
shape: spline
width: 5
x:
- $ex vars.target_states[2][0]
'y':
- $ex vars.target_states[2][1]
- 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["number.screek_human_sensor_2a_34ec3c_zone1_x_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_x_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_x_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_x_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_x_begin"].state
/ 25.4
'y':
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone1_y_begin"].state
/ 25.4
- entity: ''
name: Zone2
mode: lines
fill: toself
fillcolor: RGBA(200,0,255,0.06)
line:
color: RGBA(200,0,255,0.2)
shape: line
width: 2
x:
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_x_begin"].state
/ 25.4
'y':
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone2_y_begin"].state
/ 25.4
- entity: ''
name: Zone3
mode: lines
fill: toself
fillcolor: RGBA(200,120,55,0.06)
line:
color: RGBA(200,120,55,0.2)
shape: line
width: 2
x:
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_x_begin"].state
/ 25.4
'y':
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zone3_y_begin"].state
/ 25.4
- entity: ''
name: ExZone
mode: lines
fill: toself
fillcolor: RGBA(255,0,0,0.15)
line:
shape: line
width: 1
color: RGBA(255,0,0,0.2)
x:
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_x_begin"].state
/ 25.4
'y':
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_end"].state /
25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_begin"].state
/ 25.4
- >-
$ex
hass.states["number.screek_human_sensor_2a_34ec3c_zout1_y_begin"].state
/ 25.4
- entity: ''
name: Coverage
mode: lines
fill: tonexty
fillcolor: rgba(168, 216, 234, 0.15)
line:
shape: line
width: 1
dash: dot
x:
- 0
- $ex 295 * Math.sin((2 * Math.PI)/360 * 60)
- 177
- 157
- 118
- 79
- 39
- 0
- -39
- -79
- -118
- -157
- -177
- $ex -295 * Math.sin((2 * Math.PI)/360 * 60)
- 0
'y':
- 0
- $ex 295 * Math.cos((2 * Math.PI)/360 * 60)
- $ex Math.sqrt( 295**2 - 177**2 )
- $ex Math.sqrt( 295**2 - 157**2 )
- $ex Math.sqrt( 295**2 - 118**2 )
- $ex Math.sqrt( 295**2 - 79**2 )
- $ex Math.sqrt( 295**2 - 39**2 )
- 295
- $ex Math.sqrt( 295**2 - 39**2 )
- $ex Math.sqrt( 295**2 - 79**2 )
- $ex Math.sqrt( 295**2 - 118**2 )
- $ex Math.sqrt( 295**2 - 157**2 )
- $ex Math.sqrt( 295**2 - 177**2 )
- $ex 295 * Math.cos((2 * Math.PI)/360 * 60)
- 0
raw_plotly_config: true
Has anyone attempted to use this sensor via an Olimex or similar POE ESP32 board?
The dynamic headers look cool, and our code unifies some variables at the same time, see our changes below.
# Cards are based on athua's code (https://github.com/athua/ha-utils) with some custom modifications.
# Code version: 2024.01.15 - Simple
# Docs: https://docs.screek.io/2a/add-a-map-card
type: custom:plotly-graph
refresh_interval: 1
hours_to_show: current_day
config:
modeBarButtonsToRemove:
- select2d
- lasso2d
- toImage
displaylogo: false
layout:
height: 240
margin:
l: 40
r: 20
t: 20
b: 55
showlegend: false
xaxis:
showticklabels: false
dtick: 1000
gridcolor: RGBA(200,200,200,0.15)
zerolinecolor: RGBA(200,200,200,0.15)
type: number
fixedrange: true
range:
- 4000
- -4000
yaxis:
showticklabels: false
dtick: 1000
gridcolor: RGBA(200,200,200,0.15)
zerolinecolor: RGBA(200,200,200,0.15)
scaleanchor: x
scaleratio: 1
fixedrange: true
range:
- 7500
- 0
entities:
- entity: ''
fn_var1: $ex vars.sensor_id = "d18234";
fn_var2: $ex vars.sensor_name_prefix = "sensor.screek_human_sensor_2a_" + vars.sensor_id + "_";
fn_var3: $ex vars.number_name_prefix = "number.screek_human_sensor_2a_" + vars.sensor_id + "_";
fn_var4: $ex vars.is_inch_unit = hass.states[vars.sensor_name_prefix + "target1_x"].attributes.unit_of_measurement == "in";
# name: sensor_id
- entity: ''
name: Target1
marker:
size: 10
symbol: star-diamond
line:
shape: spline
width: 5
x:
- $ex {
var x = hass.states[vars.sensor_name_prefix + "target1_x"].state;
var y = hass.states[vars.sensor_name_prefix + "target1_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 + "target1_x"].state;
var y = hass.states[vars.sensor_name_prefix + "target1_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 + "target2_x"].state;
var y = hass.states[vars.sensor_name_prefix + "target2_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 + "target2_x"].state;
var y = hass.states[vars.sensor_name_prefix + "target2_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 + "target3_x"].state;
var y = hass.states[vars.sensor_name_prefix + "target3_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 + "target3_x"].state;
var y = hass.states[vars.sensor_name_prefix + "target3_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 + "zone1_x_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_x_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_x_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_x_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_x_begin"].state
y:
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_y_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_y_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_y_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_y_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone1_y_begin"].state
- entity: ''
name: Zone2
mode: lines
fill: toself
fillcolor: RGBA(200,0,255,0.06)
line:
color: RGBA(200,0,255,0.2)
shape: line
width: 2
x:
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_x_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_x_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_x_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_x_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_x_begin"].state
y:
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_y_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_y_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_y_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_y_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone2_y_begin"].state
- entity: ''
name: Zone3
mode: lines
fill: toself
fillcolor: RGBA(200,120,55,0.06)
line:
color: RGBA(200,120,55,0.2)
shape: line
width: 2
x:
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_x_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_x_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_x_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_x_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_x_begin"].state
y:
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_y_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_y_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_y_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_y_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zone3_y_begin"].state
- entity: ''
name: ExZone
mode: lines
fill: toself
fillcolor: RGBA(255,0,0,0.15)
line:
shape: line
width: 1
color: RGBA(255,0,0,0.2)
x:
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_x_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_x_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_x_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_x_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_x_begin"].state
y:
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_y_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_y_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_y_end"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_y_begin"].state
- >-
$ex
hass.states[vars.number_name_prefix + "zout1_y_begin"].state
- entity: ''
name: Coverage
mode: lines
fill: tonexty
fillcolor: rgba(168, 216, 234, 0.15)
line:
shape: line
width: 1
dash: dot
x:
- 0
- $ex 7500 * Math.sin((2 * Math.PI)/360 * 60)
- 5500
- 4500
- 4000
- 3000
- 2000
- 1000
- 0
- -1000
- -2000
- -3000
- -4000
- -4500
- -5500
- $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 - 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 7500 * Math.cos((2 * Math.PI)/360 * 60)
- 0
raw_plotly_config: true
title: $ex "Human Sensor 2A " + vars.sensor_id + " Map"