YAML linting (#3779)

This commit is contained in:
Jesse Hills 2022-09-06 15:48:01 +12:00 committed by GitHub
parent c317422ed7
commit 89fd367297
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 1039 additions and 933 deletions

View File

@ -25,10 +25,9 @@ indent_size = 2
[*.{yaml,yml}] [*.{yaml,yml}]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2
quote_type = single quote_type = double
# JSON # JSON
[*.json] [*.json]
indent_style = space indent_style = space
indent_size = 2 indent_size = 2

1
.github/FUNDING.yml vendored
View File

@ -1,3 +1,4 @@
---
# These are supported funding model platforms # These are supported funding model platforms
custom: https://www.nabucasa.com custom: https://www.nabucasa.com

View File

@ -1,3 +1,4 @@
---
blank_issues_enabled: false blank_issues_enabled: false
contact_links: contact_links:
- name: Issue Tracker - name: Issue Tracker
@ -5,7 +6,10 @@ contact_links:
about: Please create bug reports in the dedicated issue tracker. about: Please create bug reports in the dedicated issue tracker.
- name: Feature Request Tracker - name: Feature Request Tracker
url: https://github.com/esphome/feature-requests url: https://github.com/esphome/feature-requests
about: Please create feature requests in the dedicated feature request tracker. about: |
Please create feature requests in the dedicated feature request tracker.
- name: Frequently Asked Question - name: Frequently Asked Question
url: https://esphome.io/guides/faq.html url: https://esphome.io/guides/faq.html
about: Please view the FAQ for common questions and what to include in a bug report. about: |
Please view the FAQ for common questions and what
to include in a bug report.

View File

@ -1,13 +1,14 @@
---
version: 2 version: 2
updates: updates:
- package-ecosystem: "pip" - package-ecosystem: pip
directory: "/" directory: "/"
schedule: schedule:
interval: "daily" interval: daily
ignore: ignore:
# Hypotehsis is only used for testing and is updated quite often # Hypotehsis is only used for testing and is updated quite often
- dependency-name: hypothesis - dependency-name: hypothesis
- package-ecosystem: "github-actions" - package-ecosystem: github-actions
directory: "/" directory: "/"
schedule: schedule:
interval: daily interval: daily

View File

@ -1,21 +1,23 @@
---
name: CI for docker images name: CI for docker images
# Only run when docker paths change # Only run when docker paths change
# yamllint disable-line rule:truthy
on: on:
push: push:
branches: [dev, beta, release] branches: [dev, beta, release]
paths: paths:
- 'docker/**' - "docker/**"
- '.github/workflows/**' - ".github/workflows/**"
- 'requirements*.txt' - "requirements*.txt"
- 'platformio.ini' - "platformio.ini"
pull_request: pull_request:
paths: paths:
- 'docker/**' - "docker/**"
- '.github/workflows/**' - ".github/workflows/**"
- 'requirements*.txt' - "requirements*.txt"
- 'platformio.ini' - "platformio.ini"
permissions: permissions:
contents: read contents: read
@ -30,24 +32,24 @@ jobs:
arch: [amd64, armv7, aarch64] arch: [amd64, armv7, aarch64]
build_type: ["ha-addon", "docker", "lint"] build_type: ["ha-addon", "docker", "lint"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.9' python-version: "3.9"
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
- name: Set TAG - name: Set TAG
run: | run: |
echo "TAG=check" >> $GITHUB_ENV echo "TAG=check" >> $GITHUB_ENV
- name: Run build - name: Run build
run: | run: |
docker/build.py \ docker/build.py \
--tag "${TAG}" \ --tag "${TAG}" \
--arch "${{ matrix.arch }}" \ --arch "${{ matrix.arch }}" \
--build-type "${{ matrix.build_type }}" \ --build-type "${{ matrix.build_type }}" \
build build

View File

@ -1,5 +1,7 @@
---
name: CI name: CI
# yamllint disable-line rule:truthy
on: on:
push: push:
branches: [dev, beta, release] branches: [dev, beta, release]
@ -10,6 +12,7 @@ permissions:
contents: read contents: read
concurrency: concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true cancel-in-progress: true
@ -73,6 +76,8 @@ jobs:
name: Run script/clang-tidy for ESP32 IDF name: Run script/clang-tidy for ESP32 IDF
options: --environment esp32-idf-tidy --grep USE_ESP_IDF options: --environment esp32-idf-tidy --grep USE_ESP_IDF
pio_cache_key: tidyesp32-idf pio_cache_key: tidyesp32-idf
- id: yamllint
name: Run yamllint
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -80,17 +85,19 @@ jobs:
uses: actions/setup-python@v4 uses: actions/setup-python@v4
id: python id: python
with: with:
python-version: '3.8' python-version: "3.8"
- name: Cache virtualenv - name: Cache virtualenv
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: .venv path: .venv
# yamllint disable-line rule:line-length
key: venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }} key: venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }}
restore-keys: | restore-keys: |
venv-${{ steps.python.outputs.python-version }}- venv-${{ steps.python.outputs.python-version }}-
- name: Set up virtualenv - name: Set up virtualenv
# yamllint disable rule:line-length
run: | run: |
python -m venv .venv python -m venv .venv
source .venv/bin/activate source .venv/bin/activate
@ -99,12 +106,14 @@ jobs:
pip install -e . pip install -e .
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
# yamllint enable rule:line-length
# Use per check platformio cache because checks use different parts # Use per check platformio cache because checks use different parts
- name: Cache platformio - name: Cache platformio
uses: actions/cache@v3 uses: actions/cache@v3
with: with:
path: ~/.platformio path: ~/.platformio
# yamllint disable-line rule:line-length
key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }} key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }}
if: matrix.id == 'test' || matrix.id == 'clang-tidy' if: matrix.id == 'test' || matrix.id == 'clang-tidy'
@ -145,8 +154,9 @@ jobs:
pytest -vv --tb=native tests pytest -vv --tb=native tests
if: matrix.id == 'pytest' if: matrix.id == 'pytest'
# Also run git-diff-index so that the step is marked as failed on formatting errors, # Also run git-diff-index so that the step is marked as failed on
# since clang-format doesn't do anything but change files if -i is passed. # formatting errors, since clang-format doesn't do anything but
# change files if -i is passed.
- name: Run clang-format - name: Run clang-format
run: | run: |
script/clang-format -i script/clang-format -i
@ -161,6 +171,11 @@ jobs:
# Also cache libdeps, store them in a ~/.platformio subfolder # Also cache libdeps, store them in a ~/.platformio subfolder
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
- name: Run yamllint
if: matrix.id == 'yamllint'
uses: frenck/action-yamllint@v1.2.0
- name: Suggested changes - name: Suggested changes
run: script/ci-suggest-changes run: script/ci-suggest-changes
# yamllint disable-line rule:line-length
if: always() && (matrix.id == 'clang-tidy' || matrix.id == 'clang-format' || matrix.id == 'lint-python') if: always() && (matrix.id == 'clang-tidy' || matrix.id == 'clang-format' || matrix.id == 'lint-python')

View File

@ -1,8 +1,10 @@
---
name: Lock name: Lock
# yamllint disable-line rule:truthy
on: on:
schedule: schedule:
- cron: '30 0 * * *' - cron: "30 0 * * *"
workflow_dispatch: workflow_dispatch:
permissions: permissions:

View File

@ -1,5 +1,7 @@
---
name: Publish Release name: Publish Release
# yamllint disable-line rule:truthy
on: on:
workflow_dispatch: workflow_dispatch:
release: release:
@ -20,6 +22,7 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Get tag - name: Get tag
id: tag id: tag
# yamllint disable rule:line-length
run: | run: |
if [[ "$GITHUB_EVENT_NAME" = "release" ]]; then if [[ "$GITHUB_EVENT_NAME" = "release" ]]; then
TAG="${GITHUB_REF#refs/tags/}" TAG="${GITHUB_REF#refs/tags/}"
@ -29,6 +32,7 @@ jobs:
TAG="${TAG}${today}" TAG="${TAG}${today}"
fi fi
echo "::set-output name=tag::${TAG}" echo "::set-output name=tag::${TAG}"
# yamllint enable rule:line-length
deploy-pypi: deploy-pypi:
name: Build and publish to PyPi name: Build and publish to PyPi
@ -39,7 +43,7 @@ jobs:
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.x' python-version: "3.x"
- name: Set up python environment - name: Set up python environment
run: | run: |
script/setup script/setup
@ -65,37 +69,37 @@ jobs:
arch: [amd64, armv7, aarch64] arch: [amd64, armv7, aarch64]
build_type: ["ha-addon", "docker", "lint"] build_type: ["ha-addon", "docker", "lint"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.9' python-version: "3.9"
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2 uses: docker/setup-buildx-action@v2
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v2 uses: docker/setup-qemu-action@v2
- name: Log in to docker hub - name: Log in to docker hub
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub container registry - name: Log in to the GitHub container registry
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push - name: Build and push
run: | run: |
docker/build.py \ docker/build.py \
--tag "${{ needs.init.outputs.tag }}" \ --tag "${{ needs.init.outputs.tag }}" \
--arch "${{ matrix.arch }}" \ --arch "${{ matrix.arch }}" \
--build-type "${{ matrix.build_type }}" \ --build-type "${{ matrix.build_type }}" \
build \ build \
--push --push
deploy-docker-manifest: deploy-docker-manifest:
if: github.repository == 'esphome/esphome' if: github.repository == 'esphome/esphome'
@ -108,34 +112,34 @@ jobs:
matrix: matrix:
build_type: ["ha-addon", "docker", "lint"] build_type: ["ha-addon", "docker", "lint"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v4 uses: actions/setup-python@v4
with: with:
python-version: '3.9' python-version: "3.9"
- name: Enable experimental manifest support - name: Enable experimental manifest support
run: | run: |
mkdir -p ~/.docker mkdir -p ~/.docker
echo "{\"experimental\": \"enabled\"}" > ~/.docker/config.json echo "{\"experimental\": \"enabled\"}" > ~/.docker/config.json
- name: Log in to docker hub - name: Log in to docker hub
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKER_USER }} username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }} password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub container registry - name: Log in to the GitHub container registry
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Run manifest - name: Run manifest
run: | run: |
docker/build.py \ docker/build.py \
--tag "${{ needs.init.outputs.tag }}" \ --tag "${{ needs.init.outputs.tag }}" \
--build-type "${{ matrix.build_type }}" \ --build-type "${{ matrix.build_type }}" \
manifest manifest
deploy-ha-addon-repo: deploy-ha-addon-repo:
if: github.repository == 'esphome/esphome' && github.event_name == 'release' if: github.repository == 'esphome/esphome' && github.event_name == 'release'
@ -144,6 +148,7 @@ jobs:
steps: steps:
- env: - env:
TOKEN: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }} TOKEN: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }}
# yamllint disable rule:line-length
run: | run: |
TAG="${GITHUB_REF#refs/tags/}" TAG="${GITHUB_REF#refs/tags/}"
curl \ curl \
@ -152,3 +157,4 @@ jobs:
-H "Accept: application/vnd.github.v3+json" \ -H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/esphome/home-assistant-addon/actions/workflows/bump-version.yml/dispatches \ https://api.github.com/repos/esphome/home-assistant-addon/actions/workflows/bump-version.yml/dispatches \
-d "{\"ref\":\"main\",\"inputs\":{\"version\":\"$TAG\"}}" -d "{\"ref\":\"main\",\"inputs\":{\"version\":\"$TAG\"}}"
# yamllint enable rule:line-length

