From b24701a89d45859df38bd0494046416886df74d6 Mon Sep 17 00:00:00 2001 From: longranger Date: Mon, 15 Aug 2022 20:28:22 -0700 Subject: [PATCH] Adjustable vent speed for duct fans. --- _data/prj_3.yaml | 20 +++++++++----------- _data/rack_2.yaml | 20 +++++++++----------- _data/rack_3.yaml | 20 +++++++++----------- 3 files changed, 27 insertions(+), 33 deletions(-) diff --git a/_data/prj_3.yaml b/_data/prj_3.yaml index 0f8c545..93f75b9 100644 --- a/_data/prj_3.yaml +++ b/_data/prj_3.yaml @@ -5,13 +5,13 @@ substitutions: friendly_name: Prj 3 duct_fan_pin: GPIO14 duct_fan_name: ${sn} Duct Fan Spd - duct_fan_tgt_spd_in_name: ${sn} DF Tgt Spd In + duct_fan_vent_spd_name: ${sn} DF Vent Spd duct_fan_tgt_spd_prj_name: ${sn} DF Tgt Spd Prj 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_vent_spd: "50.0" + duct_fan_init_spd: "60.0" duct_fan_hi_spd: "100.0" prjpwr_pin: GPIO19 prjpwr_name: ${sn} Pwr @@ -31,9 +31,6 @@ globals: - id: duct_fan_lo_spd_id type: float initial_value: ${duct_fan_lo_spd} - - id: duct_fan_vent_spd_id - type: float - initial_value: ${duct_fan_vent_spd} - id: duct_fan_hi_spd_id type: float initial_value: ${duct_fan_hi_spd} @@ -50,7 +47,7 @@ esphome: then: - output.set_level: id: duct_fan_output_id - level: ${duct_fan_vent_spd}% + level: ${duct_fan_init_spd}% switch: - platform: template @@ -97,17 +94,18 @@ binary_sensor: device_class: power - platform: homeassistant name: "Ventilate House" - entity_id: input_boolean.ventilate_house + entity_id: binary_sensor.ventilate_house id: ventilate_house number: - platform: template - id: duct_fan_tgt_spd_in - name: ${duct_fan_tgt_spd_in_name} + id: duct_fan_vent_spd_id + name: ${duct_fan_vent_spd_name} optimistic: true min_value: ${duct_fan_lo_spd} max_value: ${duct_fan_hi_spd} - step: 1 + step: 10 + initial_value: ${duct_fan_init_spd} - platform: template id: duct_fan_tgt_spd_prj name: ${duct_fan_tgt_spd_prj_name} @@ -130,7 +128,7 @@ number: curtemp = id(dallas_prj_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); + vent_spd = id(duct_fan_vent_spd_id).state; hi_spd = id(duct_fan_hi_spd_id); ESP_LOGD("fan_speed", "DEBUG Ventilate House: %d", id(ventilate_house).state); ESP_LOGD("fan_speed", "DEBUG Current Temp: %f", curtemp); diff --git a/_data/rack_2.yaml b/_data/rack_2.yaml index dce68b7..bd1e0f1 100644 --- a/_data/rack_2.yaml +++ b/_data/rack_2.yaml @@ -5,12 +5,12 @@ substitutions: friendly_name: Rack 2 duct_fan_pin: GPIO13 duct_fan_name: ${sn} Duct Fan Spd - duct_fan_tgt_spd_in_name: ${sn} DF Tgt Spd In + 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_vent_spd: "50.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 @@ -34,9 +34,6 @@ globals: - id: duct_fan_lo_spd_id type: float initial_value: ${duct_fan_lo_spd} - - id: duct_fan_vent_spd_id - type: float - initial_value: ${duct_fan_vent_spd} - id: duct_fan_hi_spd_id type: float initial_value: ${duct_fan_hi_spd} @@ -53,7 +50,7 @@ esphome: then: - output.set_level: id: duct_fan_output_id - level: ${duct_fan_vent_spd}% + level: ${duct_fan_init_spd}% switch: - platform: gpio @@ -112,17 +109,18 @@ sensor: binary_sensor: - platform: homeassistant name: "Ventilate House" - entity_id: input_boolean.ventilate_house + entity_id: binary_sensor.ventilate_house id: ventilate_house number: - platform: template - id: duct_fan_tgt_spd_in - name: ${duct_fan_tgt_spd_in_name} + id: duct_fan_vent_spd_id + name: ${duct_fan_vent_spd_name} optimistic: true min_value: ${duct_fan_lo_spd} max_value: ${duct_fan_hi_spd} - step: 1 + step: 10 + initial_value: ${duct_fan_init_spd} - platform: template id: duct_fan_tgt_spd_out name: ${duct_fan_tgt_spd_out_name} @@ -145,7 +143,7 @@ number: 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); + vent_spd = id(duct_fan_vent_spd_id).state; hi_spd = id(duct_fan_hi_spd_id); ESP_LOGD("fan_speed", "DEBUG Ventilate House: %d", id(ventilate_house).state); ESP_LOGD("fan_speed", "DEBUG Current Temp: %f", curtemp); diff --git a/_data/rack_3.yaml b/_data/rack_3.yaml index 7161c1c..d933e5a 100644 --- a/_data/rack_3.yaml +++ b/_data/rack_3.yaml @@ -5,12 +5,12 @@ substitutions: friendly_name: Rack 3 duct_fan_pin: GPIO13 duct_fan_name: ${sn} Duct Fan Spd - duct_fan_tgt_spd_in_name: ${sn} DF Tgt Spd In + 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_vent_spd: "50.0" + duct_fan_init_spd: "60.0" duct_fan_amppwr_on_lo_spd: "20.0" duct_fan_hi_spd: "100.0" amppwr_pin: GPIO19 @@ -32,9 +32,6 @@ globals: - id: duct_fan_amppwr_on_lo_spd_id type: float initial_value: ${duct_fan_amppwr_on_lo_spd} - - id: duct_fan_vent_spd_id - type: float - initial_value: ${duct_fan_vent_spd} - id: duct_fan_hi_spd_id type: float initial_value: ${duct_fan_hi_spd} @@ -51,7 +48,7 @@ esphome: then: - output.set_level: id: duct_fan_output_id - level: ${duct_fan_vent_spd}% + level: ${duct_fan_init_spd}% switch: - platform: template @@ -94,17 +91,18 @@ binary_sensor: device_class: power - platform: homeassistant name: "Ventilate House" - entity_id: input_boolean.ventilate_house + entity_id: binary_sensor.ventilate_house id: ventilate_house number: - platform: template - id: duct_fan_tgt_spd_in_id - name: ${duct_fan_tgt_spd_in_name} + id: duct_fan_vent_spd_id + name: ${duct_fan_vent_spd_name} optimistic: true min_value: ${duct_fan_lo_spd} max_value: ${duct_fan_hi_spd} - step: 1 + step: 10 + initial_value: ${duct_fan_init_spd} - platform: template id: duct_fan_tgt_spd_out_id name: ${duct_fan_tgt_spd_out_name} @@ -127,7 +125,7 @@ number: 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); + vent_spd = id(duct_fan_vent_spd_id).state; hi_spd = id(duct_fan_hi_spd_id); ESP_LOGD("fan_speed", "DEBUG Ventilate House: %d", id(ventilate_house).state); ESP_LOGD("fan_speed", "DEBUG Amp Power: %d", id(amppwr_id).state);