Working partial r2 df rename.
This commit is contained in:
@@ -3,23 +3,26 @@ substitutions:
|
||||
dn: rack_2
|
||||
sn: R2
|
||||
friendly_name: Rack 2
|
||||
duct_fan_pin: GPIO13
|
||||
duct_fan_name: ${sn} Duct Fan Spd
|
||||
duct_fan_vent_spd_name: ${sn} DF Vent Spd
|
||||
duct_fan_tgt_spd_out_name: ${sn} DF Tgt Spd Out
|
||||
duct_fan_pwmfreq: 5000Hz
|
||||
duct_fan_off_spd: "0.0"
|
||||
duct_fan_lo_spd: "1.0"
|
||||
duct_fan_init_spd: "60.0"
|
||||
duct_fan_hi_spd: "100.0"
|
||||
wall_fan_pwr_pin: GPIO21
|
||||
wall_fan_pwr_name: ${friendly_name} Wall Fan Power
|
||||
wall_fan_spd_pin: GPIO22
|
||||
wall_fan_spd_pwmfreq: 25000Hz
|
||||
wall_fan_spd_name: ${friendly_name} Wall Fan Speed
|
||||
wall_fan_tach_pin: GPIO23
|
||||
wall_fan_tach_id: wall_fan_tach_id
|
||||
wall_fan_tach_name: ${friendly_name} Wall Fan Tach
|
||||
df_attic_pin: GPIO13
|
||||
df_attic_name: ${friendly_name} Attic Duct Fan Spd
|
||||
df_attic_vent_spd_name: ${sn} DF Vent Spd
|
||||
df_attic_tgt_spd_out_name: ${sn} DF Tgt Spd Out
|
||||
df_attic_pwmfreq: 5000Hz
|
||||
df_attic_off_spd: "0.0"
|
||||
df_attic_lo_spd: "1.0"
|
||||
df_attic_init_spd: "60.0"
|
||||
df_attic_hi_spd: "100.0"
|
||||
df_attic_tach_pin: GPIO12
|
||||
df_attic_tach_id: df_attic_tach_id
|
||||
df_attic_tach_name: ${friendly_name} Attic Duct Fan Tach
|
||||
# wall_fan_pwr_pin: GPIO21
|
||||
# wall_fan_pwr_name: ${friendly_name} Wall Fan Power
|
||||
# wall_fan_spd_pin: GPIO22
|
||||
# wall_fan_spd_pwmfreq: 25000Hz
|
||||
# wall_fan_spd_name: ${friendly_name} Wall Fan Speed
|
||||
# wall_fan_tach_pin: GPIO23
|
||||
# wall_fan_tach_id: wall_fan_tach_id
|
||||
# wall_fan_tach_name: ${friendly_name} Wall Fan Tach
|
||||
dallas_pin: GPIO32
|
||||
dallas_in_addr: "0x1D02131D6063AA28"
|
||||
dallas_in_name: ${friendly_name} Temp In
|
||||
@@ -28,15 +31,15 @@ substitutions:
|
||||
dallas_update_interval: 30s
|
||||
|
||||
globals:
|
||||
- id: duct_fan_off_spd_id
|
||||
- id: df_attic_off_spd_id
|
||||
type: float
|
||||
initial_value: ${duct_fan_off_spd}
|
||||
- id: duct_fan_lo_spd_id
|
||||
initial_value: ${df_attic_off_spd}
|
||||
- id: df_attic_lo_spd_id
|
||||
type: float
|
||||
initial_value: ${duct_fan_lo_spd}
|
||||
- id: duct_fan_hi_spd_id
|
||||
initial_value: ${df_attic_lo_spd}
|
||||
- id: df_attic_hi_spd_id
|
||||
type: float
|
||||
initial_value: ${duct_fan_hi_spd}
|
||||
initial_value: ${df_attic_hi_spd}
|
||||
|
||||
<<: !include .common.yaml
|
||||
<<: !include .wifi-oss.yaml
|
||||
@@ -49,13 +52,13 @@ esphome:
|
||||
- priority: 200.0
|
||||
then:
|
||||
- output.set_level:
|
||||
id: duct_fan_output_id
|
||||
level: ${duct_fan_init_spd}%
|
||||
id: df_attic_output_id
|
||||
level: ${df_attic_init_spd}%
|
||||
|
||||
switch:
|
||||
- platform: gpio
|
||||
pin: ${wall_fan_pwr_pin}
|
||||
name: ${wall_fan_pwr_name}
|
||||
# - platform: gpio
|
||||
# pin: ${wall_fan_pwr_pin}
|
||||
# name: ${wall_fan_pwr_name}
|
||||
- platform: template
|
||||
name: Thermostat On
|
||||
id: thermostat_on_id
|
||||
@@ -63,24 +66,24 @@ switch:
|
||||
|
||||
output:
|
||||
- platform: ledc
|
||||
pin: ${duct_fan_pin}
|
||||
id: duct_fan_output_id
|
||||
pin: ${df_attic_pin}
|
||||
id: df_attic_output_id
|
||||
channel: 0
|
||||
frequency: ${duct_fan_pwmfreq}
|
||||
- platform: ledc
|
||||
pin: ${wall_fan_spd_pin}
|
||||
id: wall_fan_spd_id
|
||||
channel: 2
|
||||
frequency: ${wall_fan_spd_pwmfreq}
|
||||
frequency: ${df_attic_pwmfreq}
|
||||
# - platform: ledc
|
||||
# pin: ${wall_fan_spd_pin}
|
||||
# id: wall_fan_spd_id
|
||||
# channel: 2
|
||||
# frequency: ${wall_fan_spd_pwmfreq}
|
||||
|
||||
fan:
|
||||
- platform: speed
|
||||
id: duct_fan_spd_id
|
||||
output: duct_fan_output_id
|
||||
name: ${duct_fan_name}
|
||||
- platform: speed
|
||||
output: wall_fan_spd_id
|
||||
name: ${wall_fan_spd_name}
|
||||
id: df_attic_spd_id
|
||||
output: df_attic_output_id
|
||||
name: ${df_attic_name}
|
||||
# - platform: speed
|
||||
# output: wall_fan_spd_id
|
||||
# name: ${wall_fan_spd_name}
|
||||
|
||||
dallas:
|
||||
- pin:
|
||||
@@ -91,13 +94,22 @@ dallas:
|
||||
sensor:
|
||||
- platform: pulse_counter
|
||||
pin:
|
||||
number: ${wall_fan_tach_pin}
|
||||
number: ${df_attic_tach_pin}
|
||||
mode: INPUT_PULLUP
|
||||
unit_of_measurement: 'RPM'
|
||||
name: ${wall_fan_tach_name}
|
||||
name: ${df_attic_tach_name}
|
||||
update_interval: 10s
|
||||
filters:
|
||||
- multiply: 0.5
|
||||
# - platform: pulse_counter
|
||||
# pin:
|
||||
# number: ${wall_fan_tach_pin}
|
||||
# mode: INPUT_PULLUP
|
||||
# unit_of_measurement: 'RPM'
|
||||
# name: ${wall_fan_tach_name}
|
||||
# update_interval: 10s
|
||||
# filters:
|
||||
# - multiply: 0.5
|
||||
- platform: dallas
|
||||
address: ${dallas_in_addr}
|
||||
name: ${dallas_in_name}
|
||||
@@ -114,18 +126,18 @@ binary_sensor:
|
||||
|
||||
number:
|
||||
- platform: template
|
||||
id: duct_fan_vent_spd_id
|
||||
name: ${duct_fan_vent_spd_name}
|
||||
id: df_attic_vent_spd_id
|
||||
name: ${df_attic_vent_spd_name}
|
||||
optimistic: true
|
||||
min_value: ${duct_fan_lo_spd}
|
||||
max_value: ${duct_fan_hi_spd}
|
||||
min_value: ${df_attic_lo_spd}
|
||||
max_value: ${df_attic_hi_spd}
|
||||
step: 10
|
||||
initial_value: ${duct_fan_init_spd}
|
||||
initial_value: ${df_attic_init_spd}
|
||||
- platform: template
|
||||
id: duct_fan_tgt_spd_out
|
||||
name: ${duct_fan_tgt_spd_out_name}
|
||||
min_value: ${duct_fan_off_spd}
|
||||
max_value: ${duct_fan_hi_spd}
|
||||
id: df_attic_tgt_spd_out
|
||||
name: ${df_attic_tgt_spd_out_name}
|
||||
min_value: ${df_attic_off_spd}
|
||||
max_value: ${df_attic_hi_spd}
|
||||
step: 1
|
||||
set_action:
|
||||
then:
|
||||
@@ -141,17 +153,17 @@ number:
|
||||
lo_temp = id(thermostat_out_id).target_temperature_low;
|
||||
hi_temp = id(thermostat_out_id).target_temperature_high;
|
||||
curtemp = id(dallas_out_id).state;
|
||||
off_spd = id(duct_fan_off_spd_id);
|
||||
lo_spd = id(duct_fan_lo_spd_id);
|
||||
vent_spd = id(duct_fan_vent_spd_id).state;
|
||||
hi_spd = id(duct_fan_hi_spd_id);
|
||||
off_spd = id(df_attic_off_spd_id);
|
||||
lo_spd = id(df_attic_lo_spd_id);
|
||||
vent_spd = id(df_attic_vent_spd_id).state;
|
||||
hi_spd = id(df_attic_hi_spd_id);
|
||||
ESP_LOGD("fan_speed", "DEBUG Ventilate House: %d", id(ventilate_house).state);
|
||||
ESP_LOGD("fan_speed", "DEBUG Current Temp: %f", curtemp);
|
||||
ESP_LOGD("fan_speed", "DEBUG Thermostat State: %d", id(thermostat_on_id).state);
|
||||
if ((id(ventilate_house).state == false) &&
|
||||
((curtemp < lo_temp) || (id(thermostat_on_id).state == false))) {
|
||||
ESP_LOGD("fan_speed", "DEBUG turning off");
|
||||
auto call = id(duct_fan_spd_id).turn_off();
|
||||
auto call = id(df_attic_spd_id).turn_off();
|
||||
call.perform();
|
||||
return off_spd;
|
||||
}
|
||||
@@ -169,12 +181,12 @@ number:
|
||||
}
|
||||
if (newspd < lo_spd) {
|
||||
ESP_LOGD("fan_speed", "DEBUG New Speed under lo_spd, turning off");
|
||||
auto call = id(duct_fan_spd_id).turn_off();
|
||||
auto call = id(df_attic_spd_id).turn_off();
|
||||
call.perform();
|
||||
return off_spd;
|
||||
}
|
||||
ESP_LOGD("fan_speed", "DEBUG Setting fan to newspd: %f", newspd);
|
||||
auto call = id(duct_fan_spd_id).turn_on();
|
||||
auto call = id(df_attic_spd_id).turn_on();
|
||||
call.set_speed(newspd);
|
||||
call.perform();
|
||||
return newspd;
|
||||
|
||||
Reference in New Issue
Block a user