diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 5235162..1d7870b 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -1,5 +1,5 @@ substitutions: - version: "24.11.24.1" + version: "24.11.25.1" esp32: board: esp32-c3-devkitm-1 @@ -47,8 +47,8 @@ i2c: deep_sleep: id: deep_sleep_1 - sleep_duration: 12h - run_duration: 60s + sleep_duration: 24h + run_duration: 90s wakeup_pin: number: GPIO4 allow_other_uses: true @@ -57,13 +57,11 @@ deep_sleep: input: true pullup: true -switch: - - platform: gpio +power_supply: + - id: 'power_supply_1' pin: GPIO5 - name: "Accessory Power" - id: accessory_power - restore_mode: ALWAYS_ON - setup_priority: 1100 + +switch: - platform: factory_reset id: factory_reset_switch internal: true @@ -76,25 +74,6 @@ button: internal: true number: - - platform: template - name: "Run Duration" - id: deep_sleep_run_duration - min_value: 1 - max_value: 800 - step: 1 - mode: box - update_interval: never - optimistic: true - restore_value: true - initial_value: 60 - icon: "mdi:arrow-collapse-right" - entity_category: CONFIG - unit_of_measurement: "s" - on_value: - then: - - lambda: |- - id(deep_sleep_1).set_run_duration(x * 1000); - - platform: template name: "Sleep Duration" id: deep_sleep_sleep_duration @@ -105,7 +84,7 @@ number: update_interval: never optimistic: true restore_value: true - initial_value: 12 + initial_value: 24 icon: "mdi:arrow-collapse-right" entity_category: CONFIG unit_of_measurement: "h" @@ -257,6 +236,7 @@ light: chipset: WS2812 num_leds: 22 rgb_order: grb + power_supply: power_supply_1 effects: - pulse: name: "Slow Pulse" @@ -351,16 +331,14 @@ light: script: - id: play_song_1 then: - - switch.turn_on: accessory_power - light.turn_on: - brightness: 50% + brightness: 40% id: rgb_light effect: "RainbowWave" - rtttl.play: rtttl: !lambda 'return id(song_1).state;' - delay: 30s - light.turn_off: rgb_light - - switch.turn_off: accessory_power - if: condition: - switch.is_off: prevent_sleep @@ -370,16 +348,14 @@ script: - id: play_song_2 then: - - switch.turn_on: accessory_power - light.turn_on: - brightness: 50% + brightness: 40% id: rgb_light effect: "TwinklingWhite" - rtttl.play: rtttl: !lambda 'return id(song_2).state;' - delay: 30s - light.turn_off: rgb_light - - switch.turn_off: accessory_power - if: condition: - switch.is_off: prevent_sleep @@ -389,16 +365,14 @@ script: - id: play_song_3 then: - - switch.turn_on: accessory_power - light.turn_on: - brightness: 50% + brightness: 40% id: rgb_light effect: "RedGreen" - rtttl.play: rtttl: !lambda 'return id(song_3).state;' - delay: 30s - light.turn_off: rgb_light - - switch.turn_off: accessory_power - if: condition: - switch.is_off: prevent_sleep @@ -411,7 +385,7 @@ script: - lambda: "id(runTest) = false;" - light.turn_on: id: rgb_light - brightness: 50% + brightness: 40% red: 0% green: 100% blue: 0% diff --git a/Integrations/ESPHome/H-1.yaml b/Integrations/ESPHome/H-1.yaml index 0887f1a..9f33c01 100644 --- a/Integrations/ESPHome/H-1.yaml +++ b/Integrations/ESPHome/H-1.yaml @@ -14,9 +14,7 @@ esphome: on_boot: - priority: 500 then: - - switch.turn_on: accessory_power - lambda: |- - id(deep_sleep_1).set_run_duration(id(deep_sleep_run_duration).state * 1000); id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000); - if: condition: @@ -36,7 +34,6 @@ esphome: - lambda: "id(testScript).execute();" on_shutdown: - light.turn_off: rgb_light - - switch.turn_off: accessory_power dashboard_import: package_import_url: github://ApolloAutomation/H-1/Integrations/ESPHome/H-1.yaml @@ -100,6 +97,7 @@ api: reboot_timeout: 0s on_client_connected: then: + - delay: 5s - if: condition: or: @@ -108,7 +106,7 @@ api: then: - lambda: |- ESP_LOGW("Apollo", "Preventing Deep Sleep Due To OTA Or Switch"); - id(deep_sleep_1).prevent_deep_sleep(); + id(deep_sleep_1).prevent_deep_sleep(); switch: - platform: template name: "Prevent Sleep" @@ -168,7 +166,7 @@ script: - logger.log: "Apollo Automation: Connected To HA" - light.turn_on: id: rgb_light - brightness: 100% + brightness: 40% red: 0% green: 0% blue: 100% @@ -180,7 +178,7 @@ script: - logger.log: "Apollo Automation: Connected To Wifi" - light.turn_on: id: rgb_light - brightness: 100% + brightness: 40% red: 0% green: 100% blue: 0% @@ -188,7 +186,7 @@ script: - logger.log: "Apollo Automation: Not Connected To Wifi" - light.turn_on: id: rgb_light - brightness: 100% + brightness: 40% red: 100% green: 100% blue: 0% diff --git a/Integrations/ESPHome/H-1D.yaml b/Integrations/ESPHome/H-1D.yaml index 08be1a3..eddf36a 100644 --- a/Integrations/ESPHome/H-1D.yaml +++ b/Integrations/ESPHome/H-1D.yaml @@ -14,9 +14,7 @@ esphome: on_boot: - priority: 500 then: - - switch.turn_on: accessory_power - lambda: |- - id(deep_sleep_1).set_run_duration(id(deep_sleep_run_duration).state * 1000); id(deep_sleep_1).set_sleep_duration(id(deep_sleep_sleep_duration).state * 60 * 60 * 1000); - if: condition: @@ -34,7 +32,6 @@ esphome: - lambda: "id(testScript).execute();" on_shutdown: - light.turn_off: rgb_light - - switch.turn_off: accessory_power safe_mode: @@ -48,15 +45,13 @@ switch: restore_mode: ALWAYS_OFF optimistic: true entity_category: "config" - - script: - id: statusCheck then: - light.turn_on: id: rgb_light - brightness: 100% + brightness: 40% red: 0% green: 100% blue: 0%