Fix duct fan naming. Set low speed to 1.

This commit is contained in:
2021-12-04 09:03:35 -08:00
parent 12724c9695
commit 7dc4c5e721
3 changed files with 80 additions and 54 deletions

View File

@@ -1,11 +1,12 @@
substitutions: substitutions:
duct_fan_pin: GPIO14 duct_fan_pin: GPIO14
duct_fan_spd_name: Prj3 Duct Fan Speed duct_fan_spd_name: Prj3 Duct Fan Speed
duct_fan_spd_target_in_name: Prj3 Duct Fan Target Speed In duct_fan_target_spd_in_name: Prj3 Duct Fan Target Speed In
duct_fan_spd_target_out_name: Prj3 Duct Fan Target Speed Out duct_fan_target_spd_prj_name: Prj3 Duct Fan Target Speed Prj
duct_fan_target_spd_out_name: Prj3 Duct Fan Target Speed Out
duct_fan_pwmfreq: 5000Hz duct_fan_pwmfreq: 5000Hz
duct_fan_off_spd: "0.0" duct_fan_off_spd: "0.0"
duct_fan_lo_spd: "10.0" duct_fan_lo_spd: "1.0"
duct_fan_hi_spd: "100.0" duct_fan_hi_spd: "100.0"
prjpwr_pin: GPIO19 prjpwr_pin: GPIO19
prjpwr_name: Prj3 Pwr prjpwr_name: Prj3 Pwr
@@ -99,56 +100,69 @@ sensor:
number: number:
- platform: template - platform: template
id: duct_fan_spd_target_in id: duct_fan_target_spd_in
name: ${duct_fan_spd_target_in_name} name: ${duct_fan_target_spd_in_name}
optimistic: true optimistic: true
min_value: ${duct_fan_lo_spd} min_value: ${duct_fan_lo_spd}
max_value: ${duct_fan_hi_spd} max_value: ${duct_fan_hi_spd}
step: 1 step: 1
- platform: template - platform: template
id: duct_fan_spd_target_out id: duct_fan_target_spd_prj
name: ${duct_fan_spd_target_out_name} name: ${duct_fan_target_spd_prj_name}
min_value: ${duct_fan_off_spd} min_value: ${duct_fan_off_spd}
max_value: ${duct_fan_hi_spd} max_value: ${duct_fan_hi_spd}
step: 1 step: 1
set_action: set_action:
then: then:
lambda: |- lambda: |-
float lo; float lo_temp;
float hi; float hi_temp;
float curtemp; float curtemp;
float off_spd;
float lo_spd;
float hi_spd;
float newspd; float newspd;
lo = id(thermostat_out_id).target_temperature_low; lo_temp = id(thermostat_prj_id).target_temperature_low;
hi = id(thermostat_out_id).target_temperature_high; hi_temp = id(thermostat_prj_id).target_temperature_high;
curtemp = id(dallas_out_id).state; curtemp = id(dallas_prj_id).state;
if ((curtemp < lo) || (id(thermostat_on_id).state == false)) { off_spd = id(duct_fan_off_spd);
lo_spd = id(duct_fan_lo_spd);
hi_spd = id(duct_fan_hi_spd);
if ((curtemp < lo_temp) || (id(thermostat_on_id).state == false)) {
auto call = id(duct_fan_spd_id).turn_off(); auto call = id(duct_fan_spd_id).turn_off();
call.perform(); call.perform();
return id(duct_fan_off_spd); return off_spd;
} }
if (curtemp > hi) { if (curtemp > hi_temp) {
newspd = id(duct_fan_hi_spd); newspd = hi_spd;
} else { } else {
// Set newspd to same linear proportion of spd range as current temp is of temp range // Set newspd to same linear proportion of spd range as current temp is of temp range
newspd = id(duct_fan_lo_spd) + (id(duct_fan_hi_spd) * (curtemp - lo) / (hi - lo)); newspd = lo_spd + ((hi_spd - lo_spd) * (curtemp - lo_temp) / (hi_temp - lo_temp));
} }
auto call = id(duct_fan_spd_id).turn_on(); auto call = id(duct_fan_spd_id).turn_on();
call.set_speed(newspd); call.set_speed(newspd);
call.perform(); call.perform();
return newspd; return newspd;
- platform: template
id: duct_fan_target_spd_out
name: ${duct_fan_target_spd_out_name}
optimistic: true
min_value: ${duct_fan_off_spd}
max_value: ${duct_fan_hi_spd}
step: 1
# Dual-point thermostat # Dual-point thermostat
climate: climate:
- platform: thermostat - platform: thermostat
id: thermostat_out_id id: thermostat_prj_id
name: Prj3 Out name: Prj3 Prj
sensor: dallas_prj_id sensor: dallas_prj_id
visual: visual:
min_temperature: 60 °F min_temperature: 60 °F
max_temperature: 160 °F max_temperature: 160 °F
temperature_step: 1 temperature_step: 1
default_mode: auto default_mode: auto
default_target_temperature_low: 75 °F default_target_temperature_low: 78 °F
default_target_temperature_high: 160 °F default_target_temperature_high: 160 °F
min_cooling_off_time: 60s min_cooling_off_time: 60s
min_cooling_run_time: 60s min_cooling_run_time: 60s

