Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GrowSmart - ESPHome
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Grewe
GrowSmart - ESPHome
Commits
925863f3
Commit
925863f3
authored
3 years ago
by
Jan Grewe
Browse files
Options
Downloads
Patches
Plain Diff
add selects for max/min/hysteresis
remove globals, use only selects
parent
dcaf0bd1
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
propbox.yaml
+53
-31
53 additions, 31 deletions
propbox.yaml
with
53 additions
and
31 deletions
propbox.yaml
+
53
−
31
View file @
925863f3
...
...
@@ -19,13 +19,6 @@ substitutions:
schedule_bloom_on
:
"
0
*
*
*
*
*"
schedule_bloom_off
:
"
30
*
*
*
*
*"
temperature_max
:
"
27"
temperature_min
:
"
21"
temperature_hysteresis
:
"
2"
humidity_max
:
"
70"
humidity_min
:
"
40"
humidity_hysteresis
:
"
5"
<<
:
!include
common.yaml
esp32
:
...
...
@@ -44,12 +37,6 @@ http_request:
useragent
:
esphome/${devicename}
timeout
:
10s
globals
:
-
id
:
schedule
type
:
int
restore_value
:
true
initial_value
:
'
0'
text_sensor
:
!include
include/text_sensors.yaml
...
...
@@ -96,19 +83,54 @@ sensor:
select
:
-
platform
:
template
id
:
select_
schedule
id
:
schedule
name
:
"
Light
Schedule"
options
:
-
"
Disabled"
-
"
Grow"
-
"
Bloom"
options
:
[
"
Disabled"
,
"
Grow"
,
"
Bloom"
]
initial_option
:
"
Disabled"
optimistic
:
true
restore_value
:
true
-
platform
:
template
id
:
temperature_max
name
:
"
Temperature:
Fan
On"
options
:
[
"
21"
,
"
22"
,
"
23"
,
"
24"
,
"
25"
,
"
26"
,
"
27"
,
"
28"
,
"
29"
]
initial_option
:
"
27"
optimistic
:
true
restore_value
:
true
-
platform
:
template
id
:
temperature_hysteresis
name
:
"
Temperature:
Fan
Hysteresis"
options
:
[
"
1"
,
"
2"
,
"
3"
,
"
4"
,
"
5"
]
initial_option
:
"
2"
optimistic
:
true
restore_value
:
true
-
platform
:
template
id
:
temperature_min
name
:
"
Temperature:
Fan
Off"
options
:
[
"
19"
,
"
20"
,
"
21"
,
"
22"
,
"
23"
,
"
24"
,
"
25"
]
initial_option
:
"
21"
optimistic
:
true
restore_value
:
true
-
platform
:
template
id
:
humidity_max
name
:
"
Humidity:
Fan
On"
options
:
[
"
40"
,
"
45"
,
"
50"
,
"
55"
,
"
60"
,
"
65"
,
"
70"
,
"
75"
]
initial_option
:
"
70"
optimistic
:
true
restore_value
:
true
-
platform
:
template
id
:
humidity_hysteresis
name
:
"
Humidity:
Fan
Hysteresis"
options
:
[
"
5"
,
"
10"
,
"
15"
]
initial_option
:
"
5"
optimistic
:
true
restore_value
:
true
-
platform
:
template
id
:
humidity_min
name
:
"
Humidity:
Fan
Off"
options
:
[
"
20"
,
"
25"
,
"
30"
,
"
35"
,
"
40"
,
"
45"
,
"
50"
]
initial_option
:
"
40"
optimistic
:
true
restore_value
:
true
on_value
:
then
:
-
lambda
:
|-
auto index = id(select_schedule).active_index();
id(schedule) = index.value();
switch
:
-
platform
:
restart
...
...
@@ -151,28 +173,28 @@ time:
-
cron
:
${schedule_grow_on}
then
:
-
lambda
:
|-
if (id(schedule)
== 1
) {
if (id(schedule)
.state == "Grow"
) {
id(propbox_light).turn_on();
id(propbox_light).publish_state(true);
}
-
cron
:
${schedule_grow_off}
then
:
-
lambda
:
|-
if (id(schedule)
== 1
) {
if (id(schedule)
.state == "Grow"
) {
id(propbox_light).turn_off();
id(propbox_light).publish_state(false);
}
-
cron
:
${schedule_bloom_on}
then
:
-
lambda
:
|-
if (id(schedule)
== 2
) {
if (id(schedule)
.state == "Bloom"
) {
id(propbox_light).turn_on();
id(propbox_light).publish_state(true);
}
-
cron
:
${schedule_bloom_off}
then
:
-
lambda
:
|-
if (id(schedule)
== 2
) {
if (id(schedule)
.state == "Bloom"
) {
id(propbox_light).turn_off();
id(propbox_light).publish_state(false);
}
...
...
@@ -184,8 +206,8 @@ script:
// switch fan on when temperature/humidity is above the limit, unless humidity/temperature is below the limit
if (
!id(propbox_fan).state &&
(id(temperature).state >=
${
temperature_max
}
&& id(humidity).state >=
${
humidity_min
}
) ||
(id(humidity).state >=
${
humidity_max
}
&& id(temperature).state >=
${
temperature_min
}
)
(id(temperature).state >=
atoi(id(
temperature_max
).state.c_str())
&& id(humidity).state >=
atoi(id(
humidity_min
).state.c_str())
) ||
(id(humidity).state >=
atoi(id(
humidity_max
).state.c_str())
&& id(temperature).state >=
atoi(id(
temperature_min
).state.c_str())
)
) {
id(propbox_fan).turn_on();
id(propbox_fan).publish_state(true);
...
...
@@ -194,8 +216,8 @@ script:
// switch fan off when temperature and humidity are below the limits minus hysteresis
else if (
id(propbox_fan).state &&
id(temperature).state <=
${
temperature_max
} - ${
temperature_hysteresis
}
&&
id(humidity).state <=
${
humidity_max
} - ${
humidity_hysteresis
}
id(temperature).state <=
atoi(id(
temperature_max
).state.c_str()) - atoi(id(
temperature_hysteresis
).state.c_str())
&&
id(humidity).state <=
atoi(id(
humidity_max
).state.c_str()) - atoi(id(
humidity_hysteresis
).state.c_str())
) {
id(propbox_fan).turn_off();
id(propbox_fan).publish_state(false);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment