mentalilll / ha-vpd-chart

VPD Chart for Homeassistant
48 stars 0 forks source link

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

Open faBoulitt opened 1 week ago

faBoulitt commented 1 week ago

Checklist

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

lmnx commented 2 days ago

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.