View File

@ -1,8 +1,10 @@
---
name: Stale name: Stale
# yamllint disable-line rule:truthy
on: on:
schedule: schedule:
- cron: '30 0 * * *' - cron: "30 0 * * *"
workflow_dispatch: workflow_dispatch:
permissions: permissions:
@ -31,7 +33,8 @@ jobs:
and will be closed if no further activity occurs within 7 days. and will be closed if no further activity occurs within 7 days.
Thank you for your contributions. Thank you for your contributions.
# Use stale to automatically close issues with a reference to the issue tracker # Use stale to automatically close issues with a
# reference to the issue tracker
close-issues: close-issues:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:

View File

@ -1,6 +1,8 @@
---
ports: ports:
- port: 6052 - port: 6052
onOpen: open-preview onOpen: open-preview
tasks: tasks:
- before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup # yamllint disable-line rule:line-length
command: python -m esphome dashboard config - before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup
command: python -m esphome dashboard config

View File

@ -1,14 +1,15 @@
---
# See https://pre-commit.com for more information # See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks # See https://pre-commit.com/hooks.html for more hooks
repos: repos:
- repo: https://github.com/ambv/black - repo: https://github.com/ambv/black
rev: 22.6.0 rev: 22.6.0
hooks: hooks:
- id: black - id: black
args: args:
- --safe - --safe
- --quiet - --quiet
files: ^((esphome|script|tests)/.+)?[^/]+\.py$ files: ^((esphome|script|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8 - repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1 rev: 4.0.1
hooks: hooks:

3
.yamllint Normal file
View File

@ -0,0 +1,3 @@
---
ignore: |
venv/

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP8266 platform: ESP8266
@ -6,13 +7,13 @@ esphome:
binary_sensor: binary_sensor:
- platform: gpio - platform: gpio
id: bs_1 id: bs_1
name: "test bs1" name: test bs1
internal: true internal: true
pin: pin:
number: D0 number: D0
- platform: gpio - platform: gpio
id: bs_2 id: bs_2
name: "test bs2" name: test bs2
internal: false internal: false
pin: pin:
number: D1 number: D1

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP8266 platform: ESP8266

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP32 platform: ESP32

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP32 platform: ESP32

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: test name: test
platform: ESP8266 platform: ESP8266
@ -7,6 +8,6 @@ sensor:
- platform: adc - platform: adc
pin: A0 pin: A0
id: s_1 id: s_1
name: "test s1" name: test s1
update_interval: 60s update_interval: 60s
device_class: "voltage" device_class: voltage

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: $devicename name: $devicename
platform: ESP32 platform: ESP32
@ -28,7 +29,7 @@ api:
i2c: i2c:
sda: 21 sda: 21
scl: 22 scl: 22
scan: False scan: false
spi: spi:
clk_pin: GPIO21 clk_pin: GPIO21
@ -47,7 +48,7 @@ uart:
- lambda: UARTDebug::log_hex(direction, bytes, ':'); - lambda: UARTDebug::log_hex(direction, bytes, ':');
ota: ota:
safe_mode: True safe_mode: true
port: 3286 port: 3286
num_attempts: 15 num_attempts: 15
@ -67,7 +68,7 @@ as3935_i2c:
irq_pin: GPIO12 irq_pin: GPIO12
mcp3008: mcp3008:
- id: 'mcp3008_hub' - id: mcp3008_hub
cs_pin: GPIO12 cs_pin: GPIO12
output: output:
@ -86,35 +87,35 @@ sensor:
id: ha_hello_world_temperature id: ha_hello_world_temperature
- platform: ble_rssi - platform: ble_rssi
mac_address: AC:37:43:77:5F:4C mac_address: AC:37:43:77:5F:4C
name: 'BLE Google Home Mini RSSI value' name: BLE Google Home Mini RSSI value
- platform: ble_rssi - platform: ble_rssi
service_uuid: '11aa' service_uuid: 11aa
name: 'BLE Test Service 16' name: BLE Test Service 16
- platform: ble_rssi - platform: ble_rssi
service_uuid: '11223344' service_uuid: "11223344"
name: 'BLE Test Service 32' name: BLE Test Service 32
- platform: ble_rssi - platform: ble_rssi
service_uuid: '11223344-5566-7788-99aa-bbccddeeff00' service_uuid: 11223344-5566-7788-99aa-bbccddeeff00
name: 'BLE Test Service 128' name: BLE Test Service 128
- platform: ble_rssi - platform: ble_rssi
service_uuid: '11223344-5566-7788-99aa-bbccddeeff00' service_uuid: 11223344-5566-7788-99aa-bbccddeeff00
name: 'BLE Test iBeacon UUID' name: BLE Test iBeacon UUID
- platform: b_parasite - platform: b_parasite
mac_address: F0:CA:F0:CA:01:01 mac_address: F0:CA:F0:CA:01:01
humidity: humidity:
name: 'b-parasite Air Humidity' name: b-parasite Air Humidity
temperature: temperature:
name: 'b-parasite Air Temperature' name: b-parasite Air Temperature
moisture: moisture:
name: 'b-parasite Soil Moisture' name: b-parasite Soil Moisture
battery_voltage: battery_voltage:
name: 'b-parasite Battery Voltage' name: b-parasite Battery Voltage
illuminance: illuminance:
name: 'b-parasite Illuminance' name: b-parasite Illuminance
- platform: senseair - platform: senseair
id: senseair0 id: senseair0
co2: co2:
name: 'SenseAir CO2 Value' name: SenseAir CO2 Value
on_value: on_value:
then: then:
- senseair.background_calibration: senseair0 - senseair.background_calibration: senseair0
@ -126,167 +127,167 @@ sensor:
- platform: ruuvitag - platform: ruuvitag
mac_address: FF:56:D3:2F:7D:E8 mac_address: FF:56:D3:2F:7D:E8
humidity: humidity:
name: 'RuuviTag Humidity' name: RuuviTag Humidity
temperature: temperature:
name: 'RuuviTag Temperature' name: RuuviTag Temperature
pressure: pressure:
name: 'RuuviTag Pressure' name: RuuviTag Pressure
acceleration_x: acceleration_x:
name: 'RuuviTag Acceleration X' name: RuuviTag Acceleration X
acceleration_y: acceleration_y:
name: 'RuuviTag Acceleration Y' name: RuuviTag Acceleration Y
acceleration_z: acceleration_z:
name: 'RuuviTag Acceleration Z' name: RuuviTag Acceleration Z
battery_voltage: battery_voltage:
name: 'RuuviTag Battery Voltage' name: RuuviTag Battery Voltage
tx_power: tx_power:
name: 'RuuviTag TX Power' name: RuuviTag TX Power
movement_counter: movement_counter:
name: 'RuuviTag Movement Counter' name: RuuviTag Movement Counter
measurement_sequence_number: measurement_sequence_number:
name: 'RuuviTag Measurement Sequence Number' name: RuuviTag Measurement Sequence Number
- platform: as3935 - platform: as3935
lightning_energy: lightning_energy:
name: 'Lightning Energy' name: Lightning Energy
distance: distance:
name: 'Distance Storm' name: Distance Storm
- platform: xiaomi_hhccjcy01 - platform: xiaomi_hhccjcy01
mac_address: 94:2B:FF:5C:91:61 mac_address: 94:2B:FF:5C:91:61
temperature: temperature:
name: 'Xiaomi HHCCJCY01 Temperature' name: Xiaomi HHCCJCY01 Temperature
moisture: moisture:
name: 'Xiaomi HHCCJCY01 Moisture' name: Xiaomi HHCCJCY01 Moisture
illuminance: illuminance:
name: 'Xiaomi HHCCJCY01 Illuminance' name: Xiaomi HHCCJCY01 Illuminance
conductivity: conductivity:
name: 'Xiaomi HHCCJCY01 Soil Conductivity' name: Xiaomi HHCCJCY01 Soil Conductivity
battery_level: battery_level:
name: 'Xiaomi HHCCJCY01 Battery Level' name: Xiaomi HHCCJCY01 Battery Level
- platform: xiaomi_lywsdcgq - platform: xiaomi_lywsdcgq
mac_address: 7A:80:8E:19:36:BA mac_address: 7A:80:8E:19:36:BA
temperature: temperature:
name: 'Xiaomi LYWSDCGQ Temperature' name: Xiaomi LYWSDCGQ Temperature
humidity: humidity:
name: 'Xiaomi LYWSDCGQ Humidity' name: Xiaomi LYWSDCGQ Humidity
battery_level: battery_level:
name: 'Xiaomi LYWSDCGQ Battery Level' name: Xiaomi LYWSDCGQ Battery Level
- platform: xiaomi_lywsd02 - platform: xiaomi_lywsd02
mac_address: 3F:5B:7D:82:58:4E mac_address: 3F:5B:7D:82:58:4E
temperature: temperature:
name: 'Xiaomi LYWSD02 Temperature' name: Xiaomi LYWSD02 Temperature
humidity: humidity:
name: 'Xiaomi LYWSD02 Humidity' name: Xiaomi LYWSD02 Humidity
battery_level: battery_level:
name: 'Xiaomi LYWSD02 Battery Level' name: Xiaomi LYWSD02 Battery Level
- platform: xiaomi_cgg1 - platform: xiaomi_cgg1
mac_address: 7A:80:8E:19:36:BA mac_address: 7A:80:8E:19:36:BA
temperature: temperature:
name: 'Xiaomi CGG1 Temperature' name: Xiaomi CGG1 Temperature
humidity: humidity:
name: 'Xiaomi CGG1 Humidity' name: Xiaomi CGG1 Humidity
battery_level: battery_level:
name: 'Xiaomi CGG1 Battery Level' name: Xiaomi CGG1 Battery Level
- platform: xiaomi_gcls002 - platform: xiaomi_gcls002
mac_address: '94:2B:FF:5C:91:61' mac_address: 94:2B:FF:5C:91:61
temperature: temperature:
name: 'GCLS02 Temperature' name: GCLS02 Temperature
moisture: moisture:
name: 'GCLS02 Moisture' name: GCLS02 Moisture
conductivity: conductivity:
name: 'GCLS02 Soil Conductivity' name: GCLS02 Soil Conductivity
illuminance: illuminance:
name: 'GCLS02 Illuminance' name: GCLS02 Illuminance
- platform: xiaomi_hhccpot002 - platform: xiaomi_hhccpot002
mac_address: '94:2B:FF:5C:91:61' mac_address: 94:2B:FF:5C:91:61
moisture: moisture:
name: 'HHCCPOT002 Moisture' name: HHCCPOT002 Moisture
conductivity: conductivity:
name: 'HHCCPOT002 Soil Conductivity' name: HHCCPOT002 Soil Conductivity
- platform: xiaomi_lywsd03mmc - platform: xiaomi_lywsd03mmc
mac_address: 'A4:C1:38:4E:16:78' mac_address: A4:C1:38:4E:16:78
bindkey: 'e9efaa6873f9f9c87a5e75a5f814801c' bindkey: e9efaa6873f9f9c87a5e75a5f814801c
temperature: temperature:
name: 'Xiaomi LYWSD03MMC Temperature' name: Xiaomi LYWSD03MMC Temperature
humidity: humidity:
name: 'Xiaomi LYWSD03MMC Humidity' name: Xiaomi LYWSD03MMC Humidity
battery_level: battery_level:
name: 'Xiaomi LYWSD03MMC Battery Level' name: Xiaomi LYWSD03MMC Battery Level
- platform: xiaomi_cgd1 - platform: xiaomi_cgd1
mac_address: 'A4:C1:38:D1:61:7D' mac_address: A4:C1:38:D1:61:7D
bindkey: 'c99d2313182473b38001086febf781bd' bindkey: c99d2313182473b38001086febf781bd
temperature: temperature:
name: 'Xiaomi CGD1 Temperature' name: Xiaomi CGD1 Temperature
humidity: humidity:
name: 'Xiaomi CGD1 Humidity' name: Xiaomi CGD1 Humidity
battery_level: battery_level:
name: 'Xiaomi CGD1 Battery Level' name: Xiaomi CGD1 Battery Level
- platform: xiaomi_jqjcy01ym - platform: xiaomi_jqjcy01ym
mac_address: '7A:80:8E:19:36:BA' mac_address: 7A:80:8E:19:36:BA
temperature: temperature:
name: 'JQJCY01YM Temperature' name: JQJCY01YM Temperature
humidity: humidity:
name: 'JQJCY01YM Humidity' name: JQJCY01YM Humidity
formaldehyde: formaldehyde:
name: 'JQJCY01YM Formaldehyde' name: JQJCY01YM Formaldehyde
battery_level: battery_level:
name: 'JQJCY01YM Battery Level' name: JQJCY01YM Battery Level
- platform: xiaomi_mhoc303 - platform: xiaomi_mhoc303
mac_address: 'E7:50:59:32:A0:1C' mac_address: E7:50:59:32:A0:1C
temperature: temperature:
name: 'MHO-C303 Temperature' name: MHO-C303 Temperature
humidity: humidity:
name: 'MHO-C303 Humidity' name: MHO-C303 Humidity
battery_level: battery_level:
name: 'MHO-C303 Battery Level' name: MHO-C303 Battery Level
- platform: atc_mithermometer - platform: atc_mithermometer
mac_address: 'A4:C1:38:4E:16:78' mac_address: A4:C1:38:4E:16:78
temperature: temperature:
name: 'ATC Temperature' name: ATC Temperature
humidity: humidity:
name: 'ATC Humidity' name: ATC Humidity
battery_level: battery_level:
name: 'ATC Battery-Level' name: ATC Battery-Level
battery_voltage: battery_voltage:
name: 'ATC Battery-Voltage' name: ATC Battery-Voltage
- platform: pvvx_mithermometer - platform: pvvx_mithermometer
mac_address: 'A4:C1:38:4E:16:78' mac_address: A4:C1:38:4E:16:78
temperature: temperature:
name: 'PVVX Temperature' name: PVVX Temperature
humidity: humidity:
name: 'PVVX Humidity' name: PVVX Humidity
battery_level: battery_level:
name: 'PVVX Battery-Level' name: PVVX Battery-Level
battery_voltage: battery_voltage:
name: 'PVVX Battery-Voltage' name: PVVX Battery-Voltage
- platform: inkbird_ibsth1_mini - platform: inkbird_ibsth1_mini
mac_address: 38:81:D7:0A:9C:11 mac_address: 38:81:D7:0A:9C:11
temperature: temperature:
name: 'Inkbird IBS-TH1 Temperature' name: Inkbird IBS-TH1 Temperature
humidity: humidity:
name: 'Inkbird IBS-TH1 Humidity' name: Inkbird IBS-TH1 Humidity
battery_level: battery_level:
name: 'Inkbird IBS-TH1 Battery Level' name: Inkbird IBS-TH1 Battery Level
- platform: xiaomi_rtcgq02lm - platform: xiaomi_rtcgq02lm
id: motion_rtcgq02lm id: motion_rtcgq02lm
battery_level: battery_level:
name: 'Mi Motion Sensor 2 Battery level' name: Mi Motion Sensor 2 Battery level
- platform: ltr390 - platform: ltr390
uv: uv:
name: "LTR390 UV" name: LTR390 UV
uv_index: uv_index:
name: "LTR390 UVI" name: LTR390 UVI
light: light:
name: "LTR390 Light" name: LTR390 Light
ambient_light: ambient_light:
name: "LTR390 ALS" name: LTR390 ALS
gain: "X3" gain: X3
resolution: 18 resolution: 18
window_correction_factor: 1.0 window_correction_factor: 1.0
address: 0x53 address: 0x53
update_interval: 60s update_interval: 60s
- platform: sgp4x - platform: sgp4x
voc: voc:
name: "VOC Index" name: VOC Index
id: sgp40_voc_index id: sgp40_voc_index
algorithm_tuning: algorithm_tuning:
index_offset: 100 index_offset: 100
@ -296,7 +297,7 @@ sensor:
std_initial: 50 std_initial: 50
gain_factor: 230 gain_factor: 230
nox: nox:
name: "NOx" name: NOx
algorithm_tuning: algorithm_tuning:
index_offset: 100 index_offset: 100
learning_time_offset_hours: 12 learning_time_offset_hours: 12
@ -307,7 +308,7 @@ sensor:
update_interval: 5s update_interval: 5s
- platform: mcp3008 - platform: mcp3008
update_interval: 5s update_interval: 5s
mcp3008_id: 'mcp3008_hub' mcp3008_id: mcp3008_hub
id: freezer_temp_source id: freezer_temp_source
reference_voltage: 3.19 reference_voltage: 3.19
number: 0 number: 0
@ -315,59 +316,59 @@ sensor:
ble_client_id: airthings01 ble_client_id: airthings01
update_interval: 5min update_interval: 5min
temperature: temperature:
name: "Wave Plus Temperature" name: Wave Plus Temperature
radon: radon:
name: "Wave Plus Radon" name: Wave Plus Radon
radon_long_term: radon_long_term:
name: "Wave Plus Radon Long Term" name: Wave Plus Radon Long Term
pressure: pressure:
name: "Wave Plus Pressure" name: Wave Plus Pressure
humidity: humidity:
name: "Wave Plus Humidity" name: Wave Plus Humidity
co2: co2:
name: "Wave Plus CO2" name: Wave Plus CO2
tvoc: tvoc:
name: "Wave Plus VOC" name: Wave Plus VOC
- platform: airthings_wave_mini - platform: airthings_wave_mini
ble_client_id: airthingsmini01 ble_client_id: airthingsmini01
update_interval: 5min update_interval: 5min
temperature: temperature:
name: "Wave Mini Temperature" name: Wave Mini Temperature
humidity: humidity:
name: "Wave Mini Humidity" name: Wave Mini Humidity
pressure: pressure:
name: "Wave Mini Pressure" name: Wave Mini Pressure
tvoc: tvoc:
name: "Wave Mini VOC" name: Wave Mini VOC
- platform: ina260 - platform: ina260
address: 0x40 address: 0x40
current: current:
name: "INA260 Current" name: INA260 Current
power: power:
name: "INA260 Power" name: INA260 Power
bus_voltage: bus_voltage:
name: "INA260 Voltage" name: INA260 Voltage
update_interval: 60s update_interval: 60s
- platform: radon_eye_rd200 - platform: radon_eye_rd200
ble_client_id: radon_eye_ble_id ble_client_id: radon_eye_ble_id
update_interval: 10min update_interval: 10min
radon: radon:
name: "RD200 Radon" name: RD200 Radon
radon_long_term: radon_long_term:
name: "RD200 Radon Long Term" name: RD200 Radon Long Term
- platform: mopeka_pro_check - platform: mopeka_pro_check
mac_address: D3:75:F2:DC:16:91 mac_address: D3:75:F2:DC:16:91
tank_type: CUSTOM tank_type: CUSTOM
custom_distance_full: 40cm custom_distance_full: 40cm
custom_distance_empty: 10mm custom_distance_empty: 10mm
temperature: temperature:
name: "Propane test temp" name: Propane test temp
level: level:
name: "Propane test level" name: Propane test level
distance: distance:
name: "Propane test distance" name: Propane test distance
battery_level: battery_level:
name: "Propane test battery level" name: Propane test battery level
time: time:
- platform: homeassistant - platform: homeassistant
@ -377,7 +378,7 @@ time:
- logger.log: It's 16:00 - logger.log: It's 16:00
esp32_touch: esp32_touch:
setup_mode: True setup_mode: true
binary_sensor: binary_sensor:
- platform: homeassistant - platform: homeassistant
@ -389,76 +390,80 @@ binary_sensor:
id: ha_hello_world_binary_attribute id: ha_hello_world_binary_attribute
- platform: ble_presence - platform: ble_presence
mac_address: AC:37:43:77:5F:4C mac_address: AC:37:43:77:5F:4C
name: 'ESP32 BLE Tracker Google Home Mini' name: ESP32 BLE Tracker Google Home Mini
- platform: ble_presence - platform: ble_presence
service_uuid: '11aa' service_uuid: 11aa
name: 'BLE Test Service 16 Presence' name: BLE Test Service 16 Presence
- platform: ble_presence - platform: ble_presence
service_uuid: '11223344' service_uuid: "11223344"
name: 'BLE Test Service 32 Presence' name: BLE Test Service 32 Presence
- platform: ble_presence - platform: ble_presence
service_uuid: '11223344-5566-7788-99aa-bbccddeeff00' service_uuid: 11223344-5566-7788-99aa-bbccddeeff00
name: 'BLE Test Service 128 Presence' name: BLE Test Service 128 Presence
- platform: ble_presence - platform: ble_presence
ibeacon_uuid: '11223344-5566-7788-99aa-bbccddeeff00' ibeacon_uuid: 11223344-5566-7788-99aa-bbccddeeff00
ibeacon_major: 100 ibeacon_major: 100
ibeacon_minor: 1 ibeacon_minor: 1
name: 'BLE Test iBeacon Presence' name: BLE Test iBeacon Presence
- platform: esp32_touch - platform: esp32_touch
name: 'ESP32 Touch Pad GPIO27' name: ESP32 Touch Pad GPIO27
pin: GPIO27 pin: GPIO27
threshold: 1000 threshold: 1000
- platform: as3935 - platform: as3935
name: 'Storm Alert' name: Storm Alert
- platform: xiaomi_mue4094rt - platform: xiaomi_mue4094rt
name: 'MUE4094RT Motion' name: MUE4094RT Motion
mac_address: '7A:80:8E:19:36:BA' mac_address: 7A:80:8E:19:36:BA
timeout: '5s' timeout: 5s
- platform: xiaomi_mjyd02yla - platform: xiaomi_mjyd02yla
name: 'MJYD02YL-A Motion' name: MJYD02YL-A Motion
mac_address: '50:EC:50:CD:32:02' mac_address: 50:EC:50:CD:32:02
bindkey: '48403ebe2d385db8d0c187f81e62cb64' bindkey: 48403ebe2d385db8d0c187f81e62cb64
idle_time: idle_time:
name: 'MJYD02YL-A Idle Time' name: MJYD02YL-A Idle Time
light: light:
name: 'MJYD02YL-A Light Status' name: MJYD02YL-A Light Status
battery_level: battery_level:
name: 'MJYD02YL-A Battery Level' name: MJYD02YL-A Battery Level
- platform: xiaomi_wx08zm - platform: xiaomi_wx08zm
name: 'WX08ZM Activation State' name: WX08ZM Activation State
mac_address: '74:a3:4a:b5:07:34' mac_address: 74:a3:4a:b5:07:34
tablet: tablet:
name: 'WX08ZM Tablet Resource' name: WX08ZM Tablet Resource
battery_level: battery_level:
name: 'WX08ZM Battery Level' name: WX08ZM Battery Level
- platform: xiaomi_cgpr1 - platform: xiaomi_cgpr1
name: 'CGPR1 Motion' name: CGPR1 Motion
mac_address: '12:34:56:12:34:56' mac_address: "12:34:56:12:34:56"
bindkey: '48403ebe2d385db8d0c187f81e62cb64' bindkey: 48403ebe2d385db8d0c187f81e62cb64
battery_level: battery_level:
name: 'CGPR1 battery Level' name: CGPR1 battery Level
idle_time: idle_time:
name: 'CGPR1 Idle Time' name: CGPR1 Idle Time
illuminance: illuminance:
name: 'CGPR1 Illuminance' name: CGPR1 Illuminance
- platform: xiaomi_rtcgq02lm - platform: xiaomi_rtcgq02lm
id: motion_rtcgq02lm id: motion_rtcgq02lm
motion: motion:
name: 'Mi Motion Sensor 2' name: Mi Motion Sensor 2
light: light:
name: 'Mi Motion Sensor 2 Light' name: Mi Motion Sensor 2 Light
button: button:
name: 'Mi Motion Sensor 2 Button' name: Mi Motion Sensor 2 Button
esp32_ble_tracker: esp32_ble_tracker:
on_ble_advertise: on_ble_advertise:
- mac_address: AC:37:43:77:5F:4C - mac_address: AC:37:43:77:5F:4C
then: then:
# yamllint disable rule:line-length
- lambda: !lambda |- - lambda: !lambda |-
ESP_LOGD("main", "The device address is %s", x.address_str().c_str()); ESP_LOGD("main", "The device address is %s", x.address_str().c_str());
# yamllint enable rule:line-length
- then: - then:
# yamllint disable rule:line-length
- lambda: !lambda |- - lambda: !lambda |-
ESP_LOGD("main", "The device address is %s", x.address_str().c_str()); ESP_LOGD("main", "The device address is %s", x.address_str().c_str());
# yamllint enable rule:line-length
on_ble_service_data_advertise: on_ble_service_data_advertise:
- service_uuid: ABCD - service_uuid: ABCD
then: then:
@ -494,16 +499,12 @@ xiaomi_rtcgq02lm:
mac_address: 01:02:03:04:05:06 mac_address: 01:02:03:04:05:06
bindkey: '48403ebe2d385db8d0c187f81e62cb64' bindkey: '48403ebe2d385db8d0c187f81e62cb64'
#esp32_ble_beacon:
# type: iBeacon
# uuid: 'c29ce823-e67a-4e71-bff2-abaa32e77a98'
status_led: status_led:
pin: GPIO2 pin: GPIO2
text_sensor: text_sensor:
- platform: version - platform: version
name: 'ESPHome Version' name: ESPHome Version
icon: mdi:icon icon: mdi:icon
id: version_sensor id: version_sensor
on_value: on_value:
@ -511,8 +512,10 @@ text_sensor:
condition: condition:
- api.connected: - api.connected:
then: then:
# yamllint disable rule:line-length
- lambda: !lambda |- - lambda: !lambda |-
ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str()); ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str());
# yamllint enable rule:line-length
- script.execute: my_script - script.execute: my_script
- homeassistant.service: - homeassistant.service:
service: notify.html5 service: notify.html5
@ -537,19 +540,19 @@ text_sensor:
- deep_sleep.enter: - deep_sleep.enter:
sleep_duration: !lambda "return 30 * 60 * 1000;" sleep_duration: !lambda "return 30 * 60 * 1000;"
- platform: template - platform: template
name: 'Template Text Sensor' name: Template Text Sensor
lambda: |- lambda: |-
return {"Hello World"}; return {"Hello World"};
filters: filters:
- to_upper: - to_upper:
- to_lower: - to_lower:
- append: "xyz" - append: xyz
- prepend: "abcd" - prepend: abcd
- substitute: - substitute:
- Hello -> Goodbye - Hello -> Goodbye
- map: - map:
- red -> green - red -> green
- lambda: return {"1234"}; - lambda: 'return {"1234"};'
- platform: homeassistant - platform: homeassistant
entity_id: sensor.hello_world2 entity_id: sensor.hello_world2
id: ha_hello_world2 id: ha_hello_world2
@ -587,7 +590,7 @@ stepper:
pin_b: GPIO27 pin_b: GPIO27
pin_c: GPIO25 pin_c: GPIO25
pin_d: GPIO26 pin_d: GPIO26
sleep_when_done: no sleep_when_done: false
step_mode: HALF_STEP step_mode: HALF_STEP
max_speed: 250 steps/s max_speed: 250 steps/s
@ -598,7 +601,7 @@ stepper:
interval: interval:
interval: 5s interval: 5s
then: then:
- logger.log: 'Interval Run' - logger.log: Interval Run
display: display:
@ -611,7 +614,7 @@ cap1188:
switch: switch:
- platform: template - platform: template
name: "Test BLE Write Action" name: Test BLE Write Action
turn_on_action: turn_on_action:
- ble_client.ble_write: - ble_client.ble_write:
id: airthings01 id: airthings01

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: $device_name name: $device_name
comment: $device_comment comment: $device_comment
@ -9,38 +10,38 @@ esphome:
- wifi.connected - wifi.connected
- time.has_time - time.has_time
then: then:
- logger.log: "Have time" - logger.log: Have time
includes: includes:
- custom.h - custom.h
esp8266: esp8266:
board: d1_mini board: d1_mini
early_pin_init: True early_pin_init: true
substitutions: substitutions:
device_name: test3 device_name: test3
device_comment: test3 device device_comment: test3 device
min_sub: '0.03' min_sub: "0.03"
max_sub: '12.0%' max_sub: "12.0%"
api: api:
port: 8000 port: 8000
password: 'pwd' password: pwd
reboot_timeout: 0min reboot_timeout: 0min
encryption: encryption:
key: 'bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=' key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
services: services:
- service: hello_world - service: hello_world
variables: variables:
name: string name: string
then: then:
- logger.log: - logger.log:
format: 'Hello World %s!' format: Hello World %s!
args: args:
- name.c_str() - name.c_str()
- service: empty_service - service: empty_service
then: then:
- logger.log: 'Service Called' - logger.log: Service Called
- service: all_types - service: all_types
variables: variables:
bool_: bool bool_: bool
@ -48,7 +49,7 @@ api:
float_: float float_: float
string_: string string_: string
then: then:
- logger.log: 'Something happened' - logger.log: Something happened
- stepper.set_target: - stepper.set_target:
id: my_stepper2 id: my_stepper2
target: !lambda 'return int_;' target: !lambda 'return int_;'
@ -60,7 +61,9 @@ api:
string_arr: string[] string_arr: string[]
then: then:
- logger.log: - logger.log:
# yamllint disable rule:line-length
format: 'Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)' format: 'Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)'
# yamllint enable rule:line-length
args: args:
- YESNO(bool_arr[0]) - YESNO(bool_arr[0])
- bool_arr.size() - bool_arr.size()
@ -104,7 +107,7 @@ api:
then: then:
- dfplayer.play_folder: - dfplayer.play_folder:
folder: !lambda 'return folder;' folder: !lambda 'return folder;'
loop: True loop: true
- service: dfplayer_set_device - service: dfplayer_set_device
variables: variables:
@ -122,7 +125,9 @@ api:
variables: variables:
preset: int preset: int
then: then:
# yamllint disable rule:line-length
- dfplayer.set_eq: !lambda 'return static_cast<dfplayer::EqPreset>(preset);' - dfplayer.set_eq: !lambda 'return static_cast<dfplayer::EqPreset>(preset);'
# yamllint enable rule:line-length
- service: dfplayer_sleep - service: dfplayer_sleep
then: then:
@ -220,7 +225,7 @@ wifi:
i2c: i2c:
sda: 4 sda: 4
scl: 5 scl: 5
scan: False scan: false
spi: spi:
clk_pin: GPIO12 clk_pin: GPIO12
@ -231,7 +236,7 @@ uart:
- id: uart1 - id: uart1
tx_pin: tx_pin:
number: GPIO1 number: GPIO1
inverted: yes inverted: true
rx_pin: GPIO3 rx_pin: GPIO3
baud_rate: 115200 baud_rate: 115200
- id: uart2 - id: uart2
@ -279,7 +284,7 @@ modbus:
uart_id: uart1 uart_id: uart1
ota: ota:
safe_mode: True safe_mode: true
port: 3286 port: 3286
reboot_timeout: 15min reboot_timeout: 15min
@ -302,40 +307,40 @@ adalight:
sensor: sensor:
- platform: daly_bms - platform: daly_bms
voltage: voltage:
name: "Battery Voltage" name: Battery Voltage
current: current:
name: "Battery Current" name: Battery Current
battery_level: battery_level:
name: "Battery Level" name: Battery Level
max_cell_voltage: max_cell_voltage:
name: "Max Cell Voltage" name: Max Cell Voltage
max_cell_voltage_number: max_cell_voltage_number:
name: "Max Cell Voltage Number" name: Max Cell Voltage Number
min_cell_voltage: min_cell_voltage:
name: "Min Cell Voltage" name: Min Cell Voltage
min_cell_voltage_number: min_cell_voltage_number:
name: "Min Cell Voltage Number" name: Min Cell Voltage Number
max_temperature: max_temperature:
name: "Max Temperature" name: Max Temperature
max_temperature_probe_number: max_temperature_probe_number:
name: "Max Temperature Probe Number" name: Max Temperature Probe Number
min_temperature: min_temperature:
name: "Min Temperature" name: Min Temperature
min_temperature_probe_number: min_temperature_probe_number:
name: "Min Temperature Probe Number" name: Min Temperature Probe Number
remaining_capacity: remaining_capacity:
name: "Remaining Capacity" name: Remaining Capacity
cells_number: cells_number:
name: "Cells Number" name: Cells Number
temperature_1: temperature_1:
name: "Temperature 1" name: Temperature 1
temperature_2: temperature_2:
name: "Temperature 2" name: Temperature 2
- platform: apds9960 - platform: apds9960
type: proximity type: proximity
name: APDS9960 Proximity name: APDS9960 Proximity
- platform: vl53l0x - platform: vl53l0x
name: 'VL53L0x Distance' name: VL53L0x Distance
address: 0x29 address: 0x29
update_interval: 60s update_interval: 60s
enable_pin: GPIO13 enable_pin: GPIO13
@ -357,32 +362,32 @@ sensor:
id: ha_hello_world id: ha_hello_world
- platform: aht10 - platform: aht10
temperature: temperature:
name: 'Temperature' name: Temperature
humidity: humidity:
name: 'Humidity' name: Humidity
- platform: am2320 - platform: am2320
temperature: temperature:
name: 'Temperature' name: Temperature
humidity: humidity:
name: 'Humidity' name: Humidity
- platform: hydreon_rgxx - platform: hydreon_rgxx
model: "RG 9" model: RG 9
uart_id: uart6 uart_id: uart6
id: "hydreon_rg9" id: hydreon_rg9
moisture: moisture:
name: "hydreon_rain" name: hydreon_rain
id: hydreon_rain id: hydreon_rain
- platform: hydreon_rgxx - platform: hydreon_rgxx
model: "RG_15" model: RG_15
uart_id: uart6 uart_id: uart6
acc: acc:
name: "hydreon_acc" name: hydreon_acc
event_acc: event_acc:
name: "hydreon_event_acc" name: hydreon_event_acc
total_acc: total_acc:
name: "hydreon_total_acc" name: hydreon_total_acc
r_int: r_int:
name: "hydreon_r_int" name: hydreon_r_int
- platform: adc - platform: adc
pin: VCC pin: VCC
id: my_sensor id: my_sensor
@ -496,281 +501,281 @@ sensor:
- platform: bl0939 - platform: bl0939
uart_id: uart8 uart_id: uart8
voltage: voltage:
name: 'BL0939 Voltage' name: BL0939 Voltage
current_1: current_1:
name: 'BL0939 Current 1' name: BL0939 Current 1
current_2: current_2:
name: 'BL0939 Current 2' name: BL0939 Current 2
active_power_1: active_power_1:
name: 'BL0939 Active Power 1' name: BL0939 Active Power 1
active_power_2: active_power_2:
name: 'BL0939 Active Power 2' name: BL0939 Active Power 2
energy_1: energy_1:
name: 'BL0939 Energy 1' name: BL0939 Energy 1
energy_2: energy_2:
name: 'BL0939 Energy 2' name: BL0939 Energy 2
energy_total: energy_total:
name: 'BL0939 Total energy' name: BL0939 Total energy
- platform: bl0940 - platform: bl0940
uart_id: uart3 uart_id: uart3
voltage: voltage:
name: 'BL0940 Voltage' name: BL0940 Voltage
current: current:
name: 'BL0940 Current' name: BL0940 Current
power: power:
name: 'BL0940 Power' name: BL0940 Power
energy: energy:
name: 'BL0940 Energy' name: BL0940 Energy
internal_temperature: internal_temperature:
name: 'BL0940 Internal temperature' name: BL0940 Internal temperature
external_temperature: external_temperature:
name: 'BL0940 External temperature' name: BL0940 External temperature
- platform: pzem004t - platform: pzem004t
uart_id: uart3 uart_id: uart3
voltage: voltage:
name: 'PZEM004T Voltage' name: PZEM004T Voltage
current: current:
name: 'PZEM004T Current' name: PZEM004T Current
power: power:
name: 'PZEM004T Power' name: PZEM004T Power
- platform: pzemac - platform: pzemac
id: pzemac1 id: pzemac1
voltage: voltage:
name: 'PZEMAC Voltage' name: PZEMAC Voltage
current: current:
name: 'PZEMAC Current' name: PZEMAC Current
power: power:
name: 'PZEMAC Power' name: PZEMAC Power
energy: energy:
name: 'PZEMAC Energy' name: PZEMAC Energy
frequency: frequency:
name: 'PZEMAC Frequency' name: PZEMAC Frequency
power_factor: power_factor:
name: 'PZEMAC Power Factor' name: PZEMAC Power Factor
- platform: pzemdc - platform: pzemdc
voltage: voltage:
name: 'PZEMDC Voltage' name: PZEMDC Voltage
current: current:
name: 'PZEMDC Current' name: PZEMDC Current
power: power:
name: 'PZEMDC Power' name: PZEMDC Power
- platform: tmp102 - platform: tmp102
name: 'TMP102 Temperature' name: TMP102 Temperature
- platform: hm3301 - platform: hm3301
pm_1_0: pm_1_0:
name: 'PM1.0' name: PM1.0
pm_2_5: pm_2_5:
name: 'PM2.5' name: PM2.5
pm_10_0: pm_10_0:
name: 'PM10.0' name: PM10.0
aqi: aqi:
name: 'AQI' name: AQI
calculation_type: 'AQI' calculation_type: AQI
- platform: pmsx003 - platform: pmsx003
uart_id: uart9 uart_id: uart9
type: PMSX003 type: PMSX003
pm_1_0: pm_1_0:
name: 'PM 1.0 Concentration' name: PM 1.0 Concentration
pm_2_5: pm_2_5:
name: 'PM 2.5 Concentration' name: PM 2.5 Concentration
pm_10_0: pm_10_0:
name: 'PM 10.0 Concentration' name: PM 10.0 Concentration
pm_1_0_std: pm_1_0_std:
name: 'PM 1.0 Standard Atmospher Concentration' name: PM 1.0 Standard Atmospher Concentration
pm_2_5_std: pm_2_5_std:
name: 'PM 2.5 Standard Atmospher Concentration' name: PM 2.5 Standard Atmospher Concentration
pm_10_0_std: pm_10_0_std:
name: 'PM 10.0 Standard Atmospher Concentration' name: PM 10.0 Standard Atmospher Concentration
pm_0_3um: pm_0_3um:
name: 'Particulate Count >0.3um' name: Particulate Count >0.3um
pm_0_5um: pm_0_5um:
name: 'Particulate Count >0.5um' name: Particulate Count >0.5um
pm_1_0um: pm_1_0um:
name: 'Particulate Count >1.0um' name: Particulate Count >1.0um
pm_2_5um: pm_2_5um:
name: 'Particulate Count >2.5um' name: Particulate Count >2.5um
pm_5_0um: pm_5_0um:
name: 'Particulate Count >5.0um' name: Particulate Count >5.0um
pm_10_0um: pm_10_0um:
name: 'Particulate Count >10.0um' name: Particulate Count >10.0um
update_interval: 30s update_interval: 30s
- platform: pmsx003 - platform: pmsx003
uart_id: uart5 uart_id: uart5
type: PMS5003T type: PMS5003T
pm_2_5: pm_2_5:
name: 'PM 2.5 Concentration' name: PM 2.5 Concentration
temperature: temperature:
name: 'PMS Temperature' name: PMS Temperature
humidity: humidity:
name: 'PMS Humidity' name: PMS Humidity
- platform: pmsx003 - platform: pmsx003
uart_id: uart6 uart_id: uart6
type: PMS5003ST type: PMS5003ST
pm_1_0: pm_1_0:
name: 'PM 1.0 Concentration' name: PM 1.0 Concentration
pm_2_5: pm_2_5:
name: 'PM 2.5 Concentration' name: PM 2.5 Concentration
pm_10_0: pm_10_0:
name: 'PM 10.0 Concentration' name: PM 10.0 Concentration
pm_1_0_std: pm_1_0_std:
name: 'PM 1.0 Standard Atmospher Concentration' name: PM 1.0 Standard Atmospher Concentration
pm_2_5_std: pm_2_5_std:
name: 'PM 2.5 Standard Atmospher Concentration' name: PM 2.5 Standard Atmospher Concentration
pm_10_0_std: pm_10_0_std:
name: 'PM 10.0 Standard Atmospher Concentration' name: PM 10.0 Standard Atmospher Concentration
pm_0_3um: pm_0_3um:
name: 'Particulate Count >0.3um' name: Particulate Count >0.3um
pm_0_5um: pm_0_5um:
name: 'Particulate Count >0.5um' name: Particulate Count >0.5um
pm_1_0um: pm_1_0um:
name: 'Particulate Count >1.0um' name: Particulate Count >1.0um
pm_2_5um: pm_2_5um:
name: 'Particulate Count >2.5um' name: Particulate Count >2.5um
pm_5_0um: pm_5_0um:
name: 'Particulate Count >5.0um' name: Particulate Count >5.0um
pm_10_0um: pm_10_0um:
name: 'Particulate Count >10.0um' name: Particulate Count >10.0um
temperature: temperature:
name: 'PMS Temperature' name: PMS Temperature
humidity: humidity:
name: 'PMS Humidity' name: PMS Humidity
formaldehyde: formaldehyde:
name: 'PMS Formaldehyde Concentration' name: PMS Formaldehyde Concentration
- platform: cse7761 - platform: cse7761
uart_id: uart7 uart_id: uart7
voltage: voltage:
name: 'CSE7761 Voltage' name: CSE7761 Voltage
current_1: current_1:
name: 'CSE7761 Current 1' name: CSE7761 Current 1
current_2: current_2:
name: 'CSE7761 Current 2' name: CSE7761 Current 2
active_power_1: active_power_1:
name: 'CSE7761 Active Power 1' name: CSE7761 Active Power 1
active_power_2: active_power_2:
name: 'CSE7761 Active Power 2' name: CSE7761 Active Power 2
- platform: cse7766 - platform: cse7766
uart_id: uart3 uart_id: uart3
voltage: voltage:
name: 'CSE7766 Voltage' name: CSE7766 Voltage
current: current:
name: 'CSE7766 Current' name: CSE7766 Current
power: power:
name: 'CSE776 Power' name: CSE776 Power
- platform: ezo - platform: ezo
id: ph_ezo id: ph_ezo
address: 99 address: 99
unit_of_measurement: 'pH' unit_of_measurement: pH
- platform: tof10120 - platform: tof10120
name: "Distance sensor" name: Distance sensor
update_interval: 5s update_interval: 5s
- platform: fingerprint_grow - platform: fingerprint_grow
fingerprint_count: fingerprint_count:
name: "Fingerprint Count" name: Fingerprint Count
status: status:
name: "Fingerprint Status" name: Fingerprint Status
capacity: capacity:
name: "Fingerprint Capacity" name: Fingerprint Capacity
security_level: security_level:
name: "Fingerprint Security Level" name: Fingerprint Security Level
last_finger_id: last_finger_id:
name: "Fingerprint Last Finger ID" name: Fingerprint Last Finger ID
last_confidence: last_confidence:
name: "Fingerprint Last Confidence" name: Fingerprint Last Confidence
- platform: sdm_meter - platform: sdm_meter
phase_a: phase_a:
current: current:
name: 'Phase A Current' name: Phase A Current
voltage: voltage:
name: 'Phase A Voltage' name: Phase A Voltage
active_power: active_power:
name: 'Phase A Power' name: Phase A Power
power_factor: power_factor:
name: 'Phase A Power Factor' name: Phase A Power Factor
apparent_power: apparent_power:
name: 'Phase A Apparent Power' name: Phase A Apparent Power
reactive_power: reactive_power:
name: 'Phase A Reactive Power' name: Phase A Reactive Power
phase_angle: phase_angle:
name: 'Phase A Phase Angle' name: Phase A Phase Angle
phase_b: phase_b:
current: current:
name: 'Phase B Current' name: Phase B Current
voltage: voltage:
name: 'Phase B Voltage' name: Phase B Voltage
active_power: active_power:
name: 'Phase B Power' name: Phase B Power
power_factor: power_factor:
name: 'Phase B Power Factor' name: Phase B Power Factor
apparent_power: apparent_power:
name: 'Phase B Apparent Power' name: Phase B Apparent Power
reactive_power: reactive_power:
name: 'Phase B Reactive Power' name: Phase B Reactive Power
phase_angle: phase_angle:
name: 'Phase B Phase Angle' name: Phase B Phase Angle
phase_c: phase_c:
current: current:
name: 'Phase C Current' name: Phase C Current
voltage: voltage:
name: 'Phase C Voltage' name: Phase C Voltage
active_power: active_power:
name: 'Phase C Power' name: Phase C Power
power_factor: power_factor:
name: 'Phase C Power Factor' name: Phase C Power Factor
apparent_power: apparent_power:
name: 'Phase C Apparent Power' name: Phase C Apparent Power
reactive_power: reactive_power:
name: 'Phase C Reactive Power' name: Phase C Reactive Power
phase_angle: phase_angle:
name: 'Phase C Phase Angle' name: Phase C Phase Angle
frequency: frequency:
name: 'Frequency' name: Frequency
import_active_energy: import_active_energy:
name: 'Import Active Energy' name: Import Active Energy
export_active_energy: export_active_energy:
name: 'Export Active Energy' name: Export Active Energy
import_reactive_energy: import_reactive_energy:
name: 'Import Reactive Energy' name: Import Reactive Energy
export_reactive_energy: export_reactive_energy:
name: 'Export Reactive Energy' name: Export Reactive Energy
- platform: dsmr - platform: dsmr
energy_delivered_tariff1: energy_delivered_tariff1:
name: dsmr_energy_delivered_tariff1 name: dsmr_energy_delivered_tariff1
- platform: nextion - platform: nextion
id: testnumber id: testnumber
name: 'testnumber' name: testnumber
variable_name: testnumber variable_name: testnumber
- platform: nextion - platform: nextion
id: testwave id: testwave
name: 'testwave' name: testwave
component_id: 2 component_id: 2
wave_channel_id: 1 wave_channel_id: 1
- platform: mlx90393 - platform: mlx90393
oversampling: 1 oversampling: 1
filter: 0 filter: 0
gain: "3X" gain: 3X
x_axis: x_axis:
name: "mlxxaxis" name: mlxxaxis
y_axis: y_axis:
name: "mlxyaxis" name: mlxyaxis
z_axis: z_axis:
name: "mlxzaxis" name: mlxzaxis
resolution: 17BIT resolution: 17BIT
temperature: temperature:
name: "mlxtemp" name: mlxtemp
oversampling: 2 oversampling: 2
- platform: smt100 - platform: smt100
uart_id: uart10 uart_id: uart10
counts: counts:
name: "Counts" name: Counts
dielectric_constant: dielectric_constant:
name: "Dielectric Constant" name: Dielectric Constant
temperature: temperature:
name: "Temperature" name: Temperature
moisture: moisture:
name: "Moisture" name: Moisture
voltage: voltage:
name: "Voltage" name: Voltage
update_interval: 60s update_interval: 60s
time: time:
- platform: homeassistant - platform: homeassistant
@ -786,9 +791,9 @@ mpr121:
binary_sensor: binary_sensor:
- platform: daly_bms - platform: daly_bms
charging_mos_enabled: charging_mos_enabled:
name: "Charging MOS" name: Charging MOS
discharging_mos_enabled: discharging_mos_enabled:
name: "Discharging MOS" name: Discharging MOS
- platform: apds9960 - platform: apds9960
direction: up direction: up
name: APDS9960 Up name: APDS9960 Up
@ -816,18 +821,18 @@ binary_sensor:
- platform: mpr121 - platform: mpr121
id: touchkey0 id: touchkey0
channel: 0 channel: 0
name: 'touchkey0' name: touchkey0
- platform: mpr121 - platform: mpr121
channel: 1 channel: 1
name: 'touchkey1' name: touchkey1
id: bin1 id: bin1
- platform: mpr121 - platform: mpr121
channel: 2 channel: 2
name: 'touchkey2' name: touchkey2
id: bin2 id: bin2
- platform: mpr121 - platform: mpr121
channel: 3 channel: 3
name: 'touchkey3' name: touchkey3
id: bin3 id: bin3
on_press: on_press:
then: then:
@ -839,7 +844,7 @@ binary_sensor:
channel: 1 channel: 1
name: TTP229 BSF Test name: TTP229 BSF Test
- platform: fingerprint_grow - platform: fingerprint_grow
name: "Fingerprint Enrolling" name: Fingerprint Enrolling
- platform: custom - platform: custom
lambda: |- lambda: |-
auto s = new CustomBinarySensor(); auto s = new CustomBinarySensor();
@ -851,27 +856,27 @@ binary_sensor:
- platform: nextion - platform: nextion
page_id: 0 page_id: 0
component_id: 2 component_id: 2
name: 'Nextion Component 2 Touch' name: Nextion Component 2 Touch
- platform: nextion - platform: nextion
id: r0_sensor id: r0_sensor
name: 'R0 Sensor' name: R0 Sensor
component_name: page0.r0 component_name: page0.r0
- platform: template - platform: template
id: 'cover_toggle' id: cover_toggle
on_press: on_press:
then: then:
- cover.toggle: time_based_cover - cover.toggle: time_based_cover
- cover.toggle: endstop_cover - cover.toggle: endstop_cover
- platform: hydreon_rgxx - platform: hydreon_rgxx
hydreon_rgxx_id: "hydreon_rg9" hydreon_rgxx_id: hydreon_rg9
too_cold: too_cold:
name: "rg9_toocold" name: rg9_toocold
em_sat: em_sat:
name: "rg9_emsat" name: rg9_emsat
lens_bad: lens_bad:
name: "rg9_lens_bad" name: rg9_lens_bad
- platform: template - platform: template
id: 'pzemac_reset_energy' id: pzemac_reset_energy
on_press: on_press:
then: then:
- pzemac.reset_energy: pzemac1 - pzemac.reset_energy: pzemac1
@ -891,14 +896,16 @@ status_led:
text_sensor: text_sensor:
- platform: daly_bms - platform: daly_bms
status: status:
name: "BMS Status" name: BMS Status
- platform: version - platform: version
name: 'ESPHome Version' name: ESPHome Version
icon: mdi:icon icon: mdi:icon
id: version_sensor id: version_sensor
on_value: on_value:
# yamllint disable rule:line-length
- lambda: !lambda |- - lambda: !lambda |-
ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str()); ESP_LOGD("main", "The state is %s=%s", x.c_str(), id(version_sensor).state.c_str());
# yamllint enable rule:line-length
- script.execute: my_script - script.execute: my_script
- script.wait: my_script - script.wait: my_script
- script.stop: my_script - script.stop: my_script
@ -912,7 +919,7 @@ text_sensor:
my_variable: |- my_variable: |-
return id(version_sensor).state; return id(version_sensor).state;
- platform: template - platform: template
name: 'Template Text Sensor' name: Template Text Sensor
lambda: |- lambda: |-
return {"Hello World"}; return {"Hello World"};
- platform: homeassistant - platform: homeassistant
@ -933,9 +940,9 @@ text_sensor:
component_name: text0 component_name: text0
- platform: dsmr - platform: dsmr
identification: identification:
name: "dsmr_identification" name: dsmr_identification
p1_version: p1_version:
name: "dsmr_p1_version" name: dsmr_p1_version
script: script:
- id: my_script - id: my_script
@ -948,9 +955,9 @@ sm2135:
switch: switch:
- platform: template - platform: template
name: 'mpr121_toggle' name: mpr121_toggle
id: mpr121_toggle id: mpr121_toggle
optimistic: True optimistic: true
- platform: gpio - platform: gpio
id: gpio_switch1 id: gpio_switch1
pin: pin:
@ -978,7 +985,7 @@ switch:
name: Custom Switch name: Custom Switch
- platform: nextion - platform: nextion
id: r0 id: r0
name: 'R0 Switch' name: R0 Switch
component_name: page0.r0 component_name: page0.r0
custom_component: custom_component:
@ -994,7 +1001,7 @@ stepper:
pin_b: GPIO13 pin_b: GPIO13
pin_c: GPIO14 pin_c: GPIO14
pin_d: GPIO15 pin_d: GPIO15
sleep_when_done: no sleep_when_done: false
step_mode: HALF_STEP step_mode: HALF_STEP
max_speed: 250 steps/s max_speed: 250 steps/s
acceleration: inf acceleration: inf
@ -1010,7 +1017,7 @@ stepper:
interval: interval:
interval: 5s interval: 5s
then: then:
- logger.log: 'Interval Run' - logger.log: Interval Run
- stepper.set_target: - stepper.set_target:
id: my_stepper2 id: my_stepper2
target: 500 target: 500
@ -1123,7 +1130,7 @@ climate:
default_target_temperature_high: 20°C default_target_temperature_high: 20°C
- platform: pid - platform: pid
id: pid_climate id: pid_climate
name: 'PID Climate Controller' name: PID Climate Controller
sensor: ha_hello_world sensor: ha_hello_world
default_target_temperature: 21°C default_target_temperature: 21°C
heat_output: my_slow_pwm heat_output: my_slow_pwm
@ -1134,42 +1141,42 @@ climate:
sprinkler: sprinkler:
- id: yard_sprinkler_ctrlr - id: yard_sprinkler_ctrlr
main_switch: "Yard Sprinklers" main_switch: Yard Sprinklers
auto_advance_switch: "Yard Sprinklers Auto Advance" auto_advance_switch: Yard Sprinklers Auto Advance
reverse_switch: "Yard Sprinklers Reverse" reverse_switch: Yard Sprinklers Reverse
pump_start_pump_delay: 2s pump_start_pump_delay: 2s
pump_stop_valve_delay: 4s pump_stop_valve_delay: 4s
pump_switch_off_during_valve_open_delay: true pump_switch_off_during_valve_open_delay: true
valve_open_delay: 5s valve_open_delay: 5s
valves: valves:
- valve_switch: "Yard Valve 0" - valve_switch: Yard Valve 0
enable_switch: "Enable Yard Valve 0" enable_switch: Enable Yard Valve 0
pump_switch_id: gpio_switch1 pump_switch_id: gpio_switch1
run_duration: 10s run_duration: 10s
valve_switch_id: gpio_switch2 valve_switch_id: gpio_switch2
- valve_switch: "Yard Valve 1" - valve_switch: Yard Valve 1
enable_switch: "Enable Yard Valve 1" enable_switch: Enable Yard Valve 1
pump_switch_id: gpio_switch1 pump_switch_id: gpio_switch1
run_duration: 10s run_duration: 10s
valve_switch_id: gpio_switch2 valve_switch_id: gpio_switch2
- valve_switch: "Yard Valve 2" - valve_switch: Yard Valve 2
enable_switch: "Enable Yard Valve 2" enable_switch: Enable Yard Valve 2
pump_switch_id: gpio_switch1 pump_switch_id: gpio_switch1
run_duration: 10s run_duration: 10s
valve_switch_id: gpio_switch2 valve_switch_id: gpio_switch2
- id: garden_sprinkler_ctrlr - id: garden_sprinkler_ctrlr
main_switch: "Garden Sprinklers" main_switch: Garden Sprinklers
auto_advance_switch: "Garden Sprinklers Auto Advance" auto_advance_switch: Garden Sprinklers Auto Advance
reverse_switch: "Garden Sprinklers Reverse" reverse_switch: Garden Sprinklers Reverse
valve_overlap: 5s valve_overlap: 5s
valves: valves:
- valve_switch: "Garden Valve 0" - valve_switch: Garden Valve 0
enable_switch: "Enable Garden Valve 0" enable_switch: Enable Garden Valve 0
pump_switch_id: gpio_switch1 pump_switch_id: gpio_switch1
run_duration: 10s run_duration: 10s
valve_switch_id: gpio_switch2 valve_switch_id: gpio_switch2
- valve_switch: "Garden Valve 1" - valve_switch: Garden Valve 1
enable_switch: "Enable Garden Valve 1" enable_switch: Enable Garden Valve 1
pump_switch_id: gpio_switch1 pump_switch_id: gpio_switch1
run_duration: 10s run_duration: 10s
valve_switch_id: gpio_switch2 valve_switch_id: gpio_switch2
@ -1219,7 +1226,7 @@ cover:
- switch.turn_on: gpio_switch2 - switch.turn_on: gpio_switch2
close_duration: 4.5min close_duration: 4.5min
- platform: current_based - platform: current_based
name: "Current Based Cover" name: Current Based Cover
open_sensor: ade7953_current_a open_sensor: ade7953_current_a
open_moving_current_threshold: 0.5 open_moving_current_threshold: 0.5
open_obstacle_current_threshold: 0.8 open_obstacle_current_threshold: 0.8
@ -1240,7 +1247,7 @@ cover:
malfunction_detection: true malfunction_detection: true
malfunction_action: malfunction_action:
then: then:
- logger.log: "Malfunction Detected" - logger.log: Malfunction Detected
- platform: template - platform: template
name: Template Cover with Tilt name: Template Cover with Tilt
tilt_lambda: 'return 0.5;' tilt_lambda: 'return 0.5;'
@ -1326,7 +1333,7 @@ light:
pin_b: out2 pin_b: out2
- platform: sonoff_d1 - platform: sonoff_d1
uart_id: uart2 uart_id: uart2
use_rm433_remote: False use_rm433_remote: false
name: Sonoff D1 Dimmer name: Sonoff D1 Dimmer
id: d1_light id: d1_light
restore_mode: RESTORE_DEFAULT_OFF restore_mode: RESTORE_DEFAULT_OFF
@ -1352,7 +1359,7 @@ sim800l:
str = sender; str = sender;
str = message; str = message;
- sim800l.send_sms: - sim800l.send_sms:
message: 'hello you' message: hello you
recipient: '+1234' recipient: '+1234'
- sim800l.dial: - sim800l.dial:
recipient: '+1234' recipient: '+1234'
@ -1365,7 +1372,7 @@ dfplayer:
condition: condition:
not: dfplayer.is_playing not: dfplayer.is_playing
then: then:
logger.log: 'Playback finished event' logger.log: Playback finished event
tm1651: tm1651:
id: tm1651_battery id: tm1651_battery
clk_pin: D6 clk_pin: D6
@ -1394,8 +1401,8 @@ rf_bridge:
test = data.length; test = data.length;
test = data.protocol; test = data.protocol;
test_code = data.code; test_code = data.code;
- rf_bridge.start_advanced_sniffing - rf_bridge.start_advanced_sniffing:
- rf_bridge.stop_advanced_sniffing - rf_bridge.stop_advanced_sniffing:
- rf_bridge.send_advanced_code: - rf_bridge.send_advanced_code:
length: 0x04 length: 0x04
protocol: 0x01 protocol: 0x01
@ -1413,13 +1420,13 @@ rf_bridge:
json: json:
key: !lambda |- key: !lambda |-
return id(version_sensor).state; return id(version_sensor).state;
greeting: 'Hello World' greeting: Hello World
- http_request.send: - http_request.send:
method: PUT method: PUT
url: https://esphome.io url: https://esphome.io
headers: headers:
Content-Type: application/json Content-Type: application/json
body: 'Some data' body: Some data
verify_ssl: false verify_ssl: false
display: display:
@ -1428,13 +1435,13 @@ display:
num_chips: 4 num_chips: 4
rotate_chip: 0 rotate_chip: 0
intensity: 10 intensity: 10
scroll_mode: 'STOP' scroll_mode: STOP
id: my_matrix id: my_matrix
lambda: |- lambda: |-
it.printdigit("hello"); it.printdigit("hello");
- platform: nextion - platform: nextion
uart_id: uart1 uart_id: uart1
tft_url: 'http://esphome.io/default35.tft' tft_url: http://esphome.io/default35.tft
update_interval: 5s update_interval: 5s
on_sleep: on_sleep:
then: then:

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: $devicename name: $devicename
platform: ESP32 platform: ESP32
@ -25,7 +26,7 @@ api:
i2c: i2c:
sda: 21 sda: 21
scl: 22 scl: 22
scan: False scan: false
spi: spi:
clk_pin: GPIO21 clk_pin: GPIO21
@ -38,7 +39,7 @@ uart:
baud_rate: 115200 baud_rate: 115200
ota: ota:
safe_mode: True safe_mode: true
port: 3286 port: 3286
logger: logger:
@ -71,7 +72,7 @@ select:
2: Both 2: Both
pipsolar: pipsolar:
id: inverter0 id: inverter0
sx1509: sx1509:
- id: sx1509_hub - id: sx1509_hub
@ -81,9 +82,9 @@ mcp3204:
cs_pin: GPIO23 cs_pin: GPIO23
dac7678: dac7678:
address: 0x4A address: 0x4A
id: dac7678_hub1 id: dac7678_hub1
internal_reference: true internal_reference: true
sensor: sensor:
- platform: homeassistant - platform: homeassistant
@ -226,22 +227,22 @@ sensor:
pv_charging_power: pv_charging_power:
id: inverter0_pv_charging_power id: inverter0_pv_charging_power
name: inverter0_pv_charging_power name: inverter0_pv_charging_power
- platform: "hrxl_maxsonar_wr" - platform: hrxl_maxsonar_wr
name: "Rainwater Tank Level" name: Rainwater Tank Level
filters: filters:
- sliding_window_moving_average: - sliding_window_moving_average:
window_size: 12 window_size: 12
send_every: 12 send_every: 12
- or: - or:
- throttle: "20min" - throttle: 20min
- delta: 0.02 - delta: 0.02
- platform: mcp3204 - platform: mcp3204
name: "MCP3204 Pin 1" name: MCP3204 Pin 1
number: 1 number: 1
id: mcp_sensor id: mcp_sensor
- platform: copy - platform: copy
source_id: mcp_sensor source_id: mcp_sensor
name: "MCP binary sensor copy" name: MCP binary sensor copy
# #
# platform sensor.apds9960 requires component apds9960 # platform sensor.apds9960 requires component apds9960
@ -321,15 +322,15 @@ binary_sensor:
name: inverter0_backlight_on name: inverter0_backlight_on
- platform: template - platform: template
id: ar1 id: ar1
lambda: 'return {};' lambda: "return {};"
filters: filters:
- autorepeat: - autorepeat:
- delay: 2s - delay: 2s
time_off: 100ms time_off: 100ms
time_on: 900ms time_on: 900ms
- delay: 4s - delay: 4s
time_off: 100ms time_off: 100ms
time_on: 400ms time_on: 400ms
on_state: on_state:
then: then:
- lambda: 'ESP_LOGI("ar1:", "%d", x);' - lambda: 'ESP_LOGI("ar1:", "%d", x);'
@ -356,8 +357,7 @@ binary_sensor:
y_min: 0 y_min: 0
y_max: 100 y_max: 100
on_press: on_press:
- logger.log: "Touched" - logger.log: Touched
climate: climate:
- platform: tuya - platform: tuya
@ -392,7 +392,7 @@ switch:
light: light:
- platform: fastled_clockless - platform: fastled_clockless
id: led_matrix_32x8 id: led_matrix_32x8
name: "led_matrix_32x8" name: led_matrix_32x8
chipset: WS2812B chipset: WS2812B
pin: GPIO15 pin: GPIO15
num_leds: 256 num_leds: 256
@ -417,7 +417,7 @@ cover:
position_datapoint: 2 position_datapoint: 2
- platform: copy - platform: copy
source_id: tuya_cover source_id: tuya_cover
name: "Tuya Cover copy" name: Tuya Cover copy
display: display:
- platform: addressable_light - platform: addressable_light
@ -516,7 +516,7 @@ text_sensor:
name: inverter0_last_qflag name: inverter0_last_qflag
- platform: copy - platform: copy
source_id: inverter0_device_mode source_id: inverter0_device_mode
name: "Inverter Text Sensor Copy" name: Inverter Text Sensor Copy
output: output:
- platform: pipsolar - platform: pipsolar
@ -524,37 +524,37 @@ output:
battery_recharge_voltage: battery_recharge_voltage:
id: inverter0_battery_recharge_voltage_out id: inverter0_battery_recharge_voltage_out
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 0 channel: 0
id: 'dac7678_1_ch0' id: dac7678_1_ch0
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 1 channel: 1
id: 'dac7678_1_ch1' id: dac7678_1_ch1
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 2 channel: 2
id: 'dac7678_1_ch2' id: dac7678_1_ch2
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 3 channel: 3
id: 'dac7678_1_ch3' id: dac7678_1_ch3
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 4 channel: 4
id: 'dac7678_1_ch4' id: dac7678_1_ch4
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 5 channel: 5
id: 'dac7678_1_ch5' id: dac7678_1_ch5
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 6 channel: 6
id: 'dac7678_1_ch6' id: dac7678_1_ch6
- platform: dac7678 - platform: dac7678
dac7678_id: 'dac7678_hub1' dac7678_id: dac7678_hub1
channel: 7 channel: 7
id: 'dac7678_1_ch7' id: dac7678_1_ch7
esp32_camera: esp32_camera:
name: ESP-32 Camera name: ESP-32 Camera
data_pins: [GPIO17, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19] data_pins: [GPIO17, GPIO35, GPIO34, GPIO5, GPIO39, GPIO18, GPIO36, GPIO19]
@ -581,9 +581,9 @@ esp32_camera_web_server:
external_components: external_components:
- source: github://esphome/esphome@dev - source: github://esphome/esphome@dev
refresh: 1d refresh: 1d
components: ["bh1750"] components: [bh1750]
- source: ../esphome/components - source: ../esphome/components
components: ["sntp"] components: [sntp]
xpt2046: xpt2046:
id: xpt_touchscreen id: xpt_touchscreen
cs_pin: 17 cs_pin: 17
@ -597,8 +597,9 @@ xpt2046:
calibration_x_max: 280 calibration_x_max: 280
calibration_y_min: 340 calibration_y_min: 340
calibration_y_max: 3860 calibration_y_max: 3860
swap_x_y: False swap_x_y: false
on_state: on_state:
# yamllint disable rule:line-length
- lambda: |- - lambda: |-
ESP_LOGI("main", "args x=%d, y=%d, touched=%s", x, y, (touched ? "touch" : "release")); ESP_LOGI("main", "args x=%d, y=%d, touched=%s", x, y, (touched ? "touch" : "release"));
ESP_LOGI("main", "member x=%d, y=%d, touched=%d, x_raw=%d, y_raw=%d, z_raw=%d", ESP_LOGI("main", "member x=%d, y=%d, touched=%d, x_raw=%d, y_raw=%d, z_raw=%d",
@ -609,6 +610,7 @@ xpt2046:
id(xpt_touchscreen).y_raw, id(xpt_touchscreen).y_raw,
id(xpt_touchscreen).z_raw id(xpt_touchscreen).z_raw
); );
# yamllint enable rule:line-length
button: button:
- platform: restart - platform: restart
@ -622,7 +624,6 @@ button:
source_id: shutdown_btn source_id: shutdown_btn
name: Shutdown Button Copy name: Shutdown Button Copy
touchscreen: touchscreen:
- platform: ektf2232 - platform: ektf2232
interrupt_pin: GPIO36 interrupt_pin: GPIO36
@ -631,7 +632,7 @@ touchscreen:
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)
args: ["touch.x", "touch.y"] args: [touch.x, touch.y]
- platform: lilygo_t5_47 - platform: lilygo_t5_47
id: lilygo_touchscreen id: lilygo_touchscreen
@ -640,7 +641,7 @@ touchscreen:
on_touch: on_touch:
- logger.log: - logger.log:
format: Touch at (%d, %d) format: Touch at (%d, %d)
args: ["touch.x", "touch.y"] args: [touch.x, touch.y]
media_player: media_player:
- platform: i2s_audio - platform: i2s_audio
@ -673,4 +674,4 @@ prometheus:
relabel: relabel:
ha_hello_world: ha_hello_world:
id: hellow_world id: hellow_world
name: "Hello World" name: Hello World

