Include configuration yml files

This commit is contained in:
2025-12-22 08:23:00 -05:00
parent 97679cd03b
commit 418ce7b583
3 changed files with 256 additions and 0 deletions

View File

@@ -0,0 +1,123 @@
- id: '1766178088964'
alias: Morning Weather
description: ''
triggers:
- trigger: time
at: 07:00:00
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
conditions: []
actions:
- action: rest_command.get_phone_weather
data: {}
response_variable: weather_data
- variables:
max_temp: '{{weather_data.content.daily.temperature_2m_max[0]}}'
min_temp: '{{weather_data.content.daily.temperature_2m_min[0]}}'
temp_unit: '{{weather_data.content.daily_units.temperature_2m_max}}'
condition: "{% set code = weather_data.content.daily.weather_code[0] | int %}
{% set mapper = {\n 0: \"Clear sky\",\n 1: \"Mainly clear\",\n 2: \"Partly
cloudy\",\n 3: \"Overcast\",\n 45: \"Fog\",\n 48: \"Depositing rime fog\",\n
\ 51: \"Drizzle - Light intensity\",\n 53: \"Drizzle - Moderate intensity\",\n
\ 55: \"Drizzle - Dense intensity\",\n 56: \"Freezing Drizzle - Light intensity\",\n
\ 57: \"Freezing Drizzle - Dense intensity\",\n 61: \"Rain - Slight intensity\",\n
\ 63: \"Rain - Moderate intensity\",\n 65: \"Rain - Heavy intensity\",\n
\ 66: \"Freezing Rain - Light intensity\",\n 67: \"Freezing Rain - Heavy
intensity\",\n 71: \"Snow fall - Slight intensity\",\n 73: \"Snow fall -
Moderate intensity\",\n 75: \"Snow fall - Heavy intensity\",\n 77: \"Snow
grains\",\n 80: \"Rain showers - Slight intensity\",\n 81: \"Rain showers
- Moderate intensity\",\n 82: \"Rain showers - Violent intensity\",\n 85:
\"Snow showers - Slight intensity\",\n 86: \"Snow showers - Heavy intensity\",\n
\ 95: \"Thunderstorm - Slight intensity\",\n 96: \"Thunderstorm with slight
hail\",\n 99: \"Thunderstorm with heavy hail\"\n } %}\n {{ mapper.get(code,
\"Not Availible\") }}\n"
- action: script.general_notificatioon
metadata: {}
data:
title: Morning Weather
message: 'Good Morning!
Here is the weather for today:
High: {{max_temp}} {{temp_unit}}
Low: {{min_temp}} {{temp_unit}}
Conditions: {{condition}}
'
mode: single
- id: '1766182515375'
alias: Dash Test
description: ''
triggers: []
conditions: []
actions:
- action: script.phone_weather
metadata: {}
data: {}
response_variable: weather
- variables:
max_temp: '{{weather.content.daily.temperature_2m_max[0]}}'
mode: single
- id: '1766406207253'
alias: Morning Test
description: ''
triggers:
- trigger: time
at: 07:00:00
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
conditions: []
actions:
- action: rest_command.get_phone_weather
data: {}
response_variable: weather_data
- variables:
max_temp: '{{weather_data.content.daily.temperature_2m_max[0]}}'
min_temp: '{{weather_data.content.daily.temperature_2m_min[0]}}'
temp_unit: '{{weather_data.content.daily_units.temperature_2m_max}}'
condition: "{% set code = weather_data.content.daily.weather_code[0] | int %}
{% set mapper = {\n 0: \"Clear sky\",\n 1: \"Mainly clear\",\n 2: \"Partly
cloudy\",\n 3: \"Overcast\",\n 45: \"Fog\",\n 48: \"Depositing rime fog\",\n
\ 51: \"Drizzle - Light intensity\",\n 53: \"Drizzle - Moderate intensity\",\n
\ 55: \"Drizzle - Dense intensity\",\n 56: \"Freezing Drizzle - Light intensity\",\n
\ 57: \"Freezing Drizzle - Dense intensity\",\n 61: \"Rain - Slight intensity\",\n
\ 63: \"Rain - Moderate intensity\",\n 65: \"Rain - Heavy intensity\",\n
\ 66: \"Freezing Rain - Light intensity\",\n 67: \"Freezing Rain - Heavy
intensity\",\n 71: \"Snow fall - Slight intensity\",\n 73: \"Snow fall -
Moderate intensity\",\n 75: \"Snow fall - Heavy intensity\",\n 77: \"Snow
grains\",\n 80: \"Rain showers - Slight intensity\",\n 81: \"Rain showers
- Moderate intensity\",\n 82: \"Rain showers - Violent intensity\",\n 85:
\"Snow showers - Slight intensity\",\n 86: \"Snow showers - Heavy intensity\",\n
\ 95: \"Thunderstorm - Slight intensity\",\n 96: \"Thunderstorm with slight
hail\",\n 99: \"Thunderstorm with heavy hail\"\n } %}\n {{ mapper.get(code,
\"Not Availible\") }}\n"
- action: script.general_notificatioon
metadata: {}
data:
title: Morning Weather
message: 'Good Morning!
Here is the weather for today:
High: {{max_temp}} {{temp_unit}}
Low: {{min_temp}} {{temp_unit}}
Conditions: {{condition}}
'
mode: single

View File

@@ -0,0 +1,89 @@
# Loads default set of integrations. Do not remove.
default_config:
# 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
http:
use_x_forwarded_for: true
trusted_proxies:
#- 172.19.0.2 # Add the IP address of the proxy server
- 172.0.0.0/8 # You may also provide the subnet mask
rest_command: # This api shows: Daily code, max/min temp, apperent max/min temp, sunrise/sunset/daylight, UV, percip sum/hours/probability
get_phone_weather: # All in US units for 3 days out
url: >
{% set lat = state_attr('device_tracker.alexs_phone','latitude') %}
{% set lon = state_attr('device_tracker.alexs_phone','longitude') %}
https://api.open-meteo.com/v1/forecast?latitude={{lat}}&longitude={{lon}}&daily=weather_code,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,daylight_duration,sunset,uv_index_max,precipitation_sum,precipitation_hours,precipitation_probability_max&timezone=America%2FNew_York&forecast_days=3&wind_speed_unit=mph&temperature_unit=fahrenheit&precipitation_unit=inch
method: GET
rest:
- resource_template: >
{% set lat = state_attr('device_tracker.alexs_phone','latitude') %}
{% set lon = state_attr('device_tracker.alexs_phone','longitude') %}
https://api.open-meteo.com/v1/forecast?latitude={{lat}}&longitude={{lon}}&daily=weather_code,temperature_2m_max,temperature_2m_min,apparent_temperature_max,apparent_temperature_min,sunrise,daylight_duration,sunset,uv_index_max,rain_sum,snowfall_sum,precipitation_sum,precipitation_hours,precipitation_probability_max&hourly=temperature_2m,apparent_temperature,precipitation_probability,weather_code,precipitation&current=temperature_2m,apparent_temperature,precipitation,weather_code,is_day&timezone=America%2FNew_York&wind_speed_unit=mph&temperature_unit=fahrenheit&precipitation_unit=inch
scan_interval: 900
sensor:
- name: "Phone Location Minimum Temperature"
unique_id: "phone_min_temp"
value_template: '{{value_json.daily.temperature_2m_min[0]}}'
unit_of_measurement: '°F'
device_class: temperature
- name: "Phone Location Maximum Temperature"
unique_id: "phone_max_temp"
value_template: '{{value_json.daily.temperature_2m_max[0]}}'
unit_of_measurement: '°F'
device_class: temperature
monitor_docker:
- name: Docker
containers:
- cloudflared-cloudflared-1
- gitea-db-1
- gitea-server-1
- glances
- habridge
- homeassistant
- nextcloud-app-1
- nextcloud-db-1
- nextcloud-redis-1
- nginx-app-1
- portainer
- syncthing
rename:
cloudflared-cloudflared-1: 'Cloudflared'
gitea-db-1: 'Gitea Database'
gitea-server-1: 'Gitea Server'
glances: 'Glances'
habridge: 'Home Assistant Bridge'
homeassistant: 'Home Assistant'
nextcloud-app-1: 'Nextcloud Server'
nextcloud-db-1: 'Nextcloud Database'
nextcloud-redis-1: 'Nextcloud Redis'
nginx-app-1: 'Nginx Proxy Manager'
portainer: 'Portainer'
syncthing: 'Syncthing'
monitored_conditions:
- version
- containers_running
- containers_paused
- containers_stopped
- containers_total
- containers_memory_percentage
- images
- state
- status
- health
- uptime
- image
- 1cpu_percentage
- memory
- memory_percentage
scan_interval: 60

44
ha/ha_config/scripts.yaml Normal file
View File

@@ -0,0 +1,44 @@
phone_weather:
sequence:
- action: rest_command.get_phone_weather
data: {}
response_variable: weather_data
- variables:
max_temp: '{{ weather_data.content.daily.temperature_2m_max[0] }}'
- action: script.general_notificatioon
metadata: {}
data:
message: 'Good morning!
The high for today is {{ max_temp }}
'
title: Morning Weather
alias: Phone Weather
description: ''
general_notificatioon:
sequence:
- action: notify.mobile_app_alexs_iphone_2
metadata: {}
data:
message: '{{ message }}'
title: '{{ title }}'
- action: notify.persistent_notification
metadata: {}
data:
message: '{{ message }}'
title: '{{ title }}'
fields:
title:
selector:
text:
name: Title
required: true
message:
selector:
text:
name: Message
required: true
alias: General Notification
description: ''
icon: mdi:bell-badge