Skip to content

Commit

Permalink
Initial Code
Browse files Browse the repository at this point in the history
  • Loading branch information
TrevorSchirmer committed Sep 24, 2024
1 parent b5ca997 commit 28dba2e
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build
env:
DEVICE_NAME: plt-1 # TODO: Rename
DEVICE_NAME: pump-1 # TODO: Rename
RELEASE_URL: ${{ github.server_url }}/${{ github.repository }}/releases/latest

on:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
file: # TODO: Rename
- Integrations/ESPHome/PLT-1.yaml
- Integrations/ESPHome/PLT-1_BLE.yaml
file:
- Integrations/ESPHome/PUMP-1.yaml
- Integrations/ESPHome/PUMP-1_BLE.yaml
steps:
- name: Checkout source code
uses: actions/[email protected]
Expand Down
146 changes: 144 additions & 2 deletions Integrations/ESPHome/Core.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
substitutions:
name: apollo-plt-1 # TODO: Rename
name: apollo-pump-1
version: "24.8.7.2"
device_description: ${name} made by Apollo Automation - version ${version}.

Expand All @@ -9,6 +9,13 @@ esp32:
type: esp-idf

api:
services:
- service: play_buzzer
variables:
song_str: string
then:
- rtttl.play:
rtttl: !lambda 'return song_str;'

globals:
- id: cycleCounter
Expand All @@ -23,4 +30,139 @@ globals:
captive_portal:

web_server:
port: 80
port: 80

# Buzzer
output:
- platform: ledc
pin: GPIO10
id: buzzer
rtttl:
output: buzzer

switch:
- platform: factory_reset
id: factory_reset_switch
internal: true
- platform: gpio
pin: GPIO7
name: "Pump Control"
id: pump_control

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) >= 10000) {
// Remove Wifi
id(factory_reset_switch).turn_on();
}
else {
// StatusCheck
id(statusCheck).execute();
}
- platform: gpio
name: Water level exists
id: water_level_exists
icon: mdi:water
pin:
number: GPIO4
mode:
input: true
pulldown: True
filters:
- invert:



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"

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: 1
rgb_order: grb
effects:
- pulse:
name: "Slow Pulse"
transition_length: 1000ms
update_interval: 1000ms
min_brightness: 0%
max_brightness: 100%
- pulse:
name: "Fast Pulse"
transition_length: 100ms
update_interval: 100ms
min_brightness: 50%
max_brightness: 100%

script:
- id: statusCheck
then:
- if:
condition:
- lambda: 'return id(ink_ha_connected).state;'
then:
- logger.log: "Apollo Automation: Connected To HA"
- light.turn_on:
id: rgb_light
brightness: 100%
red: 0%
green: 0%
blue: 100%
else:
- if:
condition:
- wifi.connected
then:
- logger.log: "Apollo Automation: Connected To Wifi"
- light.turn_on:
id: rgb_light
brightness: 100%
red: 0%
green: 100%
blue: 0%
else:
- logger.log: "Apollo Automation: Not Connected To Wifi"
- light.turn_on:
id: rgb_light
brightness: 100%
red: 100%
green: 100%
blue: 0%
- delay: 5s
- light.turn_off: rgb_light
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
esphome:
name: "${name}"
friendly_name: Apollo AIR-1 # TODO: Rename
comment: Apollo AIR-1 # TODO: Rename
friendly_name: Apollo PUMP-1
comment: Apollo PUMP-1
name_add_mac_suffix: true
platformio_options:
board_build.flash_mode: dio

project:
name: "ApolloAutomation.AIR-1" # TODO: Rename
name: "ApolloAutomation.PUMP-1"
version: "${version}"

min_version: 2023.11.1

dashboard_import:
package_import_url: github://ApolloAutomation/AIR-1/Integrations/ESPHome/AIR-1.yaml
import_full_config: false # TODO: Rename
package_import_url: github://ApolloAutomation/PUMP-1/Integrations/ESPHome/PUMP-1.yaml
import_full_config: false

improv_serial:

Expand All @@ -36,7 +36,7 @@ update:
- platform: http_request
id: firmware_update
name: Firmware Update
source: https://apolloautomation.github.io/PLT-1/artifact/manifest.json # TODO: Rename
source: https://apolloautomation.github.io/PUMP-1/artifact/manifest.json

wifi:
on_connect:
Expand All @@ -45,9 +45,9 @@ wifi:
on_disconnect:
- ble.enable:
ap:
ssid: "Apollo PLT1 Hotspot" # TODO: Rename
ssid: "Apollo PUMP1 Hotspot"

logger:

packages:
core: !include Core.yaml
core: !include Core.yaml
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Apollo AIR-1
# Apollo PUMP-1

![Pen no dust](https://github.com/ApolloAutomation/AIR-1/assets/24777085/183af36d-4611-4cb3-af1e-43b84d4d201a)
![Pen no dust](https://github.com/ApolloAutomation/PUMP-1/assets/24777085/183af36d-4611-4cb3-af1e-43b84d4d201a)


Key Features of the AIR-1 Sensor:
Key Features of the PUMP-1 Sensor:

MiCS-4514 Below have individual gas % readout: CO, C2H5OH (Alcohol), H2, NO2, and NH3

Expand All @@ -15,9 +15,9 @@ DPS310: Barometric air pressure and temperature.

Dimensions & Design:

The AIR-1 measures just 61mm x 61mm x 30mm, and we have focused on efficient heat management within this small package to maintain sensor accuracy. This includes a thoughtful PCB layout and case design, incorporating ventilation and strategic component placement.
The PUMP-1 measures just 61mm x 61mm x 30mm, and we have focused on efficient heat management within this small package to maintain sensor accuracy. This includes a thoughtful PCB layout and case design, incorporating ventilation and strategic component placement.

Links: \
Discord (Support/feedback/discussion/future products): [https://discord.gg/8PpS4yUaUh](https://discord.gg/mMNgQPyF94) \
Shop: [https://apolloautomation.com](https://apolloautomation.com/products/air-1)https://apolloautomation.com/products/air-1 \
Shop: [https://apolloautomation.com](https://apolloautomation.com/products/pump-1)https://apolloautomation.com/products/pump-1 \
Wiki: [https://wiki.apolloautomation.com](https://wiki.apolloautomation.com/)https://wiki.apolloautomation.com/
10 changes: 5 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
<html>
<head>
<meta charset="utf-8" />
<title>Apollo AIR-1 Installer</title>
<title>Apollo PUMP-1 Installer</title>
<meta
name="description"
content="Easily allow users to install Apollo AIR-1 firmware on the web."
content="Easily allow users to install Apollo PUMP-1 firmware on the web."
/>
<meta name="viewport" content="width=device-width" />
<meta name="color-scheme" content="dark light" />
Expand Down Expand Up @@ -79,16 +79,16 @@
</head>
<body>
<div class="content">
<h1>Apollo AIR-1 Installer</h1>
<h1>Apollo PUMP-1 Installer</h1>

<p class="button-row" align="center">
<esp-web-install-button manifest="./Integrations/ESPHome/manifest.json">
</esp-web-install-button>
</p>

<div class="footer">
<a href="https://github.com/ApolloAutomation/AIR-1"
>Apollo AIR-1</a
<a href="https://github.com/ApolloAutomation/PUMP-1"
>Apollo PUMP-1</a
> &mdash;
Installer powered by <a href="https://esphome.github.io/esp-web-tools/">ESP Web Tools</a>.
</div>
Expand Down

0 comments on commit 28dba2e

Please sign in to comment.