View File

@ -1,3 +1,4 @@
---
esphome: esphome:
name: test5 name: test5
build_path: build/test5 build_path: build/test5
@ -60,8 +61,10 @@ mqtt:
topic: testing/sensor/testing_sensor/state topic: testing/sensor/testing_sensor/state
qos: 0 qos: 0
then: then:
# yamllint disable rule:line-length
- lambda: |- - lambda: |-
ESP_LOGD("Mqtt Test","testing/sensor/testing_sensor/state=[%s]",x.c_str()); ESP_LOGD("Mqtt Test", "testing/sensor/testing_sensor/state=[%s]", x.c_str());
# yamllint enable rule:line-length
binary_sensor: binary_sensor:
- platform: gpio - platform: gpio
@ -74,8 +77,8 @@ binary_sensor:
id: modbus_binsensortest id: modbus_binsensortest
register_type: read register_type: read
address: 0x3200 address: 0x3200
bitmask: 0x80 #(bit 8) bitmask: 0x80 # (bit 8)
lambda: !lambda "{ return x ;}" lambda: "return x;"
tlc5947: tlc5947:
data_pin: GPIO12 data_pin: GPIO12
@ -108,8 +111,8 @@ demo:
esp32_ble: esp32_ble:
esp32_ble_server: esp32_ble_server:
manufacturer: "ESPHome" manufacturer: ESPHome
model: "Test5" model: Test5
esp32_improv: esp32_improv:
authorizer: io0_button authorizer: io0_button
@ -128,12 +131,12 @@ number:
mode: slider mode: slider
on_value: on_value:
- logger.log: - logger.log:
format: "Number changed to %f" format: Number changed to %f
args: ["x"] args: [x]
set_action: set_action:
- logger.log: - logger.log:
format: "Template Number set to %f" format: Template Number set to %f
args: ["x"] args: [x]
- number.set: - number.set:
id: template_number_id id: template_number_id
value: 50 value: 50
@ -163,10 +166,10 @@ number:
- id: modbus_numbertest - id: modbus_numbertest
platform: modbus_controller platform: modbus_controller
modbus_controller_id: modbus_controller_test modbus_controller_id: modbus_controller_test
name: "ModbusNumber" name: ModbusNumber
address: 0x9002 address: 0x9002
value_type: U_WORD value_type: U_WORD
lambda: "return x * 1.0; " lambda: "return x * 1.0;"
write_lambda: |- write_lambda: |-
return x * 1.0 ; return x * 1.0 ;
multiply: 1.0 multiply: 1.0
@ -180,11 +183,11 @@ select:
restore_value: true restore_value: true
on_value: on_value:
- logger.log: - logger.log:
format: "Select changed to %s (index %d)" format: Select changed to %s (index %d)"
args: ["x.c_str()", "i"] args: ["x.c_str()", "i"]
set_action: set_action:
- logger.log: - logger.log:
format: "Template Select set to %s" format: Template Select set to %s
args: ["x.c_str()"] args: ["x.c_str()"]
- select.set: - select.set:
id: template_select_id id: template_select_id
@ -216,7 +219,7 @@ select:
- three - three
- platform: modbus_controller - platform: modbus_controller
name: "Modbus Select Register 1000" name: Modbus Select Register 1000
address: 1000 address: 1000
value_type: U_WORD value_type: U_WORD
optionsmap: optionsmap:
@ -228,41 +231,41 @@ select:
sensor: sensor:
- platform: selec_meter - platform: selec_meter
total_active_energy: total_active_energy:
name: "SelecEM2M Total Active Energy" name: SelecEM2M Total Active Energy
import_active_energy: import_active_energy:
name: "SelecEM2M Import Active Energy" name: SelecEM2M Import Active Energy
export_active_energy: export_active_energy:
name: "SelecEM2M Export Active Energy" name: SelecEM2M Export Active Energy
total_reactive_energy: total_reactive_energy:
name: "SelecEM2M Total Reactive Energy" name: SelecEM2M Total Reactive Energy
import_reactive_energy: import_reactive_energy:
name: "SelecEM2M Import Reactive Energy" name: SelecEM2M Import Reactive Energy
export_reactive_energy: export_reactive_energy:
name: "SelecEM2M Export Reactive Energy" name: SelecEM2M Export Reactive Energy
apparent_energy: apparent_energy:
name: "SelecEM2M Apparent Energy" name: SelecEM2M Apparent Energy
active_power: active_power:
name: "SelecEM2M Active Power" name: SelecEM2M Active Power
reactive_power: reactive_power:
name: "SelecEM2M Reactive Power" name: SelecEM2M Reactive Power
apparent_power: apparent_power:
name: "SelecEM2M Apparent Power" name: SelecEM2M Apparent Power
voltage: voltage:
name: "SelecEM2M Voltage" name: SelecEM2M Voltage
current: current:
name: "SelecEM2M Current" name: SelecEM2M Current
power_factor: power_factor:
name: "SelecEM2M Power Factor" name: SelecEM2M Power Factor
frequency: frequency:
name: "SelecEM2M Frequency" name: SelecEM2M Frequency
maximum_demand_active_power: maximum_demand_active_power:
name: "SelecEM2M Maximum Demand Active Power" name: SelecEM2M Maximum Demand Active Power
disabled_by_default: true disabled_by_default: true
maximum_demand_reactive_power: maximum_demand_reactive_power:
name: "SelecEM2M Maximum Demand Reactive Power" name: SelecEM2M Maximum Demand Reactive Power
disabled_by_default: true disabled_by_default: true
maximum_demand_apparent_power: maximum_demand_apparent_power:
name: "SelecEM2M Maximum Demand Apparent Power" name: SelecEM2M Maximum Demand Apparent Power
disabled_by_default: true disabled_by_default: true
- id: modbus_sensortest - id: modbus_sensortest
@ -279,41 +282,41 @@ sensor:
- platform: bmp3xx - platform: bmp3xx
temperature: temperature:
name: "BMP Temperature" name: BMP Temperature
oversampling: 16x oversampling: 16x
pressure: pressure:
name: "BMP Pressure" name: BMP Pressure
address: 0x77 address: 0x77
iir_filter: 2X iir_filter: 2X
- platform: sen5x - platform: sen5x
id: sen54 id: sen54
temperature: temperature:
name: "Temperature" name: Temperature
accuracy_decimals: 1 accuracy_decimals: 1
humidity: humidity:
name: "Humidity" name: Humidity
accuracy_decimals: 0 accuracy_decimals: 0
pm_1_0: pm_1_0:
name: " PM <1µm Weight concentration" name: PM <1µm Weight concentration
id: pm_1_0 id: pm_1_0
accuracy_decimals: 1 accuracy_decimals: 1
pm_2_5: pm_2_5:
name: " PM <2.5µm Weight concentration" name: PM <2.5µm Weight concentration
id: pm_2_5 id: pm_2_5
accuracy_decimals: 1 accuracy_decimals: 1
pm_4_0: pm_4_0:
name: " PM <4µm Weight concentration" name: PM <4µm Weight concentration
id: pm_4_0 id: pm_4_0
accuracy_decimals: 1 accuracy_decimals: 1
pm_10_0: pm_10_0:
name: " PM <10µm Weight concentration" name: PM <10µm Weight concentration
id: pm_10_0 id: pm_10_0
accuracy_decimals: 1 accuracy_decimals: 1
nox: nox:
name: "NOx" name: NOx
voc: voc:
name: "VOC" name: VOC
algorithm_tuning: algorithm_tuning:
index_offset: 100 index_offset: 100
learning_time_offset_hours: 12 learning_time_offset_hours: 12
@ -332,9 +335,9 @@ sensor:
- platform: mcp9600 - platform: mcp9600
thermocouple_type: K thermocouple_type: K
hot_junction: hot_junction:
name: "Thermocouple Temperature" name: Thermocouple Temperature
cold_junction: cold_junction:
name: "Ambient Temperature" name: Ambient Temperature
script: script:
- id: automation_test - id: automation_test
@ -342,7 +345,7 @@ script:
- repeat: - repeat:
count: 5 count: 5
then: then:
- logger.log: "looping!" - logger.log: looping!
switch: switch:
- platform: modbus_controller - platform: modbus_controller

