Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaf Temp Offset between 0-2 has no effect #19

Open
2 tasks
faBoulitt opened this issue Oct 6, 2024 · 7 comments
Open
2 tasks

Leaf Temp Offset between 0-2 has no effect #19

faBoulitt opened this issue Oct 6, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@faBoulitt
Copy link

faBoulitt commented Oct 6, 2024

Checklist

  • I updated the card to the latest version available
  • I cleared the cache of my browser

Describe the bug
I am using a ambient temperature sensor and a Hygrometer, the value for the leaf temperature is not measured. So I put nothing into the field for the leaf temperature sensor.
Setting the value of the leaf temperature offset to a value between 0 - 2 has no effect on the VPD value.
When using values >2.0 it changes the VPD.

Version of the card
Version: v1.5.0

To Reproduce
This is the configuration I used:

type: custom:ha-vpd-chart
sensors:
  - humidity: sensor.t_h_sensor_humidity
    name: VPD Leaf
    temperature: sensor.t_h_sensor_temperature
vpd_phases:
  - upper: 0
    className: gray-danger-zone
    color: '#999999'
  - lower: 0
    upper: 0.4
    className: under-transpiration
    color: '#1a6c9c'
  - lower: 0.4
    upper: 0.8
    className: early-veg
    color: '#22ab9c'
  - lower: 0.8
    upper: 1.2
    className: late-veg
    color: '#9cc55b'
  - lower: 1.2
    upper: 1.6
    className: mid-late-flower
    color: '#e7c12b'
  - lower: 1.6
    className: danger-zone
    color: '#ce4234'
is_bar_view: false
max_temperature: 30
min_height: 200
enable_tooltip: true
air_text: Air
rh_text: RH
kpa_text: kPa
enable_axes: true
enable_ghostclick: true
enable_ghostmap: true
enable_triangle: true
enable_crosshair: true
enable_fahrenheit: false
enable_zoom: true
enable_show_always_informations: true
enable_legend: false
ghostmap_hours: 24
unit_temperature: °C
min_temperature: 15
min_humidity: 30
max_humidity: 70
leaf_temperature_offset: 0

Expected behavior
VPD is rising when rising the leaf temperature offset value from 0 to 2.

Desktop (please complete the following information):
Home Assistant OS
Core
2024.5.5
Supervisor
2024.09.1
Operating System
13.1
Frontend
20240501.1

@faBoulitt faBoulitt added the bug Something isn't working label Oct 6, 2024
@lmnx
Copy link

lmnx commented Oct 16, 2024

I noticed the same behavior but never bothered since I've switched back to the other HA VPD Card until this issue and Issue 18 is fixed.

Anyhow, the plugin is hardcoded to default offset value to 2 if it's <2. This is the code line.

@mentalilll do you mind having a look? My apology if this is an unwelcomed ping.

@microfx
Copy link

microfx commented Nov 7, 2024

has no effect at all here … seems like only the wrong Air temperature is displayed since my template sensor with a VPD formula has the same VPD value as shown

@NoXPhasma
Copy link

@microfx

There are 3 parts in the file, that need to be uncommented, to make it work:

if (this.config.leaf_temperature_offset < 2) {
return 2;
}

if (offset < 2) {
return 2;
}

if (offset < 2) {
offset = 2;
}

Here's a patch.

Then create a new cached version of the file:

sudo gzip -fk methods.js

Finally restart HA.

@microfx
Copy link

microfx commented Nov 19, 2024 via email

@NoXPhasma
Copy link

The change above does not change the value you set. It only comments out if statements, that would force it to be 2.

@microfx
Copy link

microfx commented Nov 19, 2024 via email

@mentalilll
Copy link
Owner

Sorry for the late response :P
microfx is right, there are

currently it's more or less only change the values on the tooltip. thats not a good way to handle that.
i try to figure out what would be the best and do we really need a switch to handle that.

but i have no time to fix that right now. I try to fix it within christmas holidays :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants