VPD control dashboard

I was looking for VPD control dashboard but have not a found solution.
That’s why I started to create my own one.

Hardware needed:

  • A Temp / RH sensor (I’ve use Shelly Blue H&T)
  • A humidifier which can be turned on and of by a smart plug.
  • A smart plug (I’ve used a Shelly Plug S)

I also would like to have the option to add an offset to both sensors.
You would need to have a calibrated sensor on hand (or you know someone who give you a loaner) to calculate the offset.

This is how it looks like:

Steps to make it work:

  • have the sensor hardware added to Home Assistant.
  • find below the what u need to add to your configuration.yaml
template:
  - sensor:
      - name: "VPD in kilopascal"
        unit_of_measurement: "kPa"
        device_class: pressure
        state_class: measurement
        state: >
          {% set T = states('sensor.tent_temp_with_offset')|float(0) %}
          {% set RH = states('sensor.tent_rh_with_offset')|float(0) %}
          {% set SVP = 0.61078 * e ** (17.2694 * T / (T + 238.3)) %}
          {% set VPD = ((100-RH) / 100) * SVP %}
          {{-VPD | round(3) -}}
  - sensor:
      - name: "tent RH with offset"
        unit_of_measurement: "%"
        device_class: humidity
        state: >
          {% set tent_rh = states('sensor.sbht_003c_f740_humidity')|float %}
          {% set offset = states('input_number.tent_rh_offset')|float %}
          {{ (tent_rh + offset)}}
  - sensor:
      - name: "tent temp with offset"
        unit_of_measurement: "°C"
        device_class: temperature
        state: >
          {% set tent_temp = states('sensor.sbht_003c_f740_temperature')|float %}
          {% set offset = states('input_number.tent_temp_offset')|float %}
          {{ (tent_temp + offset)}}

The first sensor calculates the VPD value, it is important to mention here, the “T” an “RH” state is pulled from the “tent RH with offset” and “tent temp with offset” sensors.
To get the “offset sensors” to work you also would need to create two “helpers”

  • helper “tent_temp_offset”

  • helper "tent_rh_offset

Last step is to create an automation for turning on and off the humidifier.

alias: rh_control
description: ""
trigger:
  - platform: numeric_state
    entity_id:
      - sensor.vpd_in_kilopascal
    above: 1.4
condition: []
action:
  - type: turn_on
    device_id: 1ee1413b9bef274f2be0fe6d5767b62b
    entity_id: switch.rh_control_switch
    domain: switch
  - wait_for_trigger:
      - platform: numeric_state
        entity_id:
          - sensor.vpd_in_kilopascal
        below: 1.3
  - type: turn_off
    device_id: 1ee1413b9bef274f2be0fe6d5767b62b
    entity_id: switch.rh_control_switch
    domain: switch
mode: restart

You need to adjust the “above” and “below” value according to your VPD needs.
As I live in a more dry region I only need to take care on increasing the humidity.

Enjoy.

hi sorry Dwayne here need help how do i create the helpers very new to home assistant

Hey Dwayne,

Go to Settings → Devices and Services
On the top you’ll find the tab for “Helpers”

Thanks to your post I finally worked out how to trigger my humidifier using VPD inplace of Humidity.

I changed the code up a little though and added the ability to change your set VPD on the upper and lower limits.

#Input for setting VPD#
#Upper VPD Limit#
input_number:
  set_upper_vpd:
    name: Upper VPD Limit
    min: 0.1 
    max: 2.0 
    step: 0.01 
#Lower VPD Limit#
  set_lower_vpd:
    name: Lower VPD Limit
    min: 0.1
    max: 2.0
    step: 0.01
#Lower VPD#
#Lower VPD On#
#Turns on exhaust fan for tent to raise VPD#
  - alias: VPD Lower On
    trigger: 
      - platform: time_pattern
    seconds: '10'
    condition:
  - condition: numeric_state
    entity_id: sensor.vapor_deficit
    below: input_number.set_lower_vpd
  - condition: device
    type: is_off 
    entity_id: switch.comuter
    domain: switch
    action:
  - type: turn_on
    entity_id: switch.comuter
    domain: switch
    mode: single
