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}]
indent_style = space
indent_size = 2
quote_type = single
quote_type = double
# JSON
[*.json]
indent_style = space
indent_size = 2

1
.github/FUNDING.yml vendored
View File

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

View File

@ -1,3 +1,4 @@
---
blank_issues_enabled: false
contact_links:
- name: Issue Tracker
@ -5,7 +6,10 @@ contact_links:
about: Please create bug reports in the dedicated issue tracker.
- name: Feature Request Tracker
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
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
updates:
- package-ecosystem: "pip"
- package-ecosystem: pip
directory: "/"
schedule:
interval: "daily"
interval: daily
ignore:
# Hypotehsis is only used for testing and is updated quite often
- dependency-name: hypothesis
- package-ecosystem: "github-actions"
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily

View File

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

View File

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

View File

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

View File

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

View File

@ -1,8 +1,10 @@
---
name: Stale
# yamllint disable-line rule:truthy
on:
schedule:
- cron: '30 0 * * *'
- cron: "30 0 * * *"
workflow_dispatch:
permissions:
@ -31,7 +33,8 @@ jobs:
and will be closed if no further activity occurs within 7 days.
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:
runs-on: ubuntu-latest
steps:

View File

@ -1,6 +1,8 @@
---
ports:
- port: 6052
onOpen: open-preview
- port: 6052
onOpen: open-preview
tasks:
- before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup
command: python -m esphome dashboard config
# yamllint disable-line rule:line-length
- 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/hooks.html for more hooks
repos:
- repo: https://github.com/ambv/black
rev: 22.6.0
hooks:
- id: black
args:
- --safe
- --quiet
files: ^((esphome|script|tests)/.+)?[^/]+\.py$
- id: black
args:
- --safe
- --quiet
files: ^((esphome|script|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
hooks:

3
.yamllint Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,10 +8,11 @@ wifi: !include
name: my_custom_ssid
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_add_mac_suffix: true
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}}