1
0
mirror of https://github.com/esphome/esphome.git synced 2025-02-12 16:57:08 +01:00

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

View File

@ -1,3 +1,4 @@
---
substitutions:
devicename: test1
sensorname: my
@ -43,13 +44,13 @@ esphome:
json:
key: !lambda |-
return id(${textname}_text).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
on_response:
then:
@ -95,8 +96,8 @@ mqtt:
password: "debug"
client_id: someclient
use_abbreviations: false
discovery: True
discovery_retain: False
discovery: true
discovery_retain: false
discovery_prefix: discovery
discovery_unique_id_generator: legacy
topic_prefix: helloworld
@ -109,7 +110,7 @@ mqtt:
topic: topic/to/send/to
payload: hi
qos: 2
retain: True
retain: true
keepalive: 60s
reboot_timeout: 60s
on_message:
@ -154,6 +155,7 @@ mqtt:
return effect;
- light.control:
id: ${roomname}_lights
# yamllint disable-line rule:line-length
brightness: !lambda "return id(${roomname}_lights).current_values.get_brightness() + 0.5;"
- light.dim_relative:
id: ${roomname}_lights
@ -179,7 +181,7 @@ mqtt:
i2c:
sda: 21
scl: 22
scan: True
scan: true
frequency: 100kHz
setup_priority: -100
id: i2c_bus
@ -192,10 +194,10 @@ spi:
uart:
- tx_pin:
number: GPIO22
inverted: yes
inverted: true
rx_pin:
number: GPIO23
inverted: yes
inverted: true
baud_rate: 115200
id: uart0
parity: NONE
@ -222,7 +224,7 @@ uart:
rx_buffer_size: 1024
ota:
safe_mode: True
safe_mode: true
password: "superlongpasswordthatnoonewillknow"
port: 3286
reboot_timeout: 2min
@ -233,14 +235,14 @@ ota:
ESP_LOGD("ota", "State %d", state);
on_begin:
then:
logger.log: "OTA begin"
logger.log: OTA begin
on_progress:
then:
lambda: >-
ESP_LOGD("ota", "Got progress %f", x);
on_end:
then:
logger.log: "OTA end"
logger.log: OTA end
on_error:
then:
lambda: >-
@ -258,7 +260,7 @@ web_server:
version: 2
power_supply:
id: "atx_power_supply"
id: atx_power_supply
enable_time: 20ms
keep_on_time: 10s
pin:
@ -308,22 +310,22 @@ bedjet:
id: my_bedjet_client
time_id: sntp_time
mcp23s08:
- id: "mcp23s08_hub"
- id: mcp23s08_hub
cs_pin: GPIO12
deviceaddress: 0
mcp23s17:
- id: "mcp23s17_hub"
- id: mcp23s17_hub
cs_pin: GPIO12
deviceaddress: 1
sensor:
- platform: ble_client
ble_client_id: ble_foo
name: "Green iTag btn"
service_uuid: "ffe0"
characteristic_uuid: "ffe1"
descriptor_uuid: "ffe2"
name: Green iTag btn
service_uuid: ffe0
characteristic_uuid: ffe1
descriptor_uuid: ffe2
notify: true
update_interval: never
lambda: |-
@ -335,7 +337,7 @@ sensor:
ESP_LOGD("green_btn", "Button was pressed, val%f", x);
- platform: adc
pin: A0
name: "Living Room Brightness"
name: Living Room Brightness
update_interval: "1:01"
attenuation: 2.5db
unit_of_measurement: "°C"
@ -384,11 +386,13 @@ sensor:
- lambda: return x * (9.0/5.0) + 32.0;
on_value:
then:
# yamllint disable rule:line-length
- lambda: |-
ESP_LOGD("main", "Got value %f", x);
id(${sensorname}_sensor).publish_state(42.0);
ESP_LOGI("main", "Value of my sensor: %f", id(${sensorname}_sensor).state);
ESP_LOGI("main", "Raw Value of my sensor: %f", id(${sensorname}_sensor).state);
# yamllint enable rule:line-length
on_value_range:
above: 5
below: 10
@ -405,18 +409,18 @@ sensor:
ESP_LOGD("main", "Got raw value %f", x);
- logger.log:
level: DEBUG
format: "Got raw value %f"
format: Got raw value %f
args: ["x"]
- logger.log: "Got raw value NAN"
- logger.log: Got raw value NAN
- mqtt.publish:
topic: some/topic
payload: Hello
qos: 2
retain: True
retain: true
- platform: esp32_hall
name: ESP32 Hall Sensor
- platform: ads1115
multiplexer: "A0_A1"
multiplexer: A0_A1
gain: 1.024
id: ${sensorname}_sensor
filters:
@ -427,57 +431,57 @@ sensor:
cs_pin: 5
phase_a:
voltage:
name: "EMON Line Voltage A"
name: EMON Line Voltage A
current:
name: "EMON CT1 Current"
name: EMON CT1 Current
power:
name: "EMON Active Power CT1"
name: EMON Active Power CT1
reactive_power:
name: "EMON Reactive Power CT1"
name: EMON Reactive Power CT1
power_factor:
name: "EMON Power Factor CT1"
name: EMON Power Factor CT1
gain_voltage: 7305
gain_ct: 27961
phase_b:
current:
name: "EMON CT2 Current"
name: EMON CT2 Current
power:
name: "EMON Active Power CT2"
name: EMON Active Power CT2
reactive_power:
name: "EMON Reactive Power CT2"
name: EMON Reactive Power CT2
power_factor:
name: "EMON Power Factor CT2"
name: EMON Power Factor CT2
gain_voltage: 7305
gain_ct: 27961
phase_c:
current:
name: "EMON CT3 Current"
name: EMON CT3 Current
power:
name: "EMON Active Power CT3"
name: EMON Active Power CT3
reactive_power:
name: "EMON Reactive Power CT3"
name: EMON Reactive Power CT3
power_factor:
name: "EMON Power Factor CT3"
name: EMON Power Factor CT3
gain_voltage: 7305
gain_ct: 27961
frequency:
name: "EMON Line Frequency"
name: EMON Line Frequency
chip_temperature:
name: "EMON Chip Temp A"
name: EMON Chip Temp A
line_frequency: 60Hz
current_phases: 3
gain_pga: 2X
- platform: bh1750
name: "Living Room Brightness 3"
name: Living Room Brightness 3
internal: true
address: 0x23
update_interval: 30s
retain: False
retain: false
availability:
state_topic: livingroom/custom_state_topic
i2c_id: i2c_bus
- platform: max44009
name: "Outside Brightness 1"
name: Outside Brightness 1
internal: true
address: 0x4A
update_interval: 30s
@ -485,13 +489,13 @@ sensor:
i2c_id: i2c_bus
- platform: bme280
temperature:
name: "Outside Temperature"
name: Outside Temperature
oversampling: 16x
pressure:
name: "Outside Pressure"
name: Outside Pressure
oversampling: none
humidity:
name: "Outside Humidity"
name: Outside Humidity
oversampling: 8x
address: 0x77
iir_filter: 16x
@ -499,14 +503,14 @@ sensor:
i2c_id: i2c_bus
- platform: bme680
temperature:
name: "Outside Temperature"
name: Outside Temperature
oversampling: 16x
pressure:
name: "Outside Pressure"
name: Outside Pressure
humidity:
name: "Outside Humidity"
name: Outside Humidity
gas_resistance:
name: "Outside Gas Sensor"
name: Outside Gas Sensor
address: 0x77
heater:
temperature: 320
@ -515,9 +519,9 @@ sensor:
i2c_id: i2c_bus
- platform: bmp085
temperature:
name: "Outside Temperature"
name: Outside Temperature
pressure:
name: "Outside Pressure"
name: Outside Pressure
filters:
- lambda: >-
return x / powf(1.0 - (x / 44330.0), 5.255);
@ -525,54 +529,54 @@ sensor:
i2c_id: i2c_bus
- platform: bmp280
temperature:
name: "Outside Temperature"
name: Outside Temperature
oversampling: 16x
pressure:
name: "Outside Pressure"
name: Outside Pressure
address: 0x77
update_interval: 15s
iir_filter: 16x
i2c_id: i2c_bus
- platform: dallas
address: 0x1C0000031EDD2A28
name: "Living Room Temperature"
name: Living Room Temperature
resolution: 9
- platform: dallas
index: 1
name: "Living Room Temperature 2"
name: Living Room Temperature 2
- platform: dht
pin: GPIO26
temperature:
name: "Living Room Temperature 3"
name: Living Room Temperature 3
humidity:
name: "Living Room Humidity 3"
name: Living Room Humidity 3
model: AM2302
update_interval: 15s
- platform: dht12
temperature:
name: "Living Room Temperature 4"
name: Living Room Temperature 4
humidity:
name: "Living Room Humidity 4"
name: Living Room Humidity 4
update_interval: 15s
i2c_id: i2c_bus
- platform: duty_cycle
pin: GPIO25
name: Duty Cycle Sensor
- platform: esp32_hall
name: "ESP32 Hall Sensor"
name: ESP32 Hall Sensor
update_interval: 15s
- platform: ens210
temperature:
name: "Living Room Temperature 5"
name: Living Room Temperature 5
humidity:
name: 'Living Room Humidity 5'
name: Living Room Humidity 5
update_interval: 15s
i2c_id: i2c_bus
- platform: hdc1080
temperature:
name: 'Living Room Temperature 6'
name: Living Room Temperature 6
humidity:
name: 'Living Room Humidity 5'
name: Living Room Humidity 5
update_interval: 15s
i2c_id: i2c_bus
- platform: hlw8012
@ -580,14 +584,14 @@ sensor:
cf_pin: 14
cf1_pin: 13
current:
name: "HLW8012 Current"
name: HLW8012 Current
voltage:
name: "HLW8012 Voltage"
name: HLW8012 Voltage
power:
name: "HLW8012 Power"
name: HLW8012 Power
id: hlw8012_power
energy:
name: "HLW8012 Energy"
name: HLW8012 Energy
id: hlw8012_energy
update_interval: 15s
current_resistor: 0.001 ohm
@ -597,53 +601,53 @@ sensor:
model: hlw8012
- platform: total_daily_energy
power_id: hlw8012_power
name: "HLW8012 Total Daily Energy"
name: HLW8012 Total Daily Energy
- platform: integration
sensor: hlw8012_power
name: "Integration Sensor"
name: Integration Sensor
time_unit: s
- platform: integration
sensor: hlw8012_power
name: "Integration Sensor lazy"
name: Integration Sensor lazy
time_unit: s
- platform: hmc5883l
address: 0x68
field_strength_x:
name: "HMC5883L Field Strength X"
name: HMC5883L Field Strength X
field_strength_y:
name: "HMC5883L Field Strength Y"
name: HMC5883L Field Strength Y
field_strength_z:
name: "HMC5883L Field Strength Z"
name: HMC5883L Field Strength Z
heading:
name: "HMC5883L Heading"
name: HMC5883L Heading
range: 130uT
oversampling: 8x
update_interval: 15s
i2c_id: i2c_bus
- platform: honeywellabp
pressure:
name: "Honeywell pressure"
name: Honeywell pressure
min_pressure: 0
max_pressure: 15
temperature:
name: "Honeywell temperature"
name: Honeywell temperature
cs_pin: GPIO5
- platform: qmc5883l
address: 0x0D
field_strength_x:
name: "QMC5883L Field Strength X"
name: QMC5883L Field Strength X
field_strength_y:
name: "QMC5883L Field Strength Y"
name: QMC5883L Field Strength Y
field_strength_z:
name: "QMC5883L Field Strength Z"
name: QMC5883L Field Strength Z
heading:
name: "QMC5883L Heading"
name: QMC5883L Heading
range: 800uT
oversampling: 256x
update_interval: 15s
i2c_id: i2c_bus
- platform: hx711
name: "HX711 Value"
name: HX711 Value
dout_pin: GPIO23
clk_pin: GPIO25
gain: 128
@ -652,13 +656,13 @@ sensor:
address: 0x40
shunt_resistance: 0.1 ohm
current:
name: "INA219 Current"
name: INA219 Current
power:
name: "INA219 Power"
name: INA219 Power
bus_voltage:
name: "INA219 Bus Voltage"
name: INA219 Bus Voltage
shunt_voltage:
name: "INA219 Shunt Voltage"
name: INA219 Shunt Voltage
max_voltage: 32.0V
max_current: 3.2A
update_interval: 15s
@ -667,13 +671,13 @@ sensor:
address: 0x40
shunt_resistance: 0.1 ohm
current:
name: "INA226 Current"
name: INA226 Current
power:
name: "INA226 Power"
name: INA226 Power
bus_voltage:
name: "INA226 Bus Voltage"
name: INA226 Bus Voltage
shunt_voltage:
name: "INA226 Shunt Voltage"
name: INA226 Shunt Voltage
max_current: 3.2A
update_interval: 15s
i2c_id: i2c_bus
@ -682,17 +686,17 @@ sensor:
channel_1:
shunt_resistance: 0.1 ohm
current:
name: "INA3221 Channel 1 Current"
name: INA3221 Channel 1 Current
power:
name: "INA3221 Channel 1 Power"
name: INA3221 Channel 1 Power
bus_voltage:
name: "INA3221 Channel 1 Bus Voltage"
name: INA3221 Channel 1 Bus Voltage
shunt_voltage:
name: "INA3221 Channel 1 Shunt Voltage"
name: INA3221 Channel 1 Shunt Voltage
update_interval: 15s
i2c_id: i2c_bus
- platform: kalman_combinator
name: "Kalman-filtered temperature"
name: Kalman-filtered temperature
process_std_dev: 0.00139
sources:
- source: scd30_temperature
@ -702,114 +706,114 @@ sensor:
error: 1.5
- platform: htu21d
temperature:
name: "Living Room Temperature 6"
name: Living Room Temperature 6
humidity:
name: "Living Room Humidity 6"
name: Living Room Humidity 6
update_interval: 15s
i2c_id: i2c_bus
- platform: max6675
name: "Living Room Temperature"
name: Living Room Temperature
cs_pin: GPIO23
update_interval: 15s
- platform: max31855
name: "Den Temperature"
name: Den Temperature
cs_pin: GPIO23
update_interval: 15s
reference_temperature:
name: "MAX31855 Internal Temperature"
name: MAX31855 Internal Temperature
- platform: max31856
name: "BBQ Temperature"
name: BBQ Temperature
cs_pin: GPIO17
update_interval: 15s
mains_filter: 50Hz
- platform: max31865
name: "Water Tank Temperature"
name: Water Tank Temperature
cs_pin: GPIO23
update_interval: 15s
reference_resistance: "430 Ω"
rtd_nominal_resistance: "100 Ω"
reference_resistance: 430 Ω
rtd_nominal_resistance: 100 Ω
- platform: mhz19
uart_id: uart0
co2:
name: "MH-Z19 CO2 Value"
name: MH-Z19 CO2 Value
temperature:
name: "MH-Z19 Temperature"
name: MH-Z19 Temperature
update_interval: 15s
automatic_baseline_calibration: false
- platform: mpu6050
address: 0x68
accel_x:
name: "MPU6050 Accel X"
name: MPU6050 Accel X
accel_y:
name: "MPU6050 Accel Y"
name: MPU6050 Accel Y
accel_z:
name: "MPU6050 Accel z"
name: MPU6050 Accel z
gyro_x:
name: "MPU6050 Gyro X"
name: MPU6050 Gyro X
gyro_y:
name: "MPU6050 Gyro Y"
name: MPU6050 Gyro Y
gyro_z:
name: "MPU6050 Gyro z"
name: MPU6050 Gyro z
temperature:
name: "MPU6050 Temperature"
name: MPU6050 Temperature
i2c_id: i2c_bus
- platform: mpu6886
address: 0x68
accel_x:
name: "MPU6886 Accel X"
name: MPU6886 Accel X
accel_y:
name: "MPU6886 Accel Y"
name: MPU6886 Accel Y
accel_z:
name: "MPU6886 Accel z"
name: MPU6886 Accel z
gyro_x:
name: "MPU6886 Gyro X"
name: MPU6886 Gyro X
gyro_y:
name: "MPU6886 Gyro Y"
name: MPU6886 Gyro Y
gyro_z:
name: "MPU6886 Gyro z"
name: MPU6886 Gyro z
temperature:
name: "MPU6886 Temperature"
name: MPU6886 Temperature
i2c_id: i2c_bus
- platform: dps310
temperature:
name: "DPS310 Temperature"
name: DPS310 Temperature
pressure:
name: "DPS310 Pressure"
name: DPS310 Pressure
address: 0x77
update_interval: 15s
i2c_id: i2c_bus
- platform: ms5611
temperature:
name: "Outside Temperature"
name: Outside Temperature
pressure:
name: "Outside Pressure"
name: Outside Pressure
address: 0x77
update_interval: 15s
i2c_id: i2c_bus
- platform: pmsa003i
pm_1_0:
name: "PMSA003i PM1.0"
name: PMSA003i PM1.0
pm_2_5:
name: "PMSA003i PM2.5"
name: PMSA003i PM2.5
pm_10_0:
name: "PMSA003i PM10.0"
name: PMSA003i PM10.0
pmc_0_3:
name: "PMSA003i PMC <0.3µm"
name: PMSA003i PMC <0.3µm
pmc_0_5:
name: "PMSA003i PMC <0.5µm"
name: PMSA003i PMC <0.5µm
pmc_1_0:
name: "PMSA003i PMC <1µm"
name: PMSA003i PMC <1µm
pmc_2_5:
name: "PMSA003i PMC <2.5µm"
name: PMSA003i PMC <2.5µm
pmc_5_0:
name: "PMSA003i PMC <5µm"
name: PMSA003i PMC <5µm
pmc_10_0:
name: "PMSA003i PMC <10µm"
name: PMSA003i PMC <10µm
address: 0x12
standard_units: True
standard_units: true
i2c_id: i2c_bus
- platform: pulse_counter
name: "Pulse Counter"
name: Pulse Counter
pin: GPIO12
count_mode:
rising_edge: INCREMENT
@ -817,7 +821,7 @@ sensor:
internal_filter: 13us
update_interval: 15s
- platform: pulse_meter
name: "Pulse Meter"
name: Pulse Meter
id: pulse_meter_sensor
pin: GPIO12
internal_filter: 100ms
@ -827,20 +831,20 @@ sensor:
id: pulse_meter_sensor
value: 12345
total:
name: "Pulse Meter Total"
name: Pulse Meter Total
- platform: qmp6988
temperature:
name: "Living Temperature QMP"
name: Living Temperature QMP
oversampling: 32x
pressure:
name: "Living Pressure QMP"
name: Living Pressure QMP
oversampling: 2x
address: 0x70
update_interval: 30s
iir_filter: 16x
i2c_id: i2c_bus
- platform: rotary_encoder
name: "Rotary Encoder"
name: Rotary Encoder
id: rotary_encoder1
pin_a: GPIO23
pin_b: GPIO25
@ -860,49 +864,49 @@ sensor:
id: rotary_encoder1
value: !lambda "return -1;"
on_clockwise:
- logger.log: "Clockwise"
- logger.log: Clockwise
on_anticlockwise:
- logger.log: "Anticlockwise"
- logger.log: Anticlockwise
- platform: pulse_width
name: Pulse Width
pin: GPIO12
- platform: sm300d2
uart_id: uart0
co2:
name: "SM300D2 CO2 Value"
name: SM300D2 CO2 Value
formaldehyde:
name: "SM300D2 Formaldehyde Value"
name: SM300D2 Formaldehyde Value
tvoc:
name: "SM300D2 TVOC Value"
name: SM300D2 TVOC Value
pm_2_5:
name: "SM300D2 PM2.5 Value"
name: SM300D2 PM2.5 Value
pm_10_0:
name: "SM300D2 PM10 Value"
name: SM300D2 PM10 Value
temperature:
name: "SM300D2 Temperature Value"
name: SM300D2 Temperature Value
humidity:
name: "SM300D2 Humidity Value"
name: SM300D2 Humidity Value
update_interval: 60s
- platform: sht3xd
temperature:
name: "Living Room Temperature 8"
name: Living Room Temperature 8
humidity:
name: "Living Room Humidity 8"
name: Living Room Humidity 8
address: 0x44
i2c_id: i2c_bus
update_interval: 15s
- platform: sts3x
name: "Living Room Temperature 9"
name: Living Room Temperature 9
address: 0x4A
i2c_id: i2c_bus
- platform: scd30
co2:
name: "Living Room CO2 9"
name: Living Room CO2 9
temperature:
id: scd30_temperature
name: "Living Room Temperature 9"
name: Living Room Temperature 9
humidity:
name: "Living Room Humidity 9"
name: Living Room Humidity 9
address: 0x61
update_interval: 15s
automatic_self_calibration: true
@ -913,12 +917,12 @@ sensor:
- platform: scd4x
id: scd40
co2:
name: "SCD4X CO2"
name: SCD4X CO2
temperature:
id: scd4x_temperature
name: "SCD4X Temperature"
name: SCD4X Temperature
humidity:
name: "SCD4X Humidity"
name: SCD4X Humidity
update_interval: 15s
automatic_self_calibration: true
altitude_compensation: 10m
@ -927,63 +931,63 @@ sensor:
i2c_id: i2c_bus
- platform: sgp30
eco2:
name: "Workshop eCO2"
name: Workshop eCO2
accuracy_decimals: 1
tvoc:
name: "Workshop TVOC"
name: Workshop TVOC
accuracy_decimals: 1
address: 0x58
update_interval: 5s
i2c_id: i2c_bus
- platform: sps30
pm_1_0:
name: "Workshop PM <1µm Weight concentration"
id: "workshop_PM_1_0"
name: Workshop PM <1µm Weight concentration
id: workshop_PM_1_0
pm_2_5:
name: "Workshop PM <2.5µm Weight concentration"
id: "workshop_PM_2_5"
name: Workshop PM <2.5µm Weight concentration
id: workshop_PM_2_5
pm_4_0:
name: "Workshop PM <4µm Weight concentration"
id: "workshop_PM_4_0"
name: Workshop PM <4µm Weight concentration
id: workshop_PM_4_0
pm_10_0:
name: "Workshop PM <10µm Weight concentration"
id: "workshop_PM_10_0"
name: Workshop PM <10µm Weight concentration
id: workshop_PM_10_0
pmc_0_5:
name: "Workshop PM <0.5µm Number concentration"
id: "workshop_PMC_0_5"
name: Workshop PM <0.5µm Number concentration
id: workshop_PMC_0_5
pmc_1_0:
name: "Workshop PM <1µm Number concentration"
id: "workshop_PMC_1_0"
name: Workshop PM <1µm Number concentration
id: workshop_PMC_1_0
pmc_2_5:
name: "Workshop PM <2.5µm Number concentration"
id: "workshop_PMC_2_5"
name: Workshop PM <2.5µm Number concentration
id: workshop_PMC_2_5
pmc_4_0:
name: "Workshop PM <4µm Number concentration"