View File

@@ -1,12 +1,12 @@
substitutions: substitutions:
duct_fan_pin: GPIO13 duct_fan_pin: GPIO13
duct_fan_name: Rack 2 Duct Fan Speed duct_fan_name: R2 Duct Fan Spd
duct_fan_spd_target_in_name: Rack 2 Duct Fan Target Speed In duct_fan_tgt_spd_in_name: R2 DF Tgt Spd In
duct_fan_spd_target_out_name: Rack 2 Duct Fan Target Speed Out duct_fan_tgt_spd_out_name: R2 DF Tgt Spd Out
# duct_fan_channel: "0" # duct_fan_channel: "0"
duct_fan_pwmfreq: 5000Hz duct_fan_pwmfreq: 5000Hz
duct_fan_off_spd: "0.0" duct_fan_off_spd: "0.0"
duct_fan_lo_spd: "10.0" duct_fan_lo_spd: "1.0"
duct_fan_hi_spd: "100.0" duct_fan_hi_spd: "100.0"
wall_fan_pwr_pin: GPIO21 wall_fan_pwr_pin: GPIO21
wall_fan_pwr_name: Rack 2 Wall Fan Power wall_fan_pwr_name: Rack 2 Wall Fan Power
@@ -121,38 +121,44 @@ sensor:
number: number:
- platform: template - platform: template
id: duct_fan_spd_target_in id: duct_fan_tgt_spd_in
name: ${duct_fan_spd_target_in_name} name: ${duct_fan_tgt_spd_in_name}
optimistic: true optimistic: true
min_value: ${duct_fan_lo_spd} min_value: ${duct_fan_lo_spd}
max_value: ${duct_fan_hi_spd} max_value: ${duct_fan_hi_spd}
step: 1 step: 1
- platform: template - platform: template
id: duct_fan_spd_target_out id: duct_fan_tgt_spd_out
name: ${duct_fan_spd_target_out_name} name: ${duct_fan_tgt_spd_out_name}
min_value: ${duct_fan_off_spd} min_value: ${duct_fan_off_spd}
max_value: ${duct_fan_hi_spd} max_value: ${duct_fan_hi_spd}
step: 1 step: 1
set_action: set_action:
then: then:
lambda: |- lambda: |-
float lo; float lo_temp;
float hi; float hi_temp;
float curtemp; float curtemp;
float off_spd;
float lo_spd;
float hi_spd;
float newspd; float newspd;
lo = id(thermostat_out_id).target_temperature_low; lo_temp = id(thermostat_out_id).target_temperature_low;
hi = id(thermostat_out_id).target_temperature_high; hi_temp = id(thermostat_out_id).target_temperature_high;
curtemp = id(dallas_out_id).state; curtemp = id(dallas_out_id).state;
if ((curtemp < lo) || (id(thermostat_on_id).state == false)) { off_spd = id(duct_fan_off_spd);
lo_spd = id(duct_fan_lo_spd);
hi_spd = id(duct_fan_hi_spd);
if ((curtemp < lo_temp) || (id(thermostat_on_id).state == false)) {
auto call = id(duct_fan_spd_id).turn_off(); auto call = id(duct_fan_spd_id).turn_off();
call.perform(); call.perform();
return id(duct_fan_off_spd); return off_spd;
} }
if (curtemp > hi) { if (curtemp > hi_temp) {
newspd = id(duct_fan_hi_spd); newspd = hi_spd;
} else { } else {
// Set newspd to same linear proportion of spd range as current temp is of temp range // Set newspd to same linear proportion of spd range as current temp is of temp range
newspd = id(duct_fan_lo_spd) + (id(duct_fan_hi_spd) * (curtemp - lo) / (hi - lo)); newspd = lo_spd + ((hi_spd - lo_spd) * (curtemp - lo_temp) / (hi_temp - lo_temp));
} }
auto call = id(duct_fan_spd_id).turn_on(); auto call = id(duct_fan_spd_id).turn_on();
call.set_speed(newspd); call.set_speed(newspd);