View File

@ -1,2 +1,3 @@
---
sensor: sensor:
- <<: !include ./test_uptime_sensor.yaml - <<: !include ./test_uptime_sensor.yaml

View File

@ -1,4 +1,5 @@
---
wifi: wifi:
networks: networks:
- ssid: 'WiFiFromPackage' - ssid: "WiFiFromPackage"
password: 'password1' password: "password1"

View File

@ -1,3 +1,4 @@
---
# Uptime sensor. # Uptime sensor.
platform: uptime platform: uptime
id: ${devicename}_uptime_pcg id: ${devicename}_uptime_pcg

View File

@ -1 +1,2 @@
---
${var1} ${var1}

View File

@ -8,10 +8,11 @@ wifi: !include
name: my_custom_ssid name: my_custom_ssid
esphome: esphome:
# should be substituted as 'original', not overwritten by vars in the !include above # should be substituted as 'original',
# not overwritten by vars in the !include above
name: ${name} name: ${name}
name_add_mac_suffix: true name_add_mac_suffix: true
platform: esp8266 platform: esp8266
board: !include { file: includes/scalar.yaml, vars: { var1: nodemcu } } board: !include {file: includes/scalar.yaml, vars: {var1: nodemcu}}
libraries: !include { file: includes/list.yaml, vars: { var1: Wire } } libraries: !include {file: includes/list.yaml, vars: {var1: Wire}}