Latest screen is plant data using the OpenPlantbook integration and the Plant integration from HACS.
If progress bar is black then values are within what plant likes, else it becomes red.
All progress bars are set up so that they display the what the value is within the range.
As an example the carrot want’s between 15 and 60% soil humidity and it’s currently 39% that means it shows up as 53% in the progress bar, but the text says 39%.
Automation to get these displays is below.
You should not need to change anything but the first three variables, meaning sensor_prefix, plant and icon.
All the other values and calculations are based upon these.
The sensor_prefix is should be to the plant sensor values (the physical device in the pot).
alias: Display Morot
description: ""
variables:
sensor_prefix: sensor.morot_
plant: plant.morot
icon: carrot
spieces: "{{ state_attr(plant, 'species') | lower | replace(' ', '_') }}"
max_soil: "{{ state_attr('openplantbook.' ~ spieces , 'max_soil_moist') }}"
min_soil: "{{ state_attr('openplantbook.' ~ spieces , 'min_soil_moist') }}"
max_temp: "{{ state_attr('openplantbook.' ~ spieces , 'max_temp') }}"
min_temp: "{{ state_attr('openplantbook.' ~ spieces , 'min_temp') }}"
max_hum: "{{ state_attr('openplantbook.' ~ spieces , 'max_env_humid') }}"
min_hum: "{{ state_attr('openplantbook.' ~ spieces , 'min_env_humid') }}"
max_cond: "{{ state_attr('openplantbook.' ~ spieces , 'max_soil_ec') }}"
min_cond: "{{ state_attr('openplantbook.' ~ spieces , 'min_soil_ec') }}"
max_lux: "{{ state_attr('openplantbook.' ~ spieces , 'max_light_lux') }}"
min_lux: "{{ state_attr('openplantbook.' ~ spieces , 'min_light_lux') }}"
max_mmol: "{{ (state_attr('openplantbook.' ~ spieces , 'max_light_mmol') * 0.0036) | int + 1 }}"
min_mmol: "{{ (state_attr('openplantbook.' ~ spieces , 'min_light_mmol') * 0.0036) | int }}"
triggers:
- trigger: time_pattern
hours: /2
conditions: []
actions:
- action: open_epaper_link.drawcustom
data:
background: white
rotate: 0
dither: "0"
ttl: 60
dry-run: false
payload:
- type: icon
value: "{{ icon }}"
x: 5
"y": -5
size: 30
color: black
- type: text
value: "{{ state_attr(plant, 'friendly_name') }}"
font: ppb.ttf
x: 35
"y": 0
size: 25
color: black
- type: line
x_start: 0
x_end: 298
y_start: 21
y_end: 21
width: 2
fill: black
- type: icon
value: >-
{{ ('mdi:battery-' ~ ((states(sensor_prefix ~
'battery'))|int/10)|int*10) | replace('-100','') }}
x: 280
"y": 0
size: 20
color: black
- type: icon
value: >-
{% set hr = {0:"twelve", 1:"one", 2:"two", 3:"three", 4:"four",
5:"five", 6:"six", 7:"seven", 8:"eight", 9:"nine", 10:"ten",
11:"eleven", 12:"twelve",} %} mdi:clock-time-{{ hr[now().hour % 12]
}}-outline
x: 255
"y": -1
size: 24
color: black
- type: icon_sequence
x: 0
"y": 25
icons:
- mdi:water-percent
- mdi:thermometer-high
- mdi:cloud-percent-outline
size: 30
direction: down
- type: progress_bar
x_start: 32
y_start: 32
x_end: 80
y_end: 46
fill: |
{% set p = states(sensor_prefix ~ 'soil_moisture') | float %}
{% set percent = (p-min_soil)/(max_soil-min_soil)*100 %}
{{ 'black' if 0.1 < percent and percent <= 100 else 'red' }}
outline: black
width: 1
progress: |
{% set p = states(sensor_prefix ~ 'soil_moisture') | float %}
{{ (p-min_soil)/(max_soil-min_soil)*100 }}
direction: right
show_percentage: false
font: ppb.ttf
- type: text
value: "{{ states(sensor_prefix ~ 'soil_moisture') | int }}%"
font: ppb.ttf
x: 85
"y": 32
size: 16
color: black
- type: progress_bar
x_start: 32
y_start: 70
x_end: 80
y_end: 84
fill: |
{% set t = states(sensor_prefix ~ 'temperature') | float %}
{% set percent = (t-min_temp)/(max_temp-min_temp)*100 %}
{{ 'black' if 0.1 < percent and percent <= 100 else 'red' }}
outline: black
width: 1
progress: |
{% set t = states(sensor_prefix ~ 'temperature') | float %}
{{ (t-min_temp)/(max_temp-min_temp)*100 }}
direction: right
show_percentage: false
font: ppb.ttf
- type: text
value: "{{ states(sensor_prefix ~ 'temperature') | int }}°C"
font: ppb.ttf
x: 85
"y": 70
size: 16
color: black
- type: progress_bar
x_start: 32
y_start: 108
x_end: 80
y_end: 122
fill: |
{% set h = states(sensor_prefix ~ 'air_humidity') | float %}
{% set percent = (h-min_hum)/(max_hum-min_hum)*100 %}
{{ 'black' if 0.1 < percent and percent <= 100 else 'red' }}
outline: black
width: 1
progress: |
{% set h = states(sensor_prefix ~ 'air_humidity') | float %}
{{ (h-min_hum)/(max_hum-min_hum)*100 }}
direction: right
show_percentage: false
font: ppb.ttf
- type: text
value: "{{ states(sensor_prefix ~ 'air_humidity') | int }}%"
font: ppb.ttf
x: 85
"y": 108
size: 16
color: black
- type: icon_sequence
x: 130
"y": 25
icons:
- mdi:flower
- mdi:white-balance-sunny
- mdi:sun-clock
size: 30
direction: down
- type: progress_bar
x_start: 163
y_start: 32
x_end: 211
y_end: 46
fill: |
{% set c = states(sensor_prefix ~ 'conductivity') | float %}
{% set percent = (c-min_cond)/(max_cond-min_cond)*100 %}
{{ 'black' if 0.1 < percent and percent <= 100 else 'red' }}
outline: black
width: 1
progress: |
{% set c = states(sensor_prefix ~ 'conductivity') | float %}
{{ (c-min_cond)/(max_cond-min_cond)*100 }}
direction: right
show_percentage: false
font: ppb.ttf
- type: text
value: "{{ states(sensor_prefix ~ 'conductivity') | int }}"
font: ppb.ttf
x: 216
"y": 32
size: 16
color: black
- type: text
value: µS
font: ppb.ttf
x: 262
"y": 24
size: 16
color: black
- type: line
x_start: 260
x_end: 290
y_start: 39
y_end: 39
width: 1
fill: black
- type: text
value: cm
font: ppb.ttf
x: 261
"y": 41
size: 16
color: black
- type: progress_bar
x_start: 163
y_start: 70
x_end: 211
y_end: 84
fill: |
{% set l = states(sensor_prefix ~ 'illuminance') | float %}
{% set percent = (l-min_lux)/(max_lux-min_lux)*100 %}
{{ 'black' if 0.1 < percent and percent <= 100 else 'red' }}
outline: black
width: 1
progress: |
{% set l = states(sensor_prefix ~ 'illuminance') | float %}
{{ (l-min_lux)/(max_lux-min_lux)*100 }}
direction: right
show_percentage: false
font: ppb.ttf
- type: text
value: "{{ states(sensor_prefix ~ 'illuminance') | int }} lux"
font: ppb.ttf
x: 216
"y": 70
size: 16
color: black
- type: progress_bar
x_start: 163
y_start: 108
x_end: 211
y_end: 122
fill: |
{% set dli = states(sensor_prefix ~ 'dli') | float %}
{% set percent = (dli-min_mmol)/(max_mmol-min_mmol)*100 %}
{{ 'black' if 0.1 < percent and percent <= 100 else 'red' }}
outline: black
width: 1
progress: |
{% set dli = states(sensor_prefix ~ 'dli') | float %}
{{ (dli-min_mmol)/(max_mmol-min_mmol)*100 }}
direction: right
show_percentage: false
font: ppb.ttf
- type: text
value: "{{ states(sensor_prefix ~ 'dli') |round(2) }}"
font: ppb.ttf
x: 216
"y": 108
size: 16
color: black
- type: text
value: mol
font: ppb.ttf
x: 260
"y": 98
size: 16
color: black
- type: line
x_start: 260
x_end: 290
y_start: 113
y_end: 113
width: 1
fill: black
- type: text
value: dm²
font: ppb.ttf
x: 260
"y": 115
size: 16
color: black
target:
device_id:
- e34881c6b711f1a56d36316758eda1b9
mode: single

