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
8a73b474
Commit
8a73b474
authored
2 years ago
by
Jan Grewe
Browse files
Options
Downloads
Patches
Plain Diff
switch fan_control from power socket to PWM
parent
b92a4093
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
README.md
+1
-0
1 addition, 0 deletions
README.md
packages/fan.yaml
+23
-13
23 additions, 13 deletions
packages/fan.yaml
packages/light.yaml
+3
-3
3 additions, 3 deletions
packages/light.yaml
propbox.yaml
+8
-0
8 additions, 0 deletions
propbox.yaml
with
35 additions
and
16 deletions
README.md
+
1
−
0
View file @
8a73b474
...
...
@@ -7,6 +7,7 @@ Home Grow(n) Monitoring
*
propbox: ESP32 Propagator Controller
*
BME280 Temperature and Humidity Sensor (3.3V, I2C)
*
Dallas DS18B20 Temperature Sensor
*
YYAC-3S Triac (5V, PWM)
*
propbox-light: Nous A1T Smart Plug for Light
*
propbox-fan: Nous A1T Smart Plug for Fan
*
growbox: ESP32 Grow Tent Monitor
...
...
This diff is collapsed.
Click to expand it.
packages/fan.yaml
+
23
−
13
View file @
8a73b474
...
...
@@ -10,13 +10,17 @@ output:
fan
:
-
platform
:
speed
output
:
fan_dimmer
name
:
"
Extraction
Fan"
id
:
fan_extraction
name
:
"
Fan"
prometheus
:
relabel
:
propbox_fa
n
:
fan_extractio
n
:
id
:
fan
name
:
Fan
propbox_fan
:
id
:
power_fan
name
:
"
Power
Fan"
sensor
:
-
platform
:
template
...
...
@@ -62,14 +66,14 @@ select:
-
platform
:
template
id
:
temperature_min
name
:
"
Fan:
Temperature
Off"
options
:
[
"
15"
,
"
16"
,
"
17"
,
"
18"
,
"
19"
,
"
20"
,
"
21"
,
"
22"
,
"
23"
,
"
24"
,
"
25"
]
options
:
[
"
16"
,
"
17"
,
"
18"
,
"
19"
,
"
20"
,
"
21"
,
"
22"
,
"
23"
,
"
24"
,
"
25"
]
initial_option
:
"
21"
optimistic
:
true
restore_value
:
true
-
platform
:
template
id
:
humidity_max
name
:
"
Fan:
Humidity
On"
options
:
[
"
40"
,
"
45"
,
"
50"
,
"
55"
,
"
60"
,
"
65"
,
"
70"
,
"
75"
,
"
80"
,
"
85"
,
"
90"
]
options
:
[
"
40"
,
"
45"
,
"
50"
,
"
55"
,
"
60"
,
"
65"
,
"
70"
,
"
75"
,
"
80"
,
"
85"
]
initial_option
:
"
70"
optimistic
:
true
restore_value
:
true
...
...
@@ -83,15 +87,16 @@ select:
-
platform
:
template
id
:
humidity_min
name
:
"
Fan:
Humidity
Off"
options
:
[
"
25"
,
"
30"
,
"
35"
,
"
40"
,
"
45"
,
"
50"
,
"
55"
,
"
60"
,
"
65"
,
"
70"
,
"
80"
]
options
:
[
"
30"
,
"
35"
,
"
40"
,
"
45"
,
"
50"
,
"
55"
,
"
60"
,
"
65"
,
"
70"
,
"
80"
]
initial_option
:
"
40"
optimistic
:
true
restore_value
:
true
switch
:
-
platform
:
template
id
:
propbox_fan
name
:
"
Status
:
Fan"
name
:
"
Power
:
Fan"
optimistic
:
true
turn_on_action
:
-
http_request.post
:
http://${hostname_fan}/switch/power/turn_on
...
...
@@ -110,37 +115,43 @@ script:
// Normal On:
// switch fan on when either temperature or humidity is above "max", unless humidity/temperature is below "min"
if (
!id(
propbox_fa
n).state &&
!id(
fan_extractio
n).state &&
(
(id(bme280_temperature).state >= atoi(id(temperature_max).state.c_str()) && id(bme280_humidity).state >= atoi(id(humidity_min).state.c_str())) ||
(id(bme280_humidity).state >= atoi(id(humidity_max).state.c_str()) && id(bme280_temperature).state >= atoi(id(temperature_min).state.c_str()))
)
) {
id(propbox_fan).turn_on();
ESP_LOGI("fan", "Fan On");
auto call = id(fan_extraction).turn_on();
call.perform();
}
// Forced Off, ignoring Hysteresis:
// switch fan off when either temperature or humidity are below "min", unless humidity/temperature is above "max"
else if (
id(
propbox_fa
n).state &&
id(
fan_extractio
n).state &&
(
(id(bme280_temperature).state <= atoi(id(temperature_min).state.c_str()) && id(bme280_humidity).state <= atoi(id(humidity_max).state.c_str())) ||
(id(bme280_humidity).state <= atoi(id(humidity_min).state.c_str()) && id(bme280_temperature).state <= atoi(id(temperature_max).state.c_str()))
)
) {
id(propbox_fan).turn_off();
ESP_LOGI("fan", "Fan Off (forced)");
auto call = id(fan_extraction).turn_off();
call.perform();
}
// Normal Off, respecting Hysteresis:
// switch fan off when both temperature and humidity are below "max minus hysteresis"
else if (
id(
propbox_fa
n).state &&
id(
fan_extractio
n).state &&
(
id(bme280_temperature).state <= atoi(id(temperature_max).state.c_str()) - atoi(id(temperature_hysteresis).state.c_str()) &&
id(bme280_humidity).state <= atoi(id(humidity_max).state.c_str()) - atoi(id(humidity_hysteresis).state.c_str())
)
) {
id(propbox_fan).turn_off();
ESP_LOGI("fan", "Fan Off");
auto call = id(fan_extraction).turn_off();
call.perform();
}
-
id
:
fan_state
then
:
...
...
@@ -155,4 +166,3 @@ script:
}
id(propbox_fan).publish_state(state);
http.end();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
packages/light.yaml
+
3
−
3
View file @
8a73b474
...
...
@@ -8,8 +8,8 @@ substitutions:
prometheus
:
relabel
:
propbox_light
:
id
:
light
name
:
Light
id
:
power_
light
name
:
"
Power
Light
"
sensor
:
-
platform
:
template
...
...
@@ -29,7 +29,7 @@ select:
switch
:
-
platform
:
template
id
:
propbox_light
name
:
"
Status
:
Light"
name
:
"
Power
:
Light"
optimistic
:
true
turn_on_action
:
-
http_request.post
:
http://${hostname_light}/switch/power/turn_on
...
...
This diff is collapsed.
Click to expand it.
propbox.yaml
+
8
−
0
View file @
8a73b474
...
...
@@ -9,6 +9,14 @@ substitutions:
# Overrides
bme280_script
:
"
fan_control"
esphome
:
on_boot
:
priority
:
-200
then
:
-
lambda
:
|-
id(fan_state).execute();
id(light_state).execute();
packages
:
base
:
!include
packages/base.yaml
esp32
:
!include
packages/esp32.yaml
...
...
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