Refactor configuration.yaml for Home Assistant 2026.2.2

- Ryddet commented-out integrationer og flyttet gamle konfigurationer til inkluderede mapper
- Organiseret sektioner i Core, Integrations og Modular Includes for bedre overskuelighed
- Tilføjet initial: off til input_booleans for stabil opstart
- Gjort template sensor claus_distance_home robust mod offline enheder
- Optimeret recorder: samlet entity_globs for bedre performance
- Logger begrænset til relevante custom components
- Forberedt http trusted_proxies til reverse proxy / NAS
- Sikret modulær struktur via !include_dir_merge_named og !include_dir_merge_list
This commit is contained in:
2026-03-15 16:57:10 +01:00
parent 807ebe619c
commit c95beecb2f
+55 -188
View File
@@ -1,21 +1,16 @@
##################################################
# Core Configuration
##################################################
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config: default_config:
# Text to speech
tts:
- platform: google_translate
language: 'da'
# base_url: !secret tts_base_url
homeassistant: homeassistant:
name: !secret name name: !secret name
external_url: "http://anneclaus.duckdns.org:8123" external_url: "http://anneclaus.duckdns.org:8123"
internal_url: "http://dethlefsen:8123" internal_url: "http://dethlefsen:8123"
auth_providers: auth_providers:
- type: homeassistant - type: homeassistant
customize: !include_dir_merge_named customize customize: !include_dir_merge_named include/customize/
latitude: !secret homeassistant_latitude latitude: !secret homeassistant_latitude
longitude: !secret homeassistant_longitude longitude: !secret homeassistant_longitude
elevation: !secret homeassistant_elevation elevation: !secret homeassistant_elevation
@@ -27,25 +22,13 @@ homeassistant:
media_dirs: media_dirs:
local: /config/www/media local: /config/www/media
# media_dirs:
# music: /music
# video: /video
# photo: /photo
## to avoid warning
#http:
# ssl_certificate: /ssl/cert.pem
# ssl_key: /ssl/privkey.pem
# base_url: !secret http_base_url
http: http:
use_x_forwarded_for: true use_x_forwarded_for: true
trusted_proxies: trusted_proxies:
- 127.0.0.1 - 127.0.0.1
# Tilføj IP for eventuel reverse proxy
# - 192.168.1.10
## ########################################
## Recorder
## ########################################
recorder: recorder:
purge_keep_days: 5 purge_keep_days: 5
exclude: exclude:
@@ -58,100 +41,53 @@ recorder:
entity_globs: entity_globs:
- sensor.clock* - sensor.clock*
- sensor.date* - sensor.date*
- sensor.glances*
- sensor.load_*m
- sensor.time* - sensor.time*
- sensor.uptime* - sensor.uptime*
- sensor.ipad_* - sensor.ipad_*
- sensor.claus_iphone12* - sensor.claus_iphone12*
- light.fordelingsgang*
- binary_sensor.ipad_* - binary_sensor.ipad_*
- switch.lille_badevaerelse_* - light.fordelingsgang*
- number.lille_badevaerelse_* - switch.*_*
- switch.sovevaerelse_* - number.*_*
- number.sovevaerelse_*
- switch.daniel_*
- number.andreas_*
- switch.andreas_*
- number.daniel_*
- switch.alrum_*
- number.alrum_*
- switch.kokken_*
- number.kokken_*
- switch.kontor_*
- number.kontor_*
- switch.badevaerelse_*
- number.badevaerelse_*
- light.bad_*
- light.spejl*
- sensor.daniels_iphone_7*
- binary_sensor.daniels_iphone_7*
- sensor.andreas_ipad*
- sensor.clauss_macbook*
entities: entities:
- sensor.home_assistant_v2_db - sensor.home_assistant_v2_db
- weather.openweathermap - weather.openweathermap
## ######################################## zone: !include include/zone/zones.yaml
## Zones
## ########################################
zone: !include include/zone/zones.yaml
## ########################################
## First run
## ########################################
input_boolean: input_boolean:
first_run: first_run:
initial: off
first_run_eve: first_run_eve:
initial: off
first_run_stue: first_run_stue:
initial: off
## ######################################## timer:
## nattis indkorsel:
## ######################################## duration: '00:10:00'
utility_meter:
badevaerelse_nat_taendinger_daglig:
name: "Badeværelse nat-tændinger dagligt"
source: input_number.nattis
cycle: daily
template:
## ######################################## - sensor:
## DuckDNS - name: claus_distance_home
## ######################################## unit_of_measurement: m
# https://www.home-assistant.io/blog/2017/09/27/effortless-encryption-with-lets-encrypt-and-duckdns/ state: >
# {% if is_state('device_tracker.clausiphone', 'home') %}
# read this: 0
# https://community.home-assistant.io/t/updating-duckdns-domain-failed/135623 {% else %}
duckdns: {{ distance('device_tracker.clausiphone', 'zone.home') | round(0) }}
domain: !secret duckdns_domain {% endif %}
access_token: !secret duckdns_access_token
python_script:
## ######################################## frontend:
## Spotify themes: !include_dir_merge_named include/themes/
## ########################################
# Example configuration.yaml entry
#spotify:
# client_id: !secret spotify_id
# client_secret: !secret spotify_secret
## ########################################
## Sonoff (HACS)
## ########################################
sonoff:
username: !secret sonoff_username
password: !secret sonoff_password
default_class: light
reload: always
## ########################################
## Garbage collection (HACS)
## ########################################
# garbage_collection: !include include/garbage/garbage.yaml
logger: logger:
default: warning default: warning
@@ -159,73 +95,32 @@ logger:
custom_components.affalddk: debug custom_components.affalddk: debug
pyaffalddk: debug pyaffalddk: debug
## ######################################## ##################################################
## Miele (HACS) # Integrations
## ######################################## ##################################################
#miele: duckdns:
# client_id: !secret miele_clientid domain: !secret duckdns_domain
# client_secret: !secret miele_secret access_token: !secret duckdns_access_token
# lang: en
## ######################################## sonoff:
## Roth touchline username: !secret sonoff_username
## ######################################## password: !secret sonoff_password
default_class: light
climate: reload: always
- platform: touchline
host: !secret touchlineIP
## ########################################
## Timer (for indkorsel automation)
## ########################################
timer:
indkorsel:
duration: '00:10:00'
## ########################################
## Darksky
## ########################################
#weather:
# - platform: darksky
# api_key: !secret darksky_api_key
# mode: daily
## ########################################
## Withings
## ########################################
#withings:
# client_id: !secret withings_clientid
# client_secret: !secret withings_secret
## ########################################
## Home Connect
## ########################################
#home_connect:
# client_id: !secret siemens_clientid
# client_secret: !secret siemens_secret
## ########################################
## Google
## ########################################
#google:
# client_id: !secret google_client_id
# client_secret: !secret google_secret
# track_new_calendar: false
google_assistant: google_assistant:
project_id: esh-home-assistant-b5231 project_id: esh-home-assistant-b5231
service_account: !include SERVICE_ACCOUNT.json service_account: !include SERVICE_ACCOUNT.json
report_state: true report_state: true
climate:
- platform: touchline
host: !secret touchlineIP
##################################################
# Modular Includes
##################################################
group: !include_dir_merge_named include/groups/ group: !include_dir_merge_named include/groups/
sensor: !include_dir_merge_list include/sensors/ sensor: !include_dir_merge_list include/sensors/
@@ -239,32 +134,4 @@ light: !include_dir_merge_list include/lights/
panel_iframe: !include_dir_merge_named include/panels/ panel_iframe: !include_dir_merge_named include/panels/
script: !include_dir_merge_named include/scripts/ script: !include_dir_merge_named include/scripts/
shell_command: !include_dir_merge_named include/shell_commands/ shell_command: !include_dir_merge_named include/shell_commands/
#switch: !include_dir_merge_list include/switches/ switch: !include_dir_merge_list include/switches/
utility_meter:
badevaerelse_nat_taendinger_daglig:
name: "Badeværelse nat-tændinger dagligt"
source: input_number.nattis
cycle: daily
template:
- sensor:
- name: claus_distance_home
unit_of_measurement: m
state: >
{{ distance('device_tracker.clausiphone', 'zone.home') | round(0) }}
# PYTHON
python_script:
# https://community.home-assistant.io/t/lovelace-gen-add-abilities-to-ui-lovelace-yaml/130328
#lovelace_gen:
#lovelace:
# resources: !include_dir_merge_list include/resources/
# mode: yaml
# Example configuration.yaml entry
frontend:
themes: !include_dir_merge_named themes