#Lower VPD Off#
#Turns off exhaust fan#
  - alias: Lower VPD Off
    trigger: 
      - platform: time_pattern
    seconds: '10'
    condition:
  - condition: numeric_state
    entity_id: sensor.vapor_deficit
    below: input_number.set_lower_vpd
  - condition: device
    type: is_on 
    entity_id: switch.comuter
    domain: switch
    action:
  - type: turn_on
    entity_id: switch.comuter
    domain: switch
    mode: single
#Upper VPD#
#Upper VPD On#
#Turns on humidifier to lower VPD#
  - id: '1723294058329'
    alias: 'Upper VPD On'
    description: ''
    trigger:
    - platform: time_pattern
      seconds: '10'
    condition:
    - condition: numeric_state
      entity_id: sensor.vapor_deficit
      above: input_number.set_upper_vpd
    - condition: device
      type: is_off
      device_id: 7b84d9d97ce5d08ef918963f6898619b
      entity_id: a0c3bdfc78372a9d5581ba10a1bcc647
      domain: switch
    action:
    - type: turn_on
      device_id: 7b84d9d97ce5d08ef918963f6898619b
      entity_id: a0c3bdfc78372a9d5581ba10a1bcc647
      domain: switch
    mode: single
#Upper VPD Off#
  - id: '1723295279666'
    alias:  Upper VPD Off 
    description: ''
    trigger:
    - platform: time_pattern
      seconds: '10'
    condition:
    - condition: numeric_state
      entity_id: sensor.vapor_deficit
      below: input_number.set_upper_vpd
    - condition: device
      type: is_on
      device_id: 7b84d9d97ce5d08ef918963f6898619b
      entity_id: a0c3bdfc78372a9d5581ba10a1bcc647
      domain: switch
    action:
    - type: turn_off
      device_id: 7b84d9d97ce5d08ef918963f6898619b
      entity_id: a0c3bdfc78372a9d5581ba10a1bcc647
      domain: switch
    mode: single

You still need to calculate the VPD using your calculation but this will allow you to change the VPD you want to target.

If you were to keep adding time based automations you could have it automatically change the set VPD based on days of growth.
I am using


  #Grow Day Calculator#
  - platform: template
    sensors:
      days_of_growth:
        friendly_name: "Days of Growth"
        unit_of_measurement: "days"
        value_template: "{{ ((as_timestamp(now()) - as_timestamp(states('input_datetime.grow_days'))) / 86400) | int }}"

Automations should just need to reference the sensor and once you complete what you are growing reset the date of input_datetime.grow_days that then sets the sensor to zero.

what type of sensor are you using for the offsets?

I am very new to HA, maybe you can help me with the missing steps. I created a vpd.yaml in a custom_templates folder i created. It seem´s to be loading, because i managed to create the helpers and afterwards the two offset buttons on my dashboard and assign them a value. But i still could not figure out how to get get graphics and graphs. Which steps am I missing?

Off topic:
I am planning to add a small python script to HA, which counts 10 different tones from yellow to green from an rtsp stream. That script is already working. Tell me, if you might be interested and willing to help.

Hey there,

For the VPD dashboard I’ve used the new view type with sections because it makes live easier to arrange the tiles.

Start with creating a new dashboard with View type “sections”.

Create your first section.

Now add a gauge card and and assign e.G the entity (in my case) "VPD in Kilopascal.
On the gauge card enable “Display as needle gauge” and “Define severity”

Now define the green yellow and red value.

For the history I’ve used the “Plotly Graph Card” from the HACS repository.

The configuration of this card is self explaining.

Regarding the off topic, not sure if I can help but happy to try :wink:

1 Like

Thank for your input to create some more advantages to the VDP dashboard.

I’ll give it a try.

Thank you very much for your help! I will give the Plotly Graph a try! Regarding off topic, i opened a new one here: