-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfiguration.yaml
More file actions
653 lines (616 loc) · 22.6 KB
/
Copy pathconfiguration.yaml
File metadata and controls
653 lines (616 loc) · 22.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
# =============================================================================
# HOME ASSISTANT CONFIGURATION
# =============================================================================
# Infrastructure:
# - Home Assistant: 192.168.1.60 (Proxmox VM)
# - MariaDB: 192.168.1.61:3306 (LXC, 10-day retention)
# - InfluxDB: 192.168.1.62:8086 (LXC, long-term storage)
# - MQTT: 192.168.1.63:1883 (Mosquitto, LXC)
# - Zigbee2MQTT: localhost:8099 (Add-on, ConBee II)
# =============================================================================
# Default Home Assistant setup (frontend, api, etc)
default_config:
# Entity customization
homeassistant:
customize:
vacuum.roborock_de_118057288_s5:
friendly_name: "Gun"
sensor.roborock_de_118057288_s5_battery_level_p_3_1:
friendly_name: "Gun batteri"
sensor.roborock_de_118057288_s5_charging_state_p_3_2:
friendly_name: "Gun laddning"
select.roborock_de_118057288_s5_mode_p_2_2:
friendly_name: "Gun sugläge"
# Frontend themes
frontend:
themes: !include_dir_merge_named themes
# =============================================================================
# LOVELACE DASHBOARDS
# =============================================================================
lovelace:
mode: storage
dashboards:
lovelace-hem:
mode: yaml
title: Hem
icon: mdi:home
show_in_sidebar: true
filename: dashboards/hem.yaml
lovelace-elektricitet:
mode: yaml
title: Elektricitet
icon: mdi:flash
show_in_sidebar: true
filename: dashboards/elektricitet.yaml
lovelace-klimat:
mode: yaml
title: Klimat
icon: mdi:thermometer
show_in_sidebar: true
filename: dashboards/klimat.yaml
lovelace-batteri:
mode: yaml
title: Batteri
icon: mdi:battery
show_in_sidebar: true
filename: dashboards/batteri.yaml
lovelace-system:
mode: yaml
title: System
icon: mdi:cog
show_in_sidebar: true
filename: dashboards/system.yaml
lovelace-vatten:
mode: yaml
title: Vatten
icon: mdi:water
show_in_sidebar: true
filename: dashboards/vatten.yaml
lovelace-entre:
mode: yaml
title: Entré
icon: mdi:tablet-dashboard
show_in_sidebar: true
filename: dashboards/entre.yaml
lovelace-holk:
mode: yaml
title: Fågelholk
icon: mdi:bird
show_in_sidebar: true
filename: dashboards/holk.yaml
lovelace-kallaren:
mode: yaml
title: Källaren
icon: mdi:bottle-wine
show_in_sidebar: true
filename: dashboards/kallaren.yaml
# =============================================================================
# INCLUDED FILES
# =============================================================================
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# =============================================================================
# INPUT HELPERS
# =============================================================================
input_button:
generate_claude_snapshot:
name: "Generate Claude Snapshot"
icon: mdi:robot
git_push:
name: "Git Push"
icon: mdi:cloud-upload
input_boolean:
export_begransning_aktiv:
name: "Exportbegränsning aktiv"
icon: mdi:transmission-tower-export
solceller_export_begransad:
name: "Solceller export begränsad"
icon: mdi:solar-power-variant-outline
# Sätts när första KRITISKA strandnings-larmet skickats; resten av episoden
# blir då vanliga notiser. Nollställs av gordon_strand_reset när Gordon är
# tillbaka i normal drift/docka.
gordon_strand_larm_skickat:
name: "Gordon strandlarm skickat"
icon: mdi:alert-circle
# =============================================================================
# INPUT SELECT
# =============================================================================
input_select:
# Filtret i källardashboardens beståndsvy. Alternativen måste matcha
# produktgruppernas namn i Grocy exakt (de ägs av dryck-appens bootstrap).
kallaren_filter:
name: "Källaren filter"
icon: mdi:filter-variant
options:
- "Allt"
- "Rött vin"
- "Vitt vin"
- "Rosévin"
- "Mousserande vin"
- "Öl"
initial: "Allt"
# Fylls automatiskt av automation.kallaren_fyll_flaskvaljaren från
# sensor.kallaren_grocy. Placeholdern nedan är startvärdet innan sensorn
# hunnit läsa (input_select kräver minst ett alternativ).
kallaren_flaska:
name: "Källaren flaska"
icon: mdi:bottle-wine-outline
options:
- "— källaren är tom —"
# =============================================================================
# INPUT TEXT
# =============================================================================
input_text:
kallaren_smaknotering:
name: "Källaren smaknotering"
icon: mdi:note-text-outline
min: 0
max: 255
# Format: "<produkt-id>|<namn>". Sätts av script.kallaren_drick_upp så att
# betygsättningen fungerar även när flaskan lämnat lagret och därmed
# försvunnit ur väljaren.
kallaren_senast_druckit:
name: "Källaren senast druckit"
icon: mdi:history
min: 0
max: 255
# =============================================================================
# UTILITY METERS - Track consumption per period
# =============================================================================
utility_meter:
# Water consumption per day
vatten_dag:
source: sensor.water_meter_t_display_total_water_consumption
name: "Vattenförbrukning Dag"
cycle: daily
# Water consumption per month
vatten_manad:
source: sensor.water_meter_t_display_total_water_consumption
name: "Vattenförbrukning Månad"
cycle: monthly
# Water consumption per year
vatten_ar:
source: sensor.water_meter_t_display_total_water_consumption
name: "Vattenförbrukning År"
cycle: yearly
input_number:
export_begransning_pris:
name: "Prisgräns för export"
icon: mdi:currency-usd
min: -1
max: 2
step: 0.1
unit_of_measurement: "SEK/kWh"
initial: 0
vattenpris_per_m3:
name: "Vattenpris per m³"
icon: mdi:water
min: 0
max: 100
step: 0.5
unit_of_measurement: "SEK/m³"
initial: 23.5 # Tekniska verken Linköping
igrill_maltemperatur:
name: "iGrill måltemperatur"
icon: mdi:thermometer-alert
min: 30
max: 100
step: 1
unit_of_measurement: "°C"
initial: 70
kallaren_antal:
name: "Källaren antal att dricka upp"
icon: mdi:numeric
min: 1
max: 12
step: 1
initial: 1
kallaren_betyg:
name: "Källaren betyg"
icon: mdi:star
min: 1
max: 5
step: 0.5
initial: 3
# Gordon-mowerns senast kända GPS-position. INGEN 'initial' → värdet
# återställs (persistens) över omstart, så kartmarkören överlever reboot
# och GPS-bortfall i dockan. Uppdateras av automation gordon_gps_tracker.
gordon_last_lat:
name: "Gordon senaste latitud"
icon: mdi:map-marker
min: -90
max: 90
step: 0.0000001
mode: box
gordon_last_lon:
name: "Gordon senaste longitud"
icon: mdi:map-marker
min: -180
max: 180
step: 0.0000001
mode: box
# =============================================================================
# SHELL COMMANDS
# =============================================================================
shell_command:
git_pull: "cd /config && git pull origin master 2>&1"
git_pull_force: "cd /config && git fetch origin && git reset --hard origin/master 2>&1"
git_status: "cd /config && git status --short 2>&1"
git_diff_files: "cd /config && git diff --name-only HEAD~1 HEAD 2>&1"
git_has_local_changes: "cd /config && git status --porcelain 2>&1"
git_untracked_files: "cd /config && git ls-files --others --exclude-standard 2>&1"
git_smart_commit_push: "/config/scripts/git_commit_and_push.sh"
# Note: file parameter should be a simple filename, not a path with special chars
git_add_file: 'cd /config && git add "{{ file }}"'
git_ignore_file: 'echo "{{ file }}" >> /config/.gitignore'
generate_claude_snapshot: "python3 /config/scripts/generate_claude_snapshot.py"
# =============================================================================
# INTEGRATIONS
# =============================================================================
# Camera streaming
stream:
# =============================================================================
# NOTIFICATION GROUPS
# =============================================================================
notify:
- platform: group
name: "Vitvaror varningar"
services:
- service: mobile_app_petter_iphone
- service: persistent_notification # Fallback if phone unreachable
# =============================================================================
# ALERTS - Critical System Monitoring
# =============================================================================
alert:
zigbee2mqtt_offline:
name: "Zigbee2MQTT offline"
entity_id: binary_sensor.zigbee2mqtt_bridge_connection_state
state: "off"
repeat:
- 15
- 30
- 60
can_acknowledge: true
skip_first: false
notifiers:
- mobile_app_petter_iphone
title: "⚠️ Zigbee2MQTT"
message: "Zigbee2MQTT-bryggan har tappat anslutningen"
disk_space_low:
name: "Disk space low"
entity_id: binary_sensor.disk_low
state: "on"
repeat:
- 60
- 360
can_acknowledge: true
skip_first: false
notifiers:
- mobile_app_petter_iphone
title: "⚠️ Diskutrymme"
message: "Diskutrymmet är över 85% - kontrollera loggar och databas"
memory_high:
name: "Memory usage high"
entity_id: binary_sensor.memory_high
state: "on"
repeat:
- 30
- 60
can_acknowledge: true
skip_first: true
notifiers:
- mobile_app_petter_iphone
title: "⚠️ Minne"
message: "Minnesanvändningen är över 90%"
# =============================================================================
# LOGGING
# =============================================================================
logger:
default: warning
logs:
custom_components.xiaomi_cloud_map_extractor: warning
# =============================================================================
# MODBUS - Fronius GEN24 Inverter
# =============================================================================
modbus:
- name: fronius
type: tcp
host: 192.168.4.234
port: 502
sensors:
- name: "Fronius Modbus AC Power"
address: 40092
input_type: holding
slave: 1
data_type: float32
swap: word
unit_of_measurement: "W"
scan_interval: 30
# =============================================================================
# MQTT ENTITIES
# =============================================================================
# Gordon-mowerns kartmarkör. Ersätter den utfasade device_tracker.see (borttagen
# i HA Core 2027.5). Automationen "Gordon - uppdatera GPS-tracker" publicerar
# lat/lon till attribut-topicen med retain: true — brokern spelar upp senaste
# positionen vid varje HA-omstart, så markören finns direkt även i dockan.
mqtt:
device_tracker:
# OBS: object_id är discovery-only och avvisas här ("extra keys not allowed").
# Entity_id kommer från name → device_tracker.gordon.
- name: Gordon
unique_id: gordon_gps_tracker
json_attributes_topic: "ha/gordon/gps/attributes"
source_type: gps
icon: mdi:robot-mower
# =============================================================================
# SENSORS
# =============================================================================
template: !include template_sensors.yaml
# sql: !include sql_sensors.yaml # Replaced by power_max_tracker integration
sensor: !include statistics_sensors.yaml
# =============================================================================
# COMMAND LINE SENSORS
# =============================================================================
command_line:
- sensor:
name: "Git Status"
unique_id: git_status
command: "cd /config && git log -1 --format='{\"hash\": \"%h\", \"message\": \"%s\", \"age\": \"%cr\"}'"
value_template: "{{ value_json.hash }}"
json_attributes:
- hash
- message
- age
scan_interval: 300
# Källaren: dryckesbeståndet i Grocy. Skriptet joinar stock + produkter (som
# bär userfields) + grupper + locations — Grocy-integrationen exponerar inte
# userfields, så årgång/druva/land/betyg finns inte att få den vägen.
# State = antal flaskor, allt övrigt i attributen. Sensorn är exkluderad från
# recorder och InfluxDB längre ner: items-listan skrivs om var 5:e minut och
# skulle svälla databasen. Trend tas från sensor.kallaren_flaskor i stället.
- sensor:
name: "Källaren Grocy"
unique_id: kallaren_grocy
command: "python3 /config/scripts/grocy_kallaren.py"
value_template: "{{ value_json.bottles }}"
unit_of_measurement: "flaskor"
json_attributes:
- kinds
- value
- avg_rating
- groups
- by_country
- by_vintage
- items
- error
- n_rott_vin
- n_vitt_vin
- n_rosevin
- n_mousserande_vin
- n_ol
scan_interval: 300
command_timeout: 60
rest_command:
ask_claude:
url: "http://localhost:7682/api/claude"
method: POST
content_type: "application/json"
payload: >
{
"prompt": "{{ prompt }}",
"options": {
"timeout": {{ timeout | default(60) }}
}
}
# Fågelholk: starta/avsluta ett manuellt Frigate-event (motion-triggat klipp).
# Klippet hämtas ur recordings, lagras på NAS, syns i Media → Frigate → birdhouse.
birdhouse_clip_start:
url: "http://ccab4aaf-frigate:5000/api/events/birdhouse/motion/create"
method: POST
content_type: "application/json"
payload: '{"include_recording": true, "source_type": "api"}'
birdhouse_clip_end:
url: "http://ccab4aaf-frigate:5000/api/events/{{ event_id }}/end"
method: PUT
content_type: "application/json"
payload: "{}"
# Källaren: dricka upp en flaska. location_id 3 = Källare. Id:t är hårdkodat
# här (rest_command kan inte slå upp något) — om locationen någon gång får ett
# nytt id syns det som att konsumtionen inte gör något, och skriptet
# grocy_kallaren.py börjar samtidigt returnera ett tydligt fel.
grocy_consume:
url: "http://192.168.1.66:9283/api/stock/products/{{ product_id }}/consume"
method: POST
content_type: "application/json"
headers:
GROCY-API-KEY: !secret grocy_api_key
payload: '{"amount": {{ amount | int(1) }}, "transaction_type": "consume", "location_id": 3}'
# Källaren: sätta betyg + smaknotering. PUT på userfields MERGE:ar i Grocy
# (verifierat 2026-08-05) — övriga fält som årgång och druva rörs inte.
# tasting_notes utelämnas helt ur payloaden när ingen notering finns, så
# ett andra betygstryck ("4.5 i stället för 4") inte skriver över en
# tidigare notering med en tom sträng — Grocy behåller då det befintliga
# värdet för den nyckeln.
grocy_set_userfields:
url: "http://192.168.1.66:9283/api/userfields/products/{{ product_id }}"
method: PUT
content_type: "application/json"
headers:
GROCY-API-KEY: !secret grocy_api_key
payload: '{"rating": {{ rating | float(3) }}{% if notes %}, "tasting_notes": {{ notes | to_json }}{% endif %}}'
# =============================================================================
# REST SENSORS
# =============================================================================
# Robonect GPS - polls mower position directly (MQTT path not working post V1.6
# firmware). Lat/lng come as NMEA strings ("58°22.1513 N") - decoded in
# template sensors below.
rest:
- resource: "http://192.168.4.71/json?cmd=gps"
username: !secret robonect_username
password: !secret robonect_password
encoding: latin-1
scan_interval: 10
sensor:
# State = antal satelliter. Lat/lon exponeras INTE som "latitude"/"longitude"
# attribut här – det får HA:s Map-vy att krascha på NMEA-strängen.
# Råa NMEA-strängar exponeras som separata entiteter nedan.
# GPS-blocket saknas helt när Robonect svarar {"successful": false,
# "error_code": 253, "No GPS installed"} (t.ex. efter att mowerns batteri
# tagit slut och Robonect-enheten tappat sin GPS-modul). Vakta därför både
# value_json (HTTP-svar uteblev) och .gps (modulen rapporterar inget) så
# sensorerna ger rent 0/'' i stället för att spamma loggen med fel.
- name: "Gordon GPS"
unique_id: gordon_gps
value_template: >-
{{ value_json.gps.satellites if value_json is defined and value_json.gps is defined else 0 }}
unit_of_measurement: "satellites"
- name: "Gordon GPS Raw Latitude"
unique_id: gordon_gps_raw_latitude
value_template: >-
{{ value_json.gps.latitude if value_json is defined and value_json.gps is defined else '' }}
- name: "Gordon GPS Raw Longitude"
unique_id: gordon_gps_raw_longitude
value_template: >-
{{ value_json.gps.longitude if value_json is defined and value_json.gps is defined else '' }}
# Fågelholk NAS-monteringsvakt: antal klasser i holk-datasetet via Frigate-API:t.
# 3 = frisk (dataset på NAS synligt). 0 = Frigate skriver på HA:s lokala disk i stället
# för NAS:en → klasserna "försvinner". OBS orsaken är INTE att NFS-monteringen tappats
# (den står kvar "active"), utan att Supervisors BIND-montering av den in i /media/frigate
# vägrar med MountTargetNotEmptyError när det redan ligger lokal data i katalogen.
# Vid Frigate-omstart blir sensorn unavailable (inte 0), så larm-automationen (below 1,
# 30 min) triggar inte på vanliga omstarter. Felläge + fix: se Birdhouse-avsnittet i CLAUDE.md.
- resource: "http://ccab4aaf-frigate:5000/api/classification/holk/dataset"
scan_interval: 900
sensor:
- name: "Frigate holk dataset klasser"
unique_id: frigate_holk_dataset_categories
unit_of_measurement: "klasser"
value_template: >-
{{ value_json.categories | count if value_json is defined
and value_json.categories is defined else none }}
# =============================================================================
# COVER GROUPS
# =============================================================================
cover:
- platform: group
name: "Gästrum gardiner HA"
unique_id: gastrum_gardiner_ha
entities:
- cover.gastrum_hoger_gardin
- cover.gastrum_vanster_gardin
# =============================================================================
# RECORDER (MariaDB) - Short-term operational data
# =============================================================================
recorder:
db_url: !secret mysql_url
purge_keep_days: 10
commit_interval: 1
exclude:
# Domains that don't need history
domains:
- automation
- updater
- script
- scene
- persistent_notification
- input_button
# Entity patterns to exclude (keep recorder leaner)
entity_globs:
# Time-based sensors
- sensor.sun_*
- sensor.*_uptime*
- sensor.*_last_boot*
- sensor.*_last_seen*
- sensor.last_seen* # iCloud3 sensors
- sensor.*_last_update*
- sensor.*_next_update*
# Signal quality (too noisy, updates frequently)
- sensor.rssi* # Zigbee RSSI
- sensor.*_linkquality*
- sensor.*_wifi_signal*
# System monitoring (NVR/NAS - updates every ~2s, ~900k rows/10d)
- sensor.*_cpu_utilization*
- sensor.*_memory_utilization*
- sensor.system_monitor_*
- sensor.*_phy_temperature # Zeus NVR chip temp
# Fronius voltage/frequency (noisy, not used for energy monitoring)
- sensor.fronius_*_ac_voltage_*
- sensor.fronius_*_line_frequency
# Fronius per-phase & DC sub-sensors (~90k rows/10d each, not on energy dashboard;
# aggregate power/consumption sensors solarnet_*, meter_1_power, okand_effekt stay recorded)
- sensor.fronius_*_ac_current* # total + per-phase current (not energy)
- sensor.fronius_*_power_l* # per-phase power L1/L2/L3 (total power_ kept)
- sensor.fronius_*_dc_voltage # MPPT DC voltage
- sensor.fronius_*_reactive_power # reactive power
# Flapping "battery low" binary alerts (Netatmo, ~62k rows/10d; live alerts unaffected)
- binary_sensor.*_battery_plus_low
# Updates
- binary_sensor.*_update*
- update.*
# Specific entities
entities:
- sun.sun
- sensor.date
- sensor.time
- sensor.date_time
- sensor.date_time_iso
- sensor.time_date
- sensor.time_utc
# Källaren: bär hela items-listan som attribut, skrivs om var 5:e min.
# Trend finns i sensor.kallaren_flaskor i stället.
- sensor.kallaren_grocy
# =============================================================================
# INFLUXDB - Long-term analytics (Grafana, trends)
# =============================================================================
influxdb:
max_retries: 3
default_measurement: state
# Only include specific domains for long-term storage
include:
domains:
- sensor
- binary_sensor
- climate
- weather
- person
- device_tracker
- cover
# Specific entities worth tracking
entities:
- switch.ugn_av_pa
- switch.spishall_av_pa
- switch.ftx
- switch.casa
exclude:
# Exclude noisy/unneeded sensors from long-term storage
entity_globs:
# Time-based sensors (constant updates)
- sensor.sun_*
- sensor.*_uptime*
- sensor.*_last_boot*
- sensor.*_last_seen*
- sensor.last_seen* # iCloud3 sensors (no underscore prefix)
- sensor.*_last_update*
- sensor.*_next_update*
# System monitoring (not useful for long-term trends)
- sensor.system_monitor_*
- sensor.*_cpu_utilization*
- sensor.*_memory_utilization*
- sensor.*_diskens_* # UniFi disk write speed (Swedish)
# Signal quality (too noisy)
- sensor.rssi* # Zigbee RSSI sensors
- sensor.*_linkquality*
- sensor.*_wifi_signal*
# Updates
- binary_sensor.*_update*
- sensor.*_battery_level # if using battery_notes
entities:
- sun.sun
- sensor.date
- sensor.time
- sensor.date_time
- sensor.date_time_iso
- sensor.kallaren_grocy # stor attributlista, se recorder-excluden
# Roborock vacuum room map - integer attribute keys crash InfluxDB writer
- sensor.gun_rooms