From 20122a7c5b6850d6a7c0cba7528f96eca05d48dc Mon Sep 17 00:00:00 2001 From: Ben Melchior Date: Wed, 2 Apr 2025 14:12:26 +0200 Subject: [PATCH] Enhance Home Assistant configuration with new automations and scripts - Updated .gitignore to include additional directories. - Added multiple automations for home control, including doorbell notifications and sleep mode management in automations.yaml. - Introduced a new script for mobile notifications in scripts.yaml. - Created new KNX configuration files for buttons, sensors, and switches to improve home automation capabilities. - Updated secrets.yaml to streamline sensitive information management. --- .cursor/mcp.json | 23 ++++ .gitignore | 6 +- automations.yaml | 249 ++++++++++++++++++++++++++++++++++- knx/button.yaml | 5 + knx/knx.yaml | 5 +- knx/knx_groups_not_added.csv | 9 +- knx/sensor.yaml | 13 ++ knx/switch.yaml | 11 ++ scripts.yaml | 27 ++++ secrets.yaml | 3 - 10 files changed, 338 insertions(+), 13 deletions(-) create mode 100644 .cursor/mcp.json create mode 100644 knx/button.yaml create mode 100644 knx/sensor.yaml create mode 100644 knx/switch.yaml diff --git a/.cursor/mcp.json b/.cursor/mcp.json new file mode 100644 index 0000000..14365f4 --- /dev/null +++ b/.cursor/mcp.json @@ -0,0 +1,23 @@ +{ + "project": { + "name": "home-assistant", + "type": "home-automation" + }, + "database": { + "type": "postgresql", + "connection_string": "!secret psql_string", + "retry_wait": 15 + }, + "configuration": { + "main_config": "configuration.yaml", + "secrets": "secrets.yaml", + "automations": "automations.yaml", + "scripts": "scripts.yaml" + }, + "directories": { + "custom_components": "custom_components", + "blueprints": "blueprints", + "tts": "tts", + "knx": "knx" + } +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index f16ac66..57acc7a 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,8 @@ custom_components/ deps/ tts/ .HA_VERSION -home-assistant* \ No newline at end of file +home-assistant* +zigbee* +image/ +themes/ +www/ \ No newline at end of file diff --git a/automations.yaml b/automations.yaml index 0637a08..4771100 100644 --- a/automations.yaml +++ b/automations.yaml @@ -1 +1,248 @@ -[] \ No newline at end of file +- id: '1742925721017' + alias: Klingel Haustür + description: '' + triggers: + - trigger: state + entity_id: + - sensor.8000_state + to: In use + conditions: + - condition: state + entity_id: input_boolean.schlaffmodus + state: 'off' + - condition: state + entity_id: sensor.8000_connected_line + attribute: Exten + state: '7001' + actions: + - action: media_player.play_media + target: + entity_id: media_player.kuche + data: + announce: true + media_content_id: media-source://media_source/local/hass_media/doorbell.wav + media_content_type: audio/x-wav + extra: + volume: 50 + - sequence: + - action: input_boolean.turn_on + metadata: {} + data: {} + target: + entity_id: input_boolean.videophone_anzeigen + - delay: + hours: 0 + minutes: 2 + seconds: 0 + milliseconds: 0 + - action: input_boolean.turn_off + metadata: {} + data: {} + target: + entity_id: input_boolean.videophone_anzeigen + - action: script.cobe_haus_benachrichtigung + metadata: {} + data: + message: Dass een un der Hausdier. + mode: single +- id: '1743358810428' + alias: Einschlaffmodus einschalten + description: '' + triggers: + - trigger: state + entity_id: + - binary_sensor.einschlaffmodus_zeitsensor + from: 'off' + to: 'on' + - trigger: state + entity_id: + - binary_sensor.schlaffmodus_helligkeit + for: + hours: 0 + minutes: 5 + seconds: 0 + from: 'off' + to: 'on' + conditions: + - condition: state + entity_id: input_boolean.einschlaffmodus + state: 'off' + - condition: state + entity_id: input_boolean.schlaffmodus + state: 'off' + - condition: state + entity_id: binary_sensor.einschlaffmodus_zeitsensor + state: 'on' + - condition: state + entity_id: binary_sensor.schlaffmodus_helligkeit + state: 'on' + actions: + - action: input_boolean.turn_on + metadata: {} + data: {} + target: + entity_id: input_boolean.einschlaffmodus + mode: single +- id: '1743361311728' + alias: Schlaffmodus einschalten + description: '' + triggers: + - trigger: time + at: '22:00:00' + conditions: [] + actions: + - action: input_boolean.turn_off + metadata: {} + data: {} + target: + entity_id: input_boolean.einschlaffmodus + - action: input_boolean.turn_on + metadata: {} + data: {} + target: + entity_id: input_boolean.schlaffmodus + - action: automation.trigger + metadata: {} + data: + skip_condition: true + target: + entity_id: + - automation.nachtsbeleuchtung_einschalten + - automation.rollaten_automatisch_schliessen + mode: single +- id: '1743361716570' + alias: Schlaffmodus ausschalten + description: '' + triggers: + - trigger: state + entity_id: + - binary_sensor.aufwachmodus_zeitsensor + from: 'off' + to: 'on' + - trigger: state + entity_id: + - binary_sensor.schlaffmodus_helligkeit + from: 'on' + to: 'off' + for: + hours: 0 + minutes: 5 + seconds: 0 + conditions: + - condition: state + entity_id: binary_sensor.aufwachmodus_zeitsensor + state: 'on' + - condition: state + entity_id: binary_sensor.schlaffmodus_helligkeit + state: 'off' + for: + hours: 0 + minutes: 5 + seconds: 0 + actions: + - action: input_boolean.turn_off + metadata: {} + data: {} + target: + entity_id: input_boolean.schlaffmodus + mode: single +- id: '1743362231963' + alias: Rollaten automatisch schließen + description: '' + triggers: + - trigger: state + entity_id: + - input_boolean.einschlaffmodus + from: 'off' + to: 'on' + conditions: + - condition: state + entity_id: input_boolean.rolladenautomatik + state: 'on' + - condition: state + entity_id: input_boolean.rolladen_automatisch_offnen_schliessen + state: 'on' + actions: + - action: cover.close_cover + metadata: {} + data: {} + target: + floor_id: + - obergeschoss_2 + - obergeschoss_1 + - erdgeschoss + mode: single +- id: '1743363549729' + alias: Rolladen automatisch öffnen + description: '' + triggers: + - trigger: state + entity_id: + - input_boolean.schlaffmodus + from: 'on' + to: 'off' + - trigger: time + at: 09:00:00 + conditions: [] + actions: + - action: cover.open_cover + metadata: {} + data: {} + target: + floor_id: erdgeschoss + area_id: + - badezimmer + - gallerie + - badezimmer_og2 + - millie + - if: + - condition: time + after: 09:00:00 + then: + - action: cover.open_cover + metadata: {} + data: {} + target: + area_id: + - emil + - schlafzimmer + mode: single +- id: '1743363740983' + alias: Nachtsbeleuchtung einschalten + description: '' + triggers: + - trigger: state + entity_id: + - input_boolean.einschlaffmodus + from: 'off' + to: 'on' + conditions: [] + actions: + - action: light.turn_on + metadata: {} + data: + brightness_pct: 1 + target: + entity_id: + - light.lda_og1_th_01 + - light.lda_eg_th_01 + mode: single +- id: '1743363942165' + alias: Nachtsbeleuchtung ausschalten + description: '' + triggers: + - trigger: state + entity_id: + - input_boolean.schlaffmodus + from: 'on' + to: 'off' + conditions: [] + actions: + - action: light.turn_off + metadata: {} + target: + entity_id: + - light.lda_og1_th_01 + - light.lda_eg_th_01 + data: {} + mode: single diff --git a/knx/button.yaml b/knx/button.yaml new file mode 100644 index 0000000..db926cb --- /dev/null +++ b/knx/button.yaml @@ -0,0 +1,5 @@ +- name: 'Garagentor 1' + address: '5/4/0' + +- name: 'Garagentor 2' + address: '5/4/1' diff --git a/knx/knx.yaml b/knx/knx.yaml index f8ad377..585efd8 100644 --- a/knx/knx.yaml +++ b/knx/knx.yaml @@ -1,3 +1,6 @@ light: !include light.yaml cover: !include cover.yaml -climate: !include climate.yaml \ No newline at end of file +climate: !include climate.yaml +button: !include button.yaml +sensor: !include sensor.yaml +switch: !include switch.yaml diff --git a/knx/knx_groups_not_added.csv b/knx/knx_groups_not_added.csv index cd6379d..0f03d2b 100644 --- a/knx/knx_groups_not_added.csv +++ b/knx/knx_groups_not_added.csv @@ -1,5 +1,5 @@ KNX Group,Name -0/0/1,Nachtmodus + 0/1/0,Z_UG_FL_PM Schalten 0/1/1,Z_UG_FL_PM Dimmen 0/1/2,Z_UG_FL_PM Wert senden @@ -42,8 +42,6 @@ KNX Group,Name 2/5/2,SE_EG_WC_Temp 2/5/3,SE_EG_FL_Temp 2/5/5,SE_EG_WC_Proximity -3/4/0,SE_OG1_FL_PR -3/4/1,SE_OG1_FL_LUX 3/5/0,SE_OG1_SZ1_Temp 3/5/1,SE_OG1_SZ2_Temp 3/5/2,SE_OG1_BZ_Temp @@ -51,10 +49,7 @@ KNX Group,Name 4/5/0,SE_OG2_SZ_TEMP 4/5/1,SE_OG2_BZ_TEMP 4/5/2,SE_OG2_TR_TEMP -5/4/2,SE_AU_EG_LUX -5/4/3,SE_AU_EG_PR + 5/5/0,SE_AU_GA_Temp 5/1/30,SS_AU_EB_01 Schalten 5/1/33,SS_AU_EB_01 Rückmeldung Status -5/4/0,Garagentor 1 -5/4/1,Garagentor 2 \ No newline at end of file diff --git a/knx/sensor.yaml b/knx/sensor.yaml new file mode 100644 index 0000000..e57e4c7 --- /dev/null +++ b/knx/sensor.yaml @@ -0,0 +1,13 @@ +- name: 'SE_AU_EG_LUX' + state_address: '5/4/2' + type: illuminance + device_class: illuminance + +- name: 'SE_OG1_FL_LUX' + state_address: '3/4/1' + type: illuminance + device_class: illuminance + +- name: 'SE_EG_WC_Proximity' + state_address: '2/5/5' + type: pulse diff --git a/knx/switch.yaml b/knx/switch.yaml new file mode 100644 index 0000000..1bf9288 --- /dev/null +++ b/knx/switch.yaml @@ -0,0 +1,11 @@ +- name: 'SE_AU_EG_PR' + address: '5/4/3' + state_address: '5/4/3' + +- name: 'SE_OG1_FL_PR' + address: '3/4/0' + state_address: '3/4/0' + +- name: 'Nachtmodus' + address: '0/0/1' + state_address: '0/0/1' diff --git a/scripts.yaml b/scripts.yaml index e69de29..160a0ec 100644 --- a/scripts.yaml +++ b/scripts.yaml @@ -0,0 +1,27 @@ +cobe_haus_benachrichtigung: + sequence: + - action: notify.mobile_app_iphone + metadata: {} + data: + message: '{{ message }}' + title: '{{ title }}' + - action: notify.mobile_app_iphone_von_conny + metadata: {} + data: + message: '{{ message }}' + title: '{{ title }}' + fields: + title: + selector: + text: + name: Titel + description: Titel der Benachrichtigung + default: COBE Haus + message: + selector: + text: + name: Nachricht + description: Nachricht + required: true + alias: COBE Haus Benachrichtigung + description: '' diff --git a/secrets.yaml b/secrets.yaml index 587a2aa..50a969f 100644 --- a/secrets.yaml +++ b/secrets.yaml @@ -1,4 +1 @@ - -# Use this file to store secrets like usernames and passwords. -# Learn more at https://www.home-assistant.io/docs/configuration/secrets/ psql_string: postgresql://hass:FTXZ9r8iw0fTT655Q6tePTzp@synology.cobe.space:5433/hass