Thermostat for rack3 out.
This commit is contained in:
107
rack_3.yaml
107
rack_3.yaml
@@ -1,16 +1,14 @@
|
|||||||
substitutions:
|
substitutions:
|
||||||
duct_fan_pin: GPIO13
|
duct_fan_pin: GPIO13
|
||||||
duct_fan_id: duct_fan_id
|
|
||||||
duct_fan_pwmfreq: 5000Hz
|
duct_fan_pwmfreq: 5000Hz
|
||||||
duct_fan_spd_id: duct_fan_spd_id
|
|
||||||
duct_fan_spd_name: rack_3_duct_fan_spd
|
duct_fan_spd_name: rack_3_duct_fan_spd
|
||||||
heat_pin: GPIO19
|
amppwr_pin: GPIO19
|
||||||
heat_name: "Denon Pwr"
|
amppwr_name: "Denon Pwr"
|
||||||
dallas_pin: GPIO32
|
dallas_pin: GPIO32
|
||||||
dallas_1_addr: "0x7F0114328974D728"
|
dallas_in_addr: "0x7F0114328974D728"
|
||||||
dallas_1_name: rack_3_temp_cold
|
dallas_in_name: rack_3_temp_in
|
||||||
dallas_2_addr: "0xB801143296ED7B28"
|
dallas_out_addr: "0xB801143296ED7B28"
|
||||||
dallas_2_name: rack_3_temp_hot
|
dallas_out_name: rack_3_temp_out
|
||||||
|
|
||||||
esphome:
|
esphome:
|
||||||
name: rack_3
|
name: rack_3
|
||||||
@@ -36,18 +34,14 @@ captive_portal:
|
|||||||
output:
|
output:
|
||||||
- platform: ledc
|
- platform: ledc
|
||||||
pin: ${duct_fan_pin}
|
pin: ${duct_fan_pin}
|
||||||
id: ${duct_fan_id}
|
id: duct_fan_output_id
|
||||||
frequency: ${duct_fan_pwmfreq}
|
frequency: ${duct_fan_pwmfreq}
|
||||||
|
|
||||||
fan:
|
fan:
|
||||||
- platform: speed
|
- platform: speed
|
||||||
id: ${duct_fan_spd_id}
|
id: duct_fan_spd_id
|
||||||
output: ${duct_fan_id}
|
output: duct_fan_output_id
|
||||||
name: ${duct_fan_spd_name}
|
name: ${duct_fan_spd_name}
|
||||||
# speed:
|
|
||||||
# low: 0.2
|
|
||||||
# medium: 0.6
|
|
||||||
# high: 1.0
|
|
||||||
|
|
||||||
dallas:
|
dallas:
|
||||||
- pin:
|
- pin:
|
||||||
@@ -57,17 +51,84 @@ dallas:
|
|||||||
|
|
||||||
sensor:
|
sensor:
|
||||||
- platform: dallas
|
- platform: dallas
|
||||||
address: ${dallas_1_addr}
|
address: ${dallas_in_addr}
|
||||||
name: ${dallas_1_name}
|
name: ${dallas_in_name}
|
||||||
- platform: dallas
|
- platform: dallas
|
||||||
address: ${dallas_2_addr}
|
address: ${dallas_out_addr}
|
||||||
name: ${dallas_2_name}
|
name: ${dallas_out_name}
|
||||||
|
id: dallas_out_id
|
||||||
|
on_value:
|
||||||
|
then:
|
||||||
|
number.set:
|
||||||
|
id: fan_speed_target_out
|
||||||
|
value: !lambda |-
|
||||||
|
float lo;
|
||||||
|
float hi;
|
||||||
|
lo = id(thermostat_rack3_out).target_temperature_low;
|
||||||
|
hi = id(thermostat_rack3_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: fan_speed_target_in
|
||||||
|
name: Fan Speed Target In
|
||||||
|
optimistic: true
|
||||||
|
min_value: 0
|
||||||
|
max_value: 100
|
||||||
|
step: 1
|
||||||
|
- platform: template
|
||||||
|
id: fan_speed_target_out
|
||||||
|
name: 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;
|
||||||
|
|
||||||
|
# Dual-point thermostat
|
||||||
|
climate:
|
||||||
|
- platform: thermostat
|
||||||
|
id: thermostat_rack3_out
|
||||||
|
name: Rack3 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 Rack3 Thermostat"
|
||||||
|
- fan.turn_off:
|
||||||
|
id: duct_fan_spd_id
|
||||||
|
idle_action:
|
||||||
|
- logger.log: "Turning on Rack3 Thermostat"
|
||||||
|
cool_action:
|
||||||
|
- logger.log: "WARNING: Rack3 Thermostat has hit high temp!"
|
||||||
|
#TODO - provide some kind of warning / action here
|
||||||
|
|
||||||
# Sense when receiver is turned on
|
# Sense when receiver is turned on
|
||||||
binary_sensor:
|
binary_sensor:
|
||||||
- platform: gpio
|
- platform: gpio
|
||||||
pin: ${heat_pin}
|
pin: ${amppwr_pin}
|
||||||
name: ${heat_name}
|
name: ${amppwr_name}
|
||||||
device_class: power
|
device_class: power
|
||||||
# on_press:
|
# on_press:
|
||||||
# then:
|
# then:
|
||||||
@@ -75,12 +136,12 @@ binary_sensor:
|
|||||||
# condition:
|
# condition:
|
||||||
# lambda: 'return id(${duct_fan_spd_id}).state == "OFF";'
|
# lambda: 'return id(${duct_fan_spd_id}).state == "OFF";'
|
||||||
# then:
|
# then:
|
||||||
# - logger.log: "${duct_fan_spd_name} was off. Turning on as ${heat_name} turned on."
|
# - logger.log: "${duct_fan_spd_name} was off. Turning on as ${amppwr_name} turned on."
|
||||||
# - fan.turn_on:
|
# - fan.turn_on:
|
||||||
# id: ${duct_fan_spd_id}
|
# id: ${duct_fan_spd_id}
|
||||||
# speed: LOW
|
# speed: LOW
|
||||||
# else:
|
# else:
|
||||||
# - logger.log: "${heat_name} turned on, but not turning on ${duct_fan_spd_name} as already on."
|
# - logger.log: "${amppwr_name} turned on, but not turning on ${duct_fan_spd_name} as already on."
|
||||||
|
|
||||||
# on_release:
|
# on_release:
|
||||||
# then:
|
# then:
|
||||||
|
|||||||
Reference in New Issue
Block a user