diff --git a/Integrations/ESPHome/Core.yaml b/Integrations/ESPHome/Core.yaml index 6f055dd..c05ed6f 100644 --- a/Integrations/ESPHome/Core.yaml +++ b/Integrations/ESPHome/Core.yaml @@ -1,6 +1,6 @@ substitutions: name: apollo-temp-1 - version: "24.8.5.1" + version: "24.8.6.1" device_description: ${name} made by Apollo Automation - version ${version}. esp32: @@ -57,11 +57,11 @@ rtttl: deep_sleep: id: deep_sleep_1 - sleep_duration: 4h + sleep_duration: 8h run_duration: 30s # TODO: Add temp difference threshold notification. Sensor wakes up, checks temp difference from last measurement, if greater than threshold, send notification. - +# TODO: Add option to only notify when temp difference is greater than difference threshold. number: - platform: template @@ -123,7 +123,7 @@ number: - platform: template name: "Run Duration" id: deep_sleep_run_duration - min_value: 0 + min_value: 1 max_value: 800 step: 1 mode: box @@ -142,14 +142,14 @@ number: - platform: template name: "Sleep Duration" id: deep_sleep_sleep_duration - min_value: 0 + min_value: 1 max_value: 800 step: 1 mode: box update_interval: never optimistic: true restore_value: true - initial_value: 24 + initial_value: 8 icon: "mdi:arrow-collapse-right" entity_category: CONFIG unit_of_measurement: "h" @@ -278,7 +278,14 @@ switch: name: "Prevent Sleep" id: prevent_sleep icon: mdi:sleep - restore_mode: RESTORE_DEFAULT_OFF + restore_mode: RESTORE_DEFAULT_ON optimistic: true entity_category: "config" - initial_value: true \ No newline at end of file + on_turn_on: + then: + - lambda: |- + id(deep_sleep_1).prevent_deep_sleep(); + on_turn_off: + then: + - lambda: |- + id(deep_sleep_1).allow_deep_sleep(); diff --git a/Integrations/ESPHome/TEMP-1.yaml b/Integrations/ESPHome/TEMP-1.yaml index 72cd777..151d972 100644 --- a/Integrations/ESPHome/TEMP-1.yaml +++ b/Integrations/ESPHome/TEMP-1.yaml @@ -1,3 +1,4 @@ + esphome: name: "${name}" friendly_name: Apollo TEMP-1 @@ -30,7 +31,6 @@ esphome: on_shutdown: - switch.turn_off: accessory_power - dashboard_import: package_import_url: github://ApolloAutomation/TEMP-1/Integrations/ESPHome/TEMP-1.yaml import_full_config: false @@ -42,6 +42,20 @@ esp32_improv: ota: - platform: esphome + - platform: http_request + id: ota_managed + +http_request: + verify_ssl: true + +safe_mode: + +update: + - platform: http_request + id: firmware_update + name: Firmware Update + source: https://apolloautomation.github.io/TEMP-1/artifact/manifest.json + wifi: on_connect: - delay: 5s @@ -53,299 +67,5 @@ wifi: logger: - - - - - - - - - - - - - -substitutions: - name: apollo-temp-1 - version: "24.8.5.1" - device_description: ${name} made by Apollo Automation - version ${version}. - -esp32: - board: esp32-c3-devkitm-1 - framework: - type: esp-idf - -api: - services: - - service: play_buzzer - variables: - song_str: string - then: - - rtttl.play: - rtttl: !lambda 'return song_str;' - reboot_timeout: 0s - -globals: - - id: cycleCounter - type: int - restore_value: no - initial_value: '0' - - id: button_press_timestamp - restore_value: no - type: uint32_t - initial_value: '0' - -captive_portal: - -web_server: - port: 80 - -external_components: - - source: github://ApolloAutomation/esphome-battery-component - components: [max17048] #Forked OptionZero - -i2c: - sda: GPIO1 - scl: GPIO0 - id: bus_a - -one_wire: - - platform: gpio - pin: GPIO5 - -# Buzzer -output: - - platform: ledc - pin: GPIO10 - id: buzzer -rtttl: - output: buzzer - - -deep_sleep: - id: deep_sleep_1 - sleep_duration: 4h - run_duration: 30s - -# TODO: Add temp difference threshold notification. Sensor wakes up, checks temp difference from last measurement, if greater than threshold, send notification. - - -number: - - platform: template - name: AHT Temperature Offset - id: aht_temperature_offset - restore_value: true - initial_value: 0.0 - min_value: -70.0 - max_value: 70.0 - entity_category: "CONFIG" - unit_of_measurement: "°C" - optimistic: true - update_interval: never - step: 0.1 - mode: box - - - platform: template - name: AHT Humidity Offset - id: aht_humidity_offset - restore_value: true - initial_value: 0 - min_value: -70.0 - max_value: 70.0 - entity_category: "CONFIG" - unit_of_measurement: "%" - optimistic: true - update_interval: never - step: 0.1 - mode: box - - - platform: template - name: Max Temp - id: max_temp - restore_value: true - initial_value: 0 - min_value: -70.0 - max_value: 120.0 - entity_category: "CONFIG" - unit_of_measurement: "%" - optimistic: true - update_interval: never - step: 0.1 - mode: box - - - platform: template - name: Min Temp - id: min_temp - restore_value: true - initial_value: 0 - min_value: -70.0 - max_value: 120.0 - entity_category: "CONFIG" - unit_of_measurement: "%" - optimistic: true - update_interval: never - step: 0.1 - mode: box - - - 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: 30 - 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 - min_value: 1 - max_value: 800 - step: 1 - mode: box - update_interval: never - optimistic: true - restore_value: true - initial_value: 8 - icon: "mdi:arrow-collapse-right" - entity_category: CONFIG - unit_of_measurement: "h" - on_value: - then: - - lambda: |- - id(deep_sleep_1).set_sleep_duration(x * 60 * 60 * 1000); - - -binary_sensor: - - platform: status - name: Online - id: ink_ha_connected - - platform: gpio - pin: - number: GPIO9 - inverted: true - mode: - input: true - pullup: true - id: reset_button - on_press: - then: - - lambda: |- - id(button_press_timestamp) = millis(); - on_release: - then: - - lambda: |- - if (millis() - id(button_press_timestamp) >= 5000) { - // Remove Wifi - id(factory_reset_switch).turn_on(); - } - - platform: homeassistant - name: "OTA Mode" - id: ota_mode - entity_id: input_boolean.ota_mode - -sensor: - - platform: internal_temperature - name: "ESP Temperature" - id: sys_esp_temperature - - - platform: uptime - name: Uptime - id: sys_uptime - update_interval: 60s - - - platform: wifi_signal - name: RSSI - id: wifi_signal_db - update_interval: 60s - entity_category: "diagnostic" - - - platform: dallas_temp - name: "Temperature Probe" - update_interval: 5s - - - platform: aht10 - variant: AHT20 - temperature: - name: "Board Temperature" - filters: - - lambda: return x - id(aht_temperature_offset).state; - humidity: - name: "Board Humidity" - filters: - - lambda: return x - id(aht_humidity_offset).state; - update_interval: 5s - - - platform: max17048 - battery_voltage: - name: Battery voltage - id: batt_v - battery_level: - name: Battery level - id: batt_pct - -light: - - platform: esp32_rmt_led_strip - id: rgb_light - name: "RGB Light" - pin: GPIO3 - rmt_channel: 0 - default_transition_length: 0s - chipset: WS2812 - num_leds: 3 - rgb_order: grb - effects: - - pulse: - name: "Slow Pulse" - transition_length: 250ms - update_interval: 250ms - min_brightness: 50% - max_brightness: 100% - - pulse: - name: "Fast Pulse" - transition_length: 100ms - update_interval: 100ms - min_brightness: 50% - max_brightness: 100% - -button: - - platform: restart - icon: mdi:power-cycle - name: "ESP Reboot" - - - platform: factory_reset - disabled_by_default: True - name: "Factory Reset ESP" - id: factory_reset_all - - -switch: - - platform: factory_reset - id: factory_reset_switch - internal: true - - platform: gpio - pin: GPIO4 - name: "Accessory Power" - id: accessory_power - - platform: template - name: "Alarm Outside Temp Range" - id: alarm_outside_temp_range - optimistic: true - - platform: template - name: "Prevent Sleep" - id: prevent_sleep - icon: mdi:sleep - restore_mode: RESTORE_DEFAULT_ON - optimistic: true - entity_category: "config" \ No newline at end of file +packages: + core: !include Core.yaml diff --git a/README.md b/README.md index 2491032..5572d6d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Key Features of the TEMP-1 Sensor: -External 1m Temperature Probe: The TEMP-1 comes with a 1m waterproof temperature probe. This allows you to measure temperature in hard-to-reach places or in areas where the sensor itself cannot be placed. +External 1.5m Temperature Probe: The TEMP-1 comes with a 1m waterproof temperature probe. This allows you to measure temperature in hard-to-reach places or in areas where the sensor itself cannot be placed. Onboard Temperature/Humidity Sensor: The TEMP-1 also has an onboard temperature sensor, which can be used to measure ambient temperature and humidity.