Add on_boot. Partial clean up.
This commit is contained in:
@@ -42,9 +42,19 @@ globals:
|
||||
initial_value: ${duct_fan_hi_spd}
|
||||
|
||||
<<: !include .common.yaml
|
||||
<<: !include .esp32.yaml
|
||||
<<: !include .wifi-oss.yaml
|
||||
|
||||
esphome:
|
||||
name: ${dn}
|
||||
platform: ESP32
|
||||
board: esp32doit-devkit-v1
|
||||
on_boot:
|
||||
- priority: 200.0
|
||||
then:
|
||||
- output.set_level:
|
||||
id: duct_fan_output_id
|
||||
level: ${duct_fan_vent_spd}%
|
||||
|
||||
switch:
|
||||
- platform: gpio
|
||||
pin: ${wall_fan_pwr_pin}
|
||||
@@ -199,4 +209,3 @@ climate:
|
||||
- logger.log: "WARNING: ${friendly_name} Thermostat has hit high temp!"
|
||||
- switch.turn_on: thermostat_on_id
|
||||
#TODO - provide some kind of warning / action here
|
||||
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
substitutions:
|
||||
device_name: rack-3
|
||||
dn: rack_3
|
||||
sn: R3
|
||||
friendly_name: Rack 3
|
||||
duct_fan_pin: GPIO13
|
||||
duct_fan_name: R3 Duct Fan Spd
|
||||
duct_fan_tgt_spd_in_name: Rack 3 Duct Fan Target Spd In
|
||||
duct_fan_tgt_spd_out_name: Rack 3 Duct Fan Target Spd Out
|
||||
duct_fan_name: ${sn} Duct Fan Spd
|
||||
duct_fan_tgt_spd_in_name: ${sn} DF Tgt Spd In
|
||||
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"
|
||||
@@ -13,9 +17,9 @@ substitutions:
|
||||
amppwr_name: "Denon Pwr"
|
||||
dallas_pin: GPIO32
|
||||
dallas_in_addr: "0x7F0114328974D728"
|
||||
dallas_in_name: Rack 3 Temp In
|
||||
dallas_in_name: ${friendly_name} Temp In
|
||||
dallas_out_addr: "0xB801143296ED7B28"
|
||||
dallas_out_name: Rack 3 Temp Out
|
||||
dallas_out_name: ${friendly_name} Temp Out
|
||||
dallas_update_interval: 30s
|
||||
|
||||
globals:
|
||||
@@ -28,7 +32,7 @@ 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: duct_fan_vent_spd_id
|
||||
type: float
|
||||
initial_value: ${duct_fan_vent_spd}
|
||||
- id: duct_fan_hi_spd_id
|
||||
@@ -39,6 +43,12 @@ esphome:
|
||||
name: rack_3
|
||||
platform: ESP32
|
||||
board: esp32doit-devkit-v1
|
||||
on_boot:
|
||||
- priority: 200.0
|
||||
then:
|
||||
- output.set_level:
|
||||
id: duct_fan_output_id
|
||||
level: ${duct_fan_vent_spd}%
|
||||
|
||||
wifi:
|
||||
ssid: "kungle-ot"
|
||||
@@ -138,7 +148,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);
|
||||
vent_spd = id(duct_fan_vent_spd_id);
|
||||
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);
|
||||
@@ -155,7 +165,10 @@ number:
|
||||
call.perform();
|
||||
return off_spd;
|
||||
}
|
||||
if (curtemp > hi_temp) {
|
||||
if (std::isnan(curtemp)) {
|
||||
ESP_LOGD("fan_speed", "DEBUG current temp unknown. Set spd to vent.");
|
||||
newspd = vent_spd;
|
||||
} else if (curtemp > hi_temp) {
|
||||
ESP_LOGD("fan_speed", "DEBUG curtemp > hi_temp");
|
||||
newspd = hi_spd;
|
||||
} else if (curtemp < lo_temp) {
|
||||
@@ -185,7 +198,7 @@ number:
|
||||
climate:
|
||||
- platform: thermostat
|
||||
id: thermostat_out_id
|
||||
name: Rack3 Out
|
||||
name: ${friendly_name} Out
|
||||
sensor: dallas_out_id
|
||||
visual:
|
||||
min_temperature: 60 °F
|
||||
@@ -200,12 +213,12 @@ climate:
|
||||
min_heating_run_time: 60s
|
||||
min_idle_time: 60s
|
||||
heat_action:
|
||||
- logger.log: "Turning off Rack3 Thermostat"
|
||||
- logger.log: "Turning off ${friendly_name} Thermostat"
|
||||
- switch.turn_off: thermostat_on_id
|
||||
idle_action:
|
||||
- logger.log: "Turning on Rack3 Thermostat"
|
||||
- logger.log: "Turning on ${friendly_name} Thermostat"
|
||||
- switch.turn_on: thermostat_on_id
|
||||
cool_action:
|
||||
- logger.log: "WARNING: Rack3 Thermostat has hit high temp!"
|
||||
- logger.log: "WARNING: ${friendly_name} Thermostat has hit high temp!"
|
||||
- switch.turn_on: thermostat_on_id
|
||||
#TODO - provide some kind of warning / action here
|
||||
|
||||
Reference in New Issue
Block a user