Skip to content

Commit

Permalink
- Fixed VPD using Bug
Browse files Browse the repository at this point in the history
- modified tooltip
- calculate offscreen sensor tooltips
- moved css to css files
- added leaf_temperature_offset
- modified readme
- modified hacs.json
  • Loading branch information
inZaneX committed Feb 23, 2024
1 parent 99c7028 commit 6d8e384
Show file tree
Hide file tree
Showing 5 changed files with 613 additions and 601 deletions.
47 changes: 25 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ is_bar_view: true
sensors:
- temperature: sensor.temperature_2
humidity: sensor.humidity_2
leafTemperature: sensor.infrared_sensor
leaf_temperature: sensor.infrared_sensor
name: Tent 1
- temperature: sensor.temperature_tent_2
humidity: sensor.humidity_tent_2
vpd: sensor.vpd
leaf_temperature_offset: 3 # optional and is ignored if leaf_temperature isset
name: Tent 2
vpd_phases:
- upper: 0.4
Expand Down Expand Up @@ -166,29 +167,31 @@ min_humidity: 10
max_humidity: 100
steps_humidity: 1
steps_temperature: 0.5
is_bar_view: true
sensors:
- temperature: sensor.temperatur_2
humidity: sensor.luftfeuchtigkeit_2
leafTemperature: sensor.infrared_sensor
name: Zelt 1
- temperature: sensor.temperatur_zelt_2
humidity: sensor.luftfeuchtigkeit_zelt_2
vpd: sensor.vpd
name: Zelt 2
- temperature: sensor.temperature_2
humidity: sensor.humidity_2
leaf_temperature: sensor.infrared_sensor
name: Tent 1
- temperature: sensor.temperature_tent_2
humidity: sensor.humidity_tent_2
vpd: sensor.vpd
leaf_temperature_offset: 3 # optional and is ignored if leaf_temperature isset
name: Tent 2
vpd_phases:
- upper: 0.4
className: under-transpiration
- lower: 0.4
upper: 0.8
className: early-veg
- lower: 0.8
upper: 1.2
className: late-veg
- lower: 1.2
upper: 1.6
className: mid-late-flower
- lower: 1.6
className: danger-zone
- upper: 0.4
className: under-transpiration
- lower: 0.4
upper: 0.8
className: early-veg
- lower: 0.8
upper: 1.2
className: late-veg
- lower: 1.2
upper: 1.6
className: mid-late-flower
- lower: 1.6
className: danger-zone
```
## Konfigurationsparameter

Expand Down
93 changes: 93 additions & 0 deletions assets/bar.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
.ha-card {
width: 100%;
}
.type-custom-ha-vpd-chart
{
margin-bottom:5px;
}
.bar {
box-shadow: inset 0 0 3em -1.2em rgba(0, 0, 0, 0.5);
padding:15px;
border-radius: 5px;
}
.bar span {
border-left:1px solid #999999;
padding-left:15px;
padding-right:15px;
}
.bar span:first-child {
border-left:0;
padding-left:0;
}
.legend {
box-shadow: inset 0 0 3em -1.2em rgba(0, 0, 0, 0.5);
padding:15px;
}
.vpd-state {
float:right;
width:20px;
height:20px;
padding:0 !important;
border-left:0 !important;
border-radius: 5px;
}

.vpd-state-legend {
padding:0 !important;
border-left:0 !important;
}
.vpd-state-legend span:first-child {
width:20px;
height:20px;
padding-left:15px;
padding-right:5px;
margin-right:5px;
}
.vpd-state-legend span:last-child {

margin-right:5px;
}
.danger-zone {
background-color: #ce4234;
}

.early-veg {
background-color: #22ab9c;

}

.late-veg {
background-color: #9cc55b;

}

.mid-late-flower {
background-color: #e7c12b;
}

.under-transpiration {
background-color: #1a6c9c;
}
/* style parent of under-transpiration border */
.vpd-state.under-transpiration::before {
background: linear-gradient(-90deg, rgba(26,108,156,0.47) 0%, rgba(26, 108, 156, 0) 100%);
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;

border-radius: 5px;
}
.vpd-state.danger-zone::before {
/* gradient from this color to transparent */
background: linear-gradient(-90deg, rgba(206,66,52,0.47) 0%, rgba(206, 66, 52, 0) 100%);
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border-radius: 5px;
}
106 changes: 106 additions & 0 deletions assets/chart.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
ha-card, ha-card .vpd-card-container {
height: 100%;
min-height: 400px;
overflow:hidden;
}

body, html {
font-family: "Segoe UI", Arial, sans-serif;
font-size: 10px;
margin: 0;
padding: 0;
height: 100%;
position: relative;
}

.danger-zone {
background-color: #ce4234;
}

.early-veg {
background-color: #22ab9c;
}

.late-veg {
background-color: #9cc55b;
}

.mid-late-flower {
background-color: #e7c12b;
}

.under-transpiration {
background-color: #1a6c9c;
}

table {
width: 100%;
height: 100%;
}

table, th, td {
border: 1px solid rgba(255, 255, 255, 0.05);
border-collapse: collapse;
}

th, td {
text-align: center;
min-width: 2px;
}

.highlight {
position: relative;
z-index: 2;
background-color: white !important; /* oder eine andere Farbe Ihrer Wahl */
color: #333333 !important;
pointer-events: none;
}
.mousePointer {
z-index:9999;
}
.mouse-custom-tooltip,
.custom-tooltip {
bottom: 70%;
margin-bottom: 5px;

padding: 7px;
width: max-content;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
background-color: #000000;
background-color: hsla(0, 0%, 20%, 0.9);
color: #ffffff;
text-align: center;
font-size: 12px;
line-height: 1.2;
position: absolute;
}
.mouse-custom-tooltip {
right: 10px;
top: 10px;
bottom:auto;
}

.vpd-table {
display: table;
width: 100%;
height: 100%;
}

.row {
display: table-row;
background-color: #ffffff;
}

.cell {
display: table-cell;
}
#sensors {
width:100%;
height:100%;
position:absolute;
top:0;
left:0;
pointer-events: none;
}
Loading

0 comments on commit 6d8e384

Please sign in to comment.