File tree Expand file tree Collapse file tree 3 files changed +79
-1
lines changed Expand file tree Collapse file tree 3 files changed +79
-1
lines changed Original file line number Diff line number Diff line change 11substitutions :
22 name : apollo-temp-1
3- version : " 24.9.21.1 "
3+ version : " 24.9.21.2 "
44 device_description : ${name} made by Apollo Automation - version ${version}.
55
66esp32 :
Original file line number Diff line number Diff line change @@ -15,8 +15,47 @@ esphome:
1515 priority : 500
1616 then :
1717 - switch.turn_on : accessory_power
18+ - lambda : |-
19+ id(deep_sleep_1).set_run_duration(id(deep_sleep_run_duration).state * 1000);
20+ id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000);
21+ - if :
22+ condition :
23+ or :
24+ - binary_sensor.is_on : ota_mode
25+ - switch.is_on : prevent_sleep
26+ then :
27+ - lambda : |-
28+ ESP_LOGW("Apollo", "Preventing Deep Sleep Due To OTA On Boot");
29+ id(deep_sleep_1).prevent_deep_sleep();
30+
31+ - if :
32+ condition :
33+ switch.is_on : notify_only_outside_temp_difference
34+ then :
35+ - logger.log : " Apollo Automation: Notify Only Outside Temp Difference"
36+ - delay : 2s
37+ - if : # Check If Temp Probe Is Outside Threshold
38+ condition :
39+ - lambda : |-
40+ return std::abs(id(temp_probe).state - id(last_temp)) > id(temp_diff_threshold)->state;
41+ then : # If So Then Turn On Wifi To Update
42+ - logger.log : " Apollo Automation: Outside Temp Change Detected"
43+ - wifi.enable :
44+ - lambda : |-
45+ id(last_temp) = id(temp_probe).state;
46+ else : # If Not Then Check OTA And Sleep
47+ - if :
48+ condition :
49+ and :
50+ - binary_sensor.is_off : ota_mode
51+ - switch.is_off : prevent_sleep
52+ then :
53+ - switch.turn_off : accessory_power
54+ - deep_sleep.enter :
55+ id : deep_sleep_1
1856
1957 on_shutdown :
58+ - light.turn_off : rgb_light
2059 - switch.turn_off : accessory_power
2160
2261
Original file line number Diff line number Diff line change @@ -15,8 +15,47 @@ esphome:
1515 priority : 500
1616 then :
1717 - switch.turn_on : accessory_power
18+ - lambda : |-
19+ id(deep_sleep_1).set_run_duration(id(deep_sleep_run_duration).state * 1000);
20+ id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000);
21+ - if :
22+ condition :
23+ or :
24+ - binary_sensor.is_on : ota_mode
25+ - switch.is_on : prevent_sleep
26+ then :
27+ - lambda : |-
28+ ESP_LOGW("Apollo", "Preventing Deep Sleep Due To OTA On Boot");
29+ id(deep_sleep_1).prevent_deep_sleep();
30+
31+ - if :
32+ condition :
33+ switch.is_on : notify_only_outside_temp_difference
34+ then :
35+ - logger.log : " Apollo Automation: Notify Only Outside Temp Difference"
36+ - delay : 2s
37+ - if : # Check If Temp Probe Is Outside Threshold
38+ condition :
39+ - lambda : |-
40+ return std::abs(id(temp_probe).state - id(last_temp)) > id(temp_diff_threshold)->state;
41+ then : # If So Then Turn On Wifi To Update
42+ - logger.log : " Apollo Automation: Outside Temp Change Detected"
43+ - wifi.enable :
44+ - lambda : |-
45+ id(last_temp) = id(temp_probe).state;
46+ else : # If Not Then Check OTA And Sleep
47+ - if :
48+ condition :
49+ and :
50+ - binary_sensor.is_off : ota_mode
51+ - switch.is_off : prevent_sleep
52+ then :
53+ - switch.turn_off : accessory_power
54+ - deep_sleep.enter :
55+ id : deep_sleep_1
1856
1957 on_shutdown :
58+ - light.turn_off : rgb_light
2059 - switch.turn_off : accessory_power
2160
2261
You can’t perform that action at this time.
0 commit comments