From 1ac1d49b7900762606d1f0a54461d9e5279ad45c Mon Sep 17 00:00:00 2001 From: pierre Date: Wed, 19 Jun 2024 13:34:17 +0100 Subject: [PATCH] :boom: add all the files --- config/automations.yaml | 548 ++++++++++++++++++++++++++++++++++++++ config/configuration.yaml | 98 +++++++ config/scenes.yaml | 72 +++++ config/scripts.yaml | 25 ++ config/secrets.yaml | 4 + homeassistant.kube.yaml | 63 +++++ 6 files changed, 810 insertions(+) create mode 100755 config/automations.yaml create mode 100755 config/configuration.yaml create mode 100755 config/scenes.yaml create mode 100755 config/scripts.yaml create mode 100755 config/secrets.yaml create mode 100644 homeassistant.kube.yaml diff --git a/config/automations.yaml b/config/automations.yaml new file mode 100755 index 0000000..0505541 --- /dev/null +++ b/config/automations.yaml @@ -0,0 +1,548 @@ +- id: '1701898342429' + alias: Heater morning week_days + description: '' + trigger: + - platform: time + at: 07:00:00 + condition: + - condition: time + weekday: + - mon + - tue + - wed + - thu + - fri + action: + - service: scene.turn_on + target: + entity_id: scene.stop + metadata: {} + mode: single +- id: '1701898433510' + alias: Telegram | Heater | stop the heater the night + description: '' + trigger: + - platform: time + at: '23:00:00' + condition: [] + action: + - device_id: 4cb086e116a5bcebc418f1bfc404eb77 + domain: climate + entity_id: 1ff901854ae3aaaf57861d7c5ec8aa76 + type: set_hvac_mode + hvac_mode: 'off' + mode: single +- id: '1701898460588' + alias: 'start ' + description: '' + trigger: + - platform: time + at: '21:35:00' + condition: [] + action: + - device_id: 4cb086e116a5bcebc418f1bfc404eb77 + domain: climate + entity_id: 1ff901854ae3aaaf57861d7c5ec8aa76 + type: set_hvac_mode + hvac_mode: heat + mode: single +- id: '1701956475447' + alias: Automation - Notify Sunrise + description: '' + trigger: + - platform: sun + event: sunrise + offset: 0 + condition: [] + action: + - service: telegram_bot.send_message + data: + message: Sunrise + enabled: false + - service: telegram_bot.send_sticker + data: + sticker_id: CAACAgIAAxkBAAEK_dplgLudEeWB90FrB13qA7SbLA-CPgACxAADUomRI-xxLnj5ti4GMwQ + mode: single +- id: '1701956675418' + alias: Notify Sunset + description: '' + trigger: + - platform: sun + event: sunset + offset: 0 + condition: [] + action: + - service: telegram_bot.send_message + data: + message: Sunset + enabled: false + - service: telegram_bot.send_sticker + data: + authentication: digest + sticker_id: CAACAgIAAxkBAAEK_dhlgLtpoWN_6i5pKYQecLkiiA07wgAC3AADUomRI0xEmhyV4R2OMwQ + mode: single +- id: '1701991999860' + alias: kodi notification + description: '' + trigger: [] + condition: [] + action: + - service: notify.kodi + data: + message: test + mode: single +- id: '1702066353439' + alias: Heater morning week_end + description: '' + trigger: + - platform: time + at: 06:30:00 + condition: + - condition: and + conditions: + - condition: state + entity_id: input_select.at_home_this_weekend + state: Present + - condition: time + weekday: + - sat + - sun + - alias: Test if the Emergency button is not ON + condition: not + conditions: + - condition: state + entity_id: input_boolean.emergency_stop + state: 'on' + action: + - service: scene.turn_on + target: + entity_id: scene.normal_heat + metadata: {} + - wait_for_trigger: + - platform: time + at: '10:00:00' + - service: scene.turn_on + target: + entity_id: scene.stop + metadata: {} + mode: single +- id: '1702067064137' + alias: Heater afternoon week_days + description: '' + trigger: + - platform: time + at: '18:00:00' + condition: + - condition: and + conditions: + - condition: not + conditions: + - condition: state + entity_id: input_boolean.emergency_stop + state: 'on' + alias: Test if the Emergency button is not ON + - condition: time + weekday: + - mon + - tue + - wed + - thu + action: + - service: scene.turn_on + target: + entity_id: scene.normal_heat + metadata: {} + mode: single +- id: '1702068970018' + alias: Telegram | Heater | HOT + description: '' + trigger: + - platform: event + event_type: telegram_command + event_data: + command: /hot + condition: + - condition: not + conditions: + - condition: state + entity_id: input_boolean.emergency_stop + state: 'on' + alias: Test if the Emergency button is not ON + action: + - service: scene.turn_on + target: + entity_id: scene.super_heat + metadata: {} + - service: telegram_bot.send_photo + data: + authentication: digest + url: https://static.standard.co.uk/s3fs-public/thumbnails/image/2017/02/02/10/trumpthumbs1.jpg?width=1200&auto=webp&quality=75 + mode: single +- id: '1702069226160' + alias: Telegram | Heater | STOP + description: '' + trigger: + - platform: event + event_type: telegram_command + event_data: + command: /stop + condition: [] + action: + - service: scene.turn_on + target: + entity_id: scene.stop + metadata: {} + mode: single +- id: '1702314110139' + alias: Telegram | Presence | Presence at home this weekend ?? + description: '' + trigger: + - platform: time + at: '11:00:00' + condition: + - condition: time + weekday: + - fri + action: + - service: telegram_bot.send_message + data: + message: Will you be present this weekend ? + inline_keyboard: + - Undetermined:/Undetermined_presence + - Absent from home:/absent_from_home_this_weekend, Present this weekend:/Present_at_home_this_weekend + mode: single +- id: '1702316420851' + alias: Telegram | Presence | Absent this weekend !! + description: '' + trigger: + - platform: event + event_type: telegram_callback + event_data: + command: /absent_from_home_this_weekend + action: + - service: input_select.select_option + target: + entity_id: input_select.at_home_this_weekend + data: + option: Away + - service: telegram_bot.send_message + data: + message: Away acknowledged + mode: single +- id: '1702316719859' + alias: Telegram | Presence | Present this weekend !! + description: '' + trigger: + - platform: event + event_type: telegram_callback + event_data: + command: /Present_at_home_this_weekend + condition: [] + action: + - service: input_select.select_option + target: + entity_id: input_select.at_home_this_weekend + data: + option: Present + - service: telegram_bot.send_message + data: + message: Presence acknowledged + mode: single +- id: '1702317456723' + alias: Telegram | Presence | UNDETERMINED this weekend !! + description: '' + trigger: + - platform: event + event_type: telegram_callback + event_data: + command: /Undetermined_presence + condition: [] + action: + - service: input_select.select_option + target: + entity_id: input_select.at_home_this_weekend + data: + option: Undetermined + - service: telegram_bot.send_message + data: + message: Put back to Undetermined + mode: single +- id: '1702392270065' + alias: Test condition At home + description: '' + trigger: + - platform: time + at: '15:16:00' + condition: + - condition: and + conditions: + - alias: Test if the Emergency button is not ON + condition: not + conditions: + - condition: state + entity_id: input_boolean.emergency_stop + state: 'on' + - condition: state + entity_id: input_select.at_home_this_weekend + state: Present + action: + - service: telegram_bot.send_message + data: + message: This is the scenario "test condition at home" to trigger that you will + be at home this week-end + mode: single +- id: '1702393100125' + alias: Presence this week-end Reset + description: '' + trigger: + - platform: time + at: 08:00:00 + condition: + - condition: time + weekday: + - mon + action: + - service: input_select.select_option + target: + entity_id: input_select.at_home_this_weekend + data: + option: Undetermined + mode: single +- id: '1702395768749' + alias: Tag emergency button is scanned + description: '' + trigger: + - platform: tag + tag_id: 002a803a-7268-4610-a169-f5beed033aa0 + condition: [] + action: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.emergency_stop + data: {} + mode: single +- id: '1702675655896' + alias: Test notification telegram + description: '' + trigger: [] + condition: [] + action: + - service: telegram_bot.send_photo + data: + authentication: digest + url: http://192.168.0.81:81/ + enabled: false + - service: telegram_bot.edit_replymarkup + data: + inline_keyboard: 1,2 + message_id: last + chat_id: last + mode: single +- id: '1703114036998' + alias: 'Heater morning spontaneous ' + description: '' + trigger: + - platform: time + at: 06:30:00 + condition: + - condition: and + conditions: + - condition: time + weekday: + - fri + - alias: Test if the Emergency button is not ON + condition: not + conditions: + - condition: state + entity_id: input_boolean.emergency_stop + state: 'on' + action: + - service: scene.turn_on + target: + entity_id: scene.normal_heat + metadata: {} + - service: telegram_bot.send_message + data: + message: Beginning of the spontaneous heating + alias: Telegram Beginning of the spontaneous heating + - wait_for_trigger: + - platform: time + at: '10:00:00' + - service: scene.turn_on + target: + entity_id: scene.stop + metadata: {} + - service: telegram_bot.send_message + data: + message: End of the spontaneous heating + alias: Telegram End of the spontaneous heating + mode: single +- id: '1703235062333' + alias: Joke generator + description: '' + use_blueprint: + path: Twanne/joke_generator.yaml + input: + languages: FR + media_player_entity: + - media_player.spotify_francky6 + joke_type: funny_insult + triggers: [] + run_conditions: [] + tts_target: + entity_id: tts.google_en_com +- id: '1705319060622' + alias: Heater night temperature week_days + description: '' + trigger: + - platform: time + at: '23:00:00' + condition: + - condition: and + conditions: + - condition: not + conditions: + - condition: state + entity_id: input_boolean.emergency_stop + state: 'on' + alias: Test if the Emergency button is not ON + - condition: time + weekday: + - mon + - tue + - wed + - thu + action: + - service: scene.turn_on + target: + entity_id: scene.stop + metadata: {} + - service: climate.set_preset_mode + metadata: {} + data: + preset_mode: Away + mode: single +- id: '1705319314735' + alias: Heater night temperature weekend + description: '' + trigger: + - platform: time + at: '23:00:00' + condition: + - condition: and + conditions: + - condition: state + entity_id: input_select.at_home_this_weekend + state: Present + - condition: time + weekday: + - sat + - fri + - alias: Test if the Emergency button is not ON + condition: not + conditions: + - condition: state + entity_id: input_boolean.emergency_stop + state: 'on' + action: + - service: scene.turn_on + target: + entity_id: scene.night_temperature + metadata: {} + mode: single +- id: '1705319453261' + alias: Telegram temperature < 10 + description: '' + trigger: + - platform: numeric_state + entity_id: + - sensor.temperature_test + below: 10 + condition: [] + action: + - service: telegram_bot.send_message + data: + message: The room temperature is {{ states('sensor.temperature_test')}} + title: Temperature below 10 degrees + mode: single +- id: '1706606695129' + alias: Automation - light lantern + description: '' + trigger: + - platform: webhook + webhook_id: motion + allowed_methods: + - POST + - PUT + local_only: true + condition: [] + action: + - service: rest_command.example_request + data: {} + mode: single +- id: '1706609440674' + alias: Telegram | motion detected + description: '' + trigger: + - platform: webhook + webhook_id: motion + allowed_methods: + - POST + - PUT + local_only: true + condition: [] + action: + - service: telegram_bot.send_message + data: + message: motion detected + mode: single +- id: '1706720495630' + alias: Automation heater below 15 + description: '' + trigger: + - type: temperature + platform: device + device_id: 3f12b5cca2a4db24f6399dcedf731d94 + entity_id: 2d90b90a4cbb91dc59cce6502c445a16 + domain: sensor + below: 15 + for: + hours: 0 + minutes: 30 + seconds: 0 + condition: + - condition: and + conditions: + - condition: time + weekday: + - mon + - tue + - wed + - thu + - condition: not + conditions: + - condition: state + entity_id: input_boolean.emergency_stop + state: 'on' + alias: Test if Emergency button is not ON + action: + - service: scene.turn_on + metadata: {} + target: + entity_id: scene.normal_heat + - delay: + hours: 0 + minutes: 30 + seconds: 0 + milliseconds: 0 + - choose: + - conditions: + - condition: numeric_state + entity_id: sensor.dht_temperature + above: 15 + sequence: + - service: scene.turn_on + metadata: {} + target: + entity_id: scene.stop + mode: single diff --git a/config/configuration.yaml b/config/configuration.yaml new file mode 100755 index 0000000..434a642 --- /dev/null +++ b/config/configuration.yaml @@ -0,0 +1,98 @@ + +# Loads default set of integrations. Do not remove. +default_config: + +homeassistant: + external_url: "https://homeassistant.tryton.geeraert.eu" + internal_url: "http://192.168.88.52:8123" + + +http: + server_port: 8123 + # For extra security set this to only accept connections on localhost if NGINX is on the same machine + # Uncommenting this will mean that you can only reach Home Assistant using the proxy, not directly via IP from other clients. + #server_host: 127.0.0.1 + use_x_forwarded_for: true + # You must set the trusted proxy IP address so that Home Assistant will properly accept connections + # Set this to your NGINX machine IP, or localhost if hosted on the same machine. + trusted_proxies: + - 0.0.0.0/0 + +# Load frontend themes from the themes folder +frontend: + themes: !include_dir_merge_named themes + +automation: !include automations.yaml +script: !include scripts.yaml +scene: !include scenes.yaml + +# Telegram Bot +telegram_bot: + - platform: polling + api_key: "6599036477:AAEHcqzO6g-4x_d8fg6tlr5Bl930SCGQgeE" + allowed_chat_ids: + - 602331464 + +# Notifier +notify: + - platform: telegram + name: "PierreGRD" + chat_id: 602331464 + + +# Example configuration.yaml entry +# - platform: kodi +# name: kodi +# host: 192.168.0.74 + + +# Example configuration.yaml entry +input_select: + at_home_this_weekend: + name: Presence at home this weekend + options: + - Present + - Away + - Undetermined + initial: Undetermined + icon: mdi:home-edit + +sensor: + - platform: scrape + name: ntc Temperature + resource: http://77.119.243.51:86/ + select: "s215" + + +#rest_command: +# example_request: +# url: "http://lantern/input" + +#climate: +# - platform: generic_thermostat +# name: Thermostat_bedroom +# heater: switch.heater_control_scene_switch +# target_sensor: sensor.temperature_test +# min_temp: 12 +# max_temp: 21 +# ac_mode: false +# target_temp: 17 +# cold_tolerance: 2 +# hot_tolerance: 0 +# min_cycle_duration: +# seconds: 5 +# initial_hvac_mode: "off" +# away_temp: 16 +# precision: 0.1 + +#switch: +# - platform: template +# switches: +# heater_control_scene_switch: +# value_template: "{{ is_state('scene.stop', 'on') }}" +# turn_on: +# service: scene.turn_on +# entity_id: scene.normal_heat +# turn_off: +# service: scene.turn_on +# entity_id: scene.stop diff --git a/config/scenes.yaml b/config/scenes.yaml new file mode 100755 index 0000000..a94e91a --- /dev/null +++ b/config/scenes.yaml @@ -0,0 +1,72 @@ +- id: '1701898817618' + name: Super heat + entities: + climate.tcp_smart_radiator: + hvac_modes: + - 'off' + - heat + min_temp: 5 + max_temp: 35 + target_temp_step: 1 + current_temperature: + temperature: 25 + friendly_name: TCP Smart Radiator + supported_features: 1 + state: heat + switch.tcp_smart_radiator_child_lock: + icon: mdi:account-lock + friendly_name: TCP Smart Radiator Child lock + state: 'off' + icon: mdi:fire + metadata: {} +- id: '1701898897639' + name: Normal heat + entities: + climate.tcp_smart_radiator: + hvac_modes: + - 'off' + - heat + min_temp: 5 + max_temp: 35 + target_temp_step: 1 + current_temperature: + temperature: 20 + friendly_name: TCP Smart Radiator + supported_features: 1 + state: heat + icon: mdi:heat-wave + metadata: {} +- id: '1701938692189' + name: Stop + entities: + climate.tcp_smart_radiator: + hvac_modes: + - 'off' + - heat + min_temp: 5 + max_temp: 35 + target_temp_step: 1 + current_temperature: + temperature: 5 + friendly_name: TCP Smart Radiator + supported_features: 1 + state: 'off' + icon: mdi:stop-circle + metadata: {} +- id: '1705013048699' + name: Night temperature + entities: + climate.tcp_smart_radiator: + hvac_modes: + - 'off' + - heat + min_temp: 5 + max_temp: 35 + target_temp_step: 1 + current_temperature: + temperature: 15 + friendly_name: TCP Smart Radiator + supported_features: 1 + state: heat + icon: mdi:weather-night + metadata: {} diff --git a/config/scripts.yaml b/config/scripts.yaml new file mode 100755 index 0000000..e490b88 --- /dev/null +++ b/config/scripts.yaml @@ -0,0 +1,25 @@ +'1701992081815': + alias: notification KODI + sequence: + - service: notify.kodi + data: + title: Home Assistant + message: Message to KODI from Home Assistant! + data: + displaytime: 20000 + icon: warning + mode: single +'1702068778694': + alias: New Script + sequence: + - service: scene.turn_on + target: + entity_id: scene.normal_heat + metadata: {} +motion_receiving: + alias: motion receiving + sequence: + - service: telegram_bot.send_message + data: + message: motion notification + mode: single diff --git a/config/secrets.yaml b/config/secrets.yaml new file mode 100755 index 0000000..c5b900c --- /dev/null +++ b/config/secrets.yaml @@ -0,0 +1,4 @@ + +# Use this file to store secrets like usernames and passwords. +# Learn more at https://www.home-assistant.io/docs/configuration/secrets/ +some_password: welcome diff --git a/homeassistant.kube.yaml b/homeassistant.kube.yaml new file mode 100644 index 0000000..7fb4d1d --- /dev/null +++ b/homeassistant.kube.yaml @@ -0,0 +1,63 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: homeassistant +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: homeassistant + namespace: homeassistant +spec: + replicas: 1 + selector: + matchLabels: + app: homeassistant + template: + metadata: + labels: + app: homeassistant + spec: + containers: + - image: ghcr.io/home-assistant/home-assistant:stable + imagePullPolicy: IfNotPresent + name: homeassistant + ports: + - containerPort: 8123 + name: ha-port + env: + - name: PORT + value: "80" + volumeMounts: + - name: homeassistant-config + mountPath: /config + - name: homeassistant-timezone + mountPath: /etc/localtime + resources: + limits: + memory: 2048Mi + requests: + cpu: 100m + memory: 500Mi + volumes: + - name: homeassistant-config + hostPath: + path: /opt/kubernetes/homeassistant_kube/config/ + - name: homeassistant-timezone + hostPath: + path: /etc/localtime +--- +apiVersion: v1 +kind: Service +metadata: + name: homeassistant + namespace: homeassistant +spec: + ports: + - port: 8123 + targetPort: ha-port + protocol: TCP +# nodePort: 30009 +# type: NodePort + selector: + app: homeassistant