View File

@@ -1,11 +1,11 @@
substitutions: substitutions:
duct_fan_pin: GPIO13 duct_fan_pin: GPIO13
duct_fan_name: Rack 3 Duct Fan Speed duct_fan_name: R3 Duct Fan Spd
duct_fan_spd_target_in_name: Rack 3 Duct Fan Target Speed In duct_fan_tgt_spd_in_name: Rack 3 Duct Fan Target Spd In
duct_fan_spd_target_out_name: Rack 3 Duct Fan Target Speed Out duct_fan_tgt_spd_out_name: Rack 3 Duct Fan Target Spd Out
duct_fan_pwmfreq: 5000Hz duct_fan_pwmfreq: 5000Hz
duct_fan_off_spd: "0.0" duct_fan_off_spd: "0.0"
duct_fan_lo_spd: "10.0" duct_fan_lo_spd: "1.0"
duct_fan_hi_spd: "100.0" duct_fan_hi_spd: "100.0"
amppwr_pin: GPIO19 amppwr_pin: GPIO19
amppwr_name: "Denon Pwr" amppwr_name: "Denon Pwr"
@@ -91,38 +91,44 @@ sensor:
number: number:
- platform: template - platform: template
id: duct_fan_spd_target_in_id id: duct_fan_tgt_spd_in_id
name: ${duct_fan_spd_target_in_name} name: ${duct_fan_tgt_spd_in_name}
optimistic: true optimistic: true
min_value: ${duct_fan_lo_spd} min_value: ${duct_fan_lo_spd}
max_value: ${duct_fan_hi_spd} max_value: ${duct_fan_hi_spd}
step: 1 step: 1
- platform: template - platform: template
id: duct_fan_spd_target_out_id id: duct_fan_tgt_spd_out_id
name: ${duct_fan_spd_target_out_name} name: ${duct_fan_tgt_spd_out_name}
min_value: ${duct_fan_lo_spd} min_value: ${duct_fan_lo_spd}
max_value: ${duct_fan_hi_spd} max_value: ${duct_fan_hi_spd}
step: 1 step: 1
set_action: set_action:
then: then:
lambda: |- lambda: |-
float lo; float lo_temp;
float hi; float hi_temp;
float curtemp; float curtemp;
float off_spd;
float lo_spd;
float hi_spd;
float newspd; float newspd;
lo = id(thermostat_out_id).target_temperature_low; lo_temp = id(thermostat_out_id).target_temperature_low;
hi = id(thermostat_out_id).target_temperature_high; hi_temp = id(thermostat_out_id).target_temperature_high;
curtemp = id(dallas_out_id).state; curtemp = id(dallas_out_id).state;
if ((curtemp < lo) || (id(thermostat_on_id).state == false)) { off_spd = id(duct_fan_off_spd);
lo_spd = id(duct_fan_lo_spd);
hi_spd = id(duct_fan_hi_spd);
if ((curtemp < lo_temp) || (id(thermostat_on_id).state == false)) {
auto call = id(duct_fan_spd_id).turn_off(); auto call = id(duct_fan_spd_id).turn_off();
call.perform(); call.perform();
return id(duct_fan_off_spd); return off_spd;
} }
if (curtemp > hi) { if (curtemp > hi_temp) {
newspd = id(duct_fan_hi_spd); newspd = hi_spd;
} else { } else {
// Set newspd to same linear proportion of spd range as current temp is of temp range // Set newspd to same linear proportion of spd range as current temp is of temp range
newspd = id(duct_fan_lo_spd) + (id(duct_fan_hi_spd) * (curtemp - lo) / (hi - lo)); newspd = lo_spd + ((hi_spd - lo_spd) * (curtemp - lo_temp) / (hi_temp - lo_temp));
} }
auto call = id(duct_fan_spd_id).turn_on(); auto call = id(duct_fan_spd_id).turn_on();
call.set_speed(newspd); call.set_speed(newspd);