Add duct fan out thermostate for rack2.

This commit is contained in:
2021-11-28 14:57:32 -08:00
parent b30e0cc877
commit 16231f148d

View File

@@ -1,13 +1,11 @@
substitutions: substitutions:
duct_fan_pin: GPIO13 duct_fan_pin: GPIO13
duct_fan_id: duct_fan_id
duct_fan_name: Rack 2 Duct Fan Speed duct_fan_name: Rack 2 Duct Fan Speed
# duct_fan_channel: "0" # duct_fan_channel: "0"
duct_fan_pwmfreq: 5000Hz duct_fan_pwmfreq: 5000Hz
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
wall_fan_spd_pin: GPIO22 wall_fan_spd_pin: GPIO22
wall_fan_spd_id: wall_fan_spd_id
# wall_fan_spd_channel: "2" # wall_fan_spd_channel: "2"
wall_fan_spd_pwmfreq: 25000Hz wall_fan_spd_pwmfreq: 25000Hz
wall_fan_spd_name: Rack 2 Wall Fan Speed wall_fan_spd_name: Rack 2 Wall Fan Speed
@@ -15,8 +13,10 @@ substitutions:
wall_fan_tach_id: wall_fan_tach_id wall_fan_tach_id: wall_fan_tach_id
wall_fan_tach_name: Rack 2 Wall Fan Tach wall_fan_tach_name: Rack 2 Wall Fan Tach
dallas_pin: GPIO32 dallas_pin: GPIO32
dallas_name_1: Rack 2 Temp Hot dallas_in_addr: "0x1D02131D6063AA28"
dallas_name_2: Rack 2 Temp Cold dallas_in_name: Rack 3 Temp In
dallas_out_addr: "0x1D01143296570128"
dallas_out_name: Rack 3 Temp Out
esphome: esphome:
name: rack_2 name: rack_2
@@ -47,30 +47,29 @@ switch:
output: output:
- platform: ledc - platform: ledc
pin: ${duct_fan_pin} pin: ${duct_fan_pin}
id: ${duct_fan_id} id: duct_fan_output_id
channel: 0 channel: 0
frequency: ${duct_fan_pwmfreq} frequency: ${duct_fan_pwmfreq}
- platform: ledc - platform: ledc
pin: ${wall_fan_spd_pin} pin: ${wall_fan_spd_pin}
id: ${wall_fan_spd_id} id: wall_fan_spd_id
channel: 2 channel: 2
frequency: ${wall_fan_spd_pwmfreq} frequency: ${wall_fan_spd_pwmfreq}
fan: fan:
- platform: speed - platform: speed
output: ${duct_fan_id} id: duct_fan_spd_id
name: ${duct_fan_name} output: duct_fan_output_id
# speed: name: ${duct_fan_name}
# low: 0.2
# medium: 0.6
# high: 1.0
- platform: speed - platform: speed
output: ${wall_fan_spd_id} output: wall_fan_spd_id
name: ${wall_fan_spd_name} name: ${wall_fan_spd_name}
# speed:
# low: 0.0 dallas:
# medium: 0.8 - pin:
# high: 1.0 number: ${dallas_pin}
mode: INPUT_PULLUP
update_interval: 10s
sensor: sensor:
- platform: pulse_counter - platform: pulse_counter
@@ -83,17 +82,78 @@ sensor:
filters: filters:
- multiply: 0.5 - multiply: 0.5
- platform: dallas - platform: dallas
address: 0x1D01143296570128 address: ${dallas_in_addr}
name: ${dallas_name_1} name: ${dallas_in_name}
- platform: dallas - platform: dallas
address: 0x1D02131D6063AA28 address: ${dallas_out_addr}
name: ${dallas_name_2} name: ${dallas_out_name}
id: dallas_out_id
on_value:
then:
number.set:
id: duct_fan_speed_target_out
value: !lambda |-
float lo;
float hi;
lo = id(thermostat_rack2_out).target_temperature_low;
hi = id(thermostat_rack2_out).target_temperature_high;
if (x < lo) {
return 0.0;
}
if (x > hi) {
return 100.0;
}
return 100 * (x - lo) / (hi - lo);
number:
- platform: template
id: duct_fan_speed_target_in
name: Duct Fan Speed Target In
optimistic: true
min_value: 0
max_value: 100
step: 1
- platform: template
id: duct_fan_speed_target_out
name: Duct Fan Speed Target Out
optimistic: true
min_value: 0
max_value: 100
step: 1
on_value_range:
above: 25.0
then:
fan.turn_on:
id: duct_fan_spd_id
speed: !lambda |-
return x;
dallas: # Dual-point thermostat
- pin: climate:
number: ${dallas_pin} - platform: thermostat
mode: INPUT_PULLUP id: thermostat_rack2_out
update_interval: 10s name: Rack2 Out
sensor: dallas_out_id
visual:
min_temperature: 60 °F
max_temperature: 100 °F
temperature_step: 1
default_mode: auto
default_target_temperature_low: 75 °F
default_target_temperature_high: 100 °F
min_cooling_off_time: 60s
min_cooling_run_time: 60s
min_heating_off_time: 60s
min_heating_run_time: 60s
min_idle_time: 60s
heat_action:
- logger.log: "Turning off Rack2 Thermostat"
- fan.turn_off:
id: duct_fan_spd_id
idle_action:
- logger.log: "Turning on Rack2 Thermostat"
cool_action:
- logger.log: "WARNING: Rack2 Thermostat has hit high temp!"
#TODO - provide some kind of warning / action here
# Enable logging # Enable logging
logger: logger: