Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenpapierski authored Jul 11, 2024
0 parents commit a8ce1e3
Show file tree
Hide file tree
Showing 12 changed files with 361 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on:
pull_request:

jobs:
ci:
name: Building ${{ matrix.file }}
runs-on: ubuntu-latest
strategy:
matrix:
file:
- project-template-esp32-release.yaml
- project-template-esp32-c3-release.yaml
- project-template-esp32-s3-release.yaml
steps:
- name: Checkout source code
uses: actions/checkout@v4.1.7
- name: Build ESPHome firmware to verify configuration
uses: esphome/build-action@v3.2.0
with:
yaml_file: ${{ matrix.file }}
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Build and Publish ESPHome firmware and website

on:
push:
branches:
- main

jobs:
build:
uses: esphome/workflows/.github/workflows/publish.yml@main
with:
# CHANGEME: Set the filenames of your config files here:
files: project-template-esp32-release.yaml,project-template-esp32-c3-release.yaml,project-template-esp32-s3-release.yaml
# CHANGEME: Set the name of your project here:
name: Template Project
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# ESPHome Project Template

This repo serves as a template for creating a new ESPHome project.

It includes a GitHub workflow that will automatically build the configuration(s) and then deploys a simple
website via GitHub pages that utilises [ESP Web Tools](https://esphome.github.io/esp-web-tools/) for users to
easily install your project onto their device.

## Instructions

1. Use this repo template to [generate](https://github.com/esphome/esphome-project-template/generate) your own repository.
- Make sure to check `Include all branches` so that GitHub Pages is automatically enabled.
2. Clone your new repository.
3. Add your project specific YAML configuration(s) along with the contents of the `project-template-....yaml` files, taking note of the comments in this template file and name accordingly.
4.
a. Update [.github/workflows/publish.yml](.github/workflows/publish.yml) to contain your own YAML config filename(s).
b. Update [.github/workflows/ci.yml](.github/workflows/ci.yml) to contain your own YAML config filename(s).
5. Update [static/_config.yml](static/_config.yml) to change the title, description and basic theme of the generated website.
6. Add more content to the [static/index.md](static/index.md) file to explain your project.
Make sure to leave the installation code tags in place so users get the install button.
7. Add permission to github-actions[bot]
a. go to your project Settings, under the Actions collapsible, click on General.
b. scroll down until you find Workflow permissions and mark the option Read and write permissions.
c. Hit the save button
8. Push your changes to the repository and GitHub Actions will automatically build and deploy your project.

41 changes: 41 additions & 0 deletions project-template-esp32-adopt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
esphome:
name: project-template
friendly_name: Project Template
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true

# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: "1.0"

esp32:
board: esp32dev
framework:
type: esp-idf

# To be able to get logs from the device via serial and api.
logger:

# API is a requirement of the dashboard import.
api:

# OTA is required for Over-the-Air updating
ota:
- platform: esphome

wifi:
# Set up a wifi access point using the device name above
ap:

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:

##########################################################
# Most projects should not remove anything from above here
# and should just modify the name, project name/version
# and git url for the dashboard_import
##########################################################
35 changes: 35 additions & 0 deletions project-template-esp32-c3-adopt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
esphome:
name: project-template
friendly_name: Project Template
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true

# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: "1.0"

esp32:
board: esp32-c3-devkitm-1
framework:
type: esp-idf

# To be able to get logs from the device via serial and api.
logger:

# API is a requirement of the dashboard import.
api:

# OTA is required for Over-the-Air updating
ota:
- platform: esphome

wifi:
# Set up a wifi access point using the device name above
ap:

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:
55 changes: 55 additions & 0 deletions project-template-esp32-c3-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
esphome:
name: project-template
friendly_name: Project Template
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true

# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: "1.0"

esp32:
board: esp32-c3-devkitm-1
framework:
type: esp-idf

# To be able to get logs from the device via serial and api.
logger:

# API is a requirement of the dashboard import.
api:

# OTA is required for Over-the-Air updating
ota:
- platform: esphome

# This should point to the public location of this yaml file.
dashboard_import:
package_import_url: github://esphome/esphome-project-template/project-template-esp32-c3-adopt.yaml@main

wifi:
# Set up a wifi access point using the device name above
ap:

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:

##########################################################
# Most projects should not remove anything from above here
# and should just modify the name, project name/version
# and git url for the dashboard_import
##########################################################


# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none

# Sets up the improv via serial client for Wi-Fi provisioning.
# Handy if your device has a usb port for the user to add credentials when they first get it.
improv_serial:
55 changes: 55 additions & 0 deletions project-template-esp32-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
esphome:
name: project-template
friendly_name: Project Template
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true

# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: "1.0"

esp32:
board: esp32dev
framework:
type: esp-idf

# To be able to get logs from the device via serial and api.
logger:

# API is a requirement of the dashboard import.
api:

# OTA is required for Over-the-Air updating
ota:
- platform: esphome

# This should point to the public location of this yaml file.
dashboard_import:
package_import_url: github://esphome/esphome-project-template/project-template-esp32-adopt.yaml@main

wifi:
# Set up a wifi access point using the device name above
ap:

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:

##########################################################
# Most projects should not remove anything from above here
# and should just modify the name, project name/version
# and git url for the dashboard_import
##########################################################


# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none

# Sets up the improv via serial client for Wi-Fi provisioning.
# Handy if your device has a usb port for the user to add credentials when they first get it.
improv_serial:
36 changes: 36 additions & 0 deletions project-template-esp32-s3-adopt.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
esphome:
name: project-template
friendly_name: Project Template
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true

# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: "1.0"

esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: esp-idf

# To be able to get logs from the device via serial and api.
logger:

# API is a requirement of the dashboard import.
api:

# OTA is required for Over-the-Air updating
ota:
- platform: esphome

wifi:
# Set up a wifi access point using the device name above
ap:

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:
56 changes: 56 additions & 0 deletions project-template-esp32-s3-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
esphome:
name: project-template
friendly_name: Project Template
# Automatically add the mac address to the name
# so you can use a single firmware for all devices
name_add_mac_suffix: true

# This will allow for project identification,
# configuration and updates.
project:
name: esphome.project-template
version: "1.0"

esp32:
board: esp32-s3-devkitc-1
variant: esp32s3
framework:
type: esp-idf

# To be able to get logs from the device via serial and api.
logger:

# API is a requirement of the dashboard import.
api:

# OTA is required for Over-the-Air updating
ota:
- platform: esphome

# This should point to the public location of this yaml file.
dashboard_import:
package_import_url: github://esphome/esphome-project-template/project-template-esp32-s3-adopt.yaml@main

wifi:
# Set up a wifi access point using the device name above
ap:

# In combination with the `ap` this allows the user
# to provision wifi credentials to the device.
captive_portal:

##########################################################
# Most projects should not remove anything from above here
# and should just modify the name, project name/version
# and git url for the dashboard_import
##########################################################


# Sets up Bluetooth LE (Only on ESP32) to allow the user
# to provision wifi credentials to the device.
esp32_improv:
authorizer: none

# Sets up the improv via serial client for Wi-Fi provisioning.
# Handy if your device has a usb port for the user to add credentials when they first get it.
improv_serial:
4 changes: 4 additions & 0 deletions static/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# CHANGEME: Set these variable to your liking
title: ESPHome Project Template
description: Powered by ESPHome and ESP Web Tools
theme: jekyll-theme-slate
11 changes: 11 additions & 0 deletions static/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# About

Add some information about your project here.

# Installation

You can use the button below to install the pre-built firmware directly to your device via USB from the browser.

<esp-web-install-button manifest="./manifest.json"></esp-web-install-button>

<script type="module" src="https://unpkg.com/esp-web-tools@9/dist/web/install-button.js?module"></script>

0 comments on commit a8ce1e3

Please sign in to comment.