This commit is contained in:
darthsandmann 2022-08-30 18:42:25 +02:00
parent 79919e5857
commit 853c1d1716
73 changed files with 3902 additions and 1210 deletions

50
README.md Normal file → Executable file
View File

@ -1,22 +1,40 @@
# Homeassistant Config # Homeassistant Config
## Hacs ## Todo
### Integrations - Climate control
- Circadian Lighting
- browser_mod
- UI Lovelace Minimalist
### Frontend ## Button Design
- button-card ### Functions
- Mini Media Player - Power on/off
- Simple Weather Card - Brightness
- Light Entity Card - Scenes
- auto-entities - Individual Light Selection
- card-mod - Adaptive & Sleep Mode
- Sun Card
- mini-graph-card ### 4 Button
- My Cards Bundle (https://github.com/AnthonMS/my-cards)
#### Up
- Press: Brightness Up / Power on (only when no light is selected)
- Hold: Power on (when light is selected)
#### Down
- Press: Brightness Down / Power off (only when no light is selected)
- Hold: Power off (when light is selected)
#### Left
- Press: Switch selected light
- Hold: Adaptive toggle
#### Right
- Press: Switch selected scene
- Hold: Sleep toggle
### 2 Button
#### Up
- Press: Power on
- Hold: Scene Adaptive
#### Down
- Press: Power off
- Hold: Scene Night

0
configuration.yaml Normal file → Executable file
View File

View File

@ -1,59 +0,0 @@
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_title
name: Climate
- view_layout:
grid-area: "card1"
type: custom:button-card
template: custom_card_httpedo13_sun
- view_layout:
grid-area: "card1"
type: "custom:button-card"
template: card_weather
entity: weather.dark_sky
variables:
ulm_card_weather_name: " "
ulm_card_weather_primary_info:
- wind_speed
- precipitation_probability
ulm_card_weather_backdrop:
fade: true
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_graph
entity: sensor.temperature_kai_temperature
variables:
ulm_card_graph_color: "var(--google-blue)"
ulm_card_graph_name: Temperature
ulm_card_graph_entity: sensor.temperature_kai_temperature
ulm_card_graph_color2: "var(--google-green)"
ulm_card_graph_entity2: sensor.temperature_outside_darksky
ulm_card_graph_type: fill
ulm_card_graph_hours: 6
- type: "horizontal-stack"
cards:
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_generic
entity: sensor.temperature_kai_humidity
variables:
ulm_card_generic_name: Humidity
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_generic
entity: sensor.temperature_kai_pressure
variables:
ulm_card_generic_name: Pressure

View File

@ -0,0 +1,56 @@
- type: 'custom:button-card'
template: card_title
name: Recommendation
- type: 'custom:button-card'
template: card_generic
entity: sensor.climate_temp_recommendation
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.temperature_kai_temperature
variables:
ulm_card_generic_swap_name: inside
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.temperature_outside
variables:
ulm_card_generic_swap_name: outside
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.climate_temp_difference
variables:
ulm_card_generic_swap_name: difference
- type: custom:apexcharts-card
graph_span: 6h
header:
show: false
series:
- entity: sensor.temperature_kai_temperature
type: line
name: Inside
group_by:
func: avg
duration: 30min
- entity: sensor.temperature_outside
type: column
name: Outside
group_by:
func: avg
duration: 30min
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.climate_temp
variables:
ulm_card_generic_swap_name: target
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.climate_temp_min
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.climate_temp_max

60
lovelace/climate/setup.yaml Executable file
View File

@ -0,0 +1,60 @@
- type: "vertical-stack"
cards:
- type: 'custom:button-card'
template: card_title
name: Day/Night
- type: custom:button-card
template: custom_card_httpedo13_sun
- type: "horizontal-stack"
cards:
- type: "custom:button-card"
template:
- card_input_datetime
entity: input_datetime.climate_morning
variables:
ulm_card_input_datetime_name: Day begins at
- type: "custom:button-card"
template:
- card_input_datetime
entity: input_datetime.climate_night
variables:
ulm_card_input_datetime_name: Day ends at
- type: "vertical-stack"
cards:
- type: 'custom:button-card'
template: card_title
name: Target Temperature
- type: "horizontal-stack"
cards:
- type: "custom:button-card"
template: card_input_number
entity: input_number.climate_temp_day
variables:
ulm_card_input_number_name: Day
- type: "custom:button-card"
template: card_input_number
entity: input_number.climate_temp_night
variables:
ulm_card_input_number_name: Night
- type: "horizontal-stack"
cards:
- type: "custom:button-card"
template: card_input_number
entity: input_number.climate_temp
variables:
ulm_card_input_number_name: Manual
- type: "custom:button-card"
template: card_input_number
entity: input_number.climate_temp_accuracy
variables:
ulm_card_input_number_name: Accuracy
- type: "vertical-stack"
cards:
- type: 'custom:button-card'
template: card_input_boolean
entity: input_boolean.climate_auto
variables:
ulm_card_input_boolean_name: Automatic

View File

@ -1,39 +0,0 @@
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_title
name: Energy
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_graph
entity: sensor.schreibtisch_current_consumption
variables:
ulm_card_graph_color: "var(--google-green)"
ulm_card_graph_name: Desk
ulm_card_graph_entity: sensor.schreibtisch_current_consumption
ulm_card_graph_type: fill
ulm_card_graph_hours: 12
- type: "horizontal-stack"
cards:
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_generic
entity: sensor.schreibtisch_today_s_consumption
variables:
ulm_card_generic_name: Today
ulm_card_generic_icon: "mdi:home-lightning-bolt"
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_generic
entity: sensor.schreibtisch_total_consumption
variables:
ulm_card_generic_name: Total
ulm_card_generic_icon: "mdi:home-lightning-bolt"

View File

@ -1,52 +0,0 @@
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_title
name: Lights
- type: "horizontal-stack"
cards:
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Indirect
ulm_card_light_enable_collapse: false
ulm_card_light_name: Indirect
ulm_input_select_option: light indirect
ulm_input_select: input_select.minimalist_ui_switch
entity: light.all_indirect
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Direct
ulm_card_light_enable_collapse: false
ulm_card_light_name: Direct
entity: light.all_direct
- view_layout:
grid-area: "card1"
type: 'custom:button-card'
template: card_input_boolean
entity: switch.circadian_lighting_circadian_lighting
variables:
ulm_card_input_boolean_name: Circadian Lighting
- view_layout:
grid-area: "card1"
type: "custom:button-card"
template: "card_light"
entity: light.all_indirect
variables:
ulm_card_light_enable_color: true
ulm_card_light_enable_slider: true
ulm_card_light_enable_popup: true
ulm_input_select_option: light indirect
ulm_input_select: input_select.minimalist_ui_switch

31
lovelace/lights/adaptive.yaml Executable file
View File

@ -0,0 +1,31 @@
- type: 'custom:button-card'
template: card_title
name: Adaptive
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.adaptive_lighting_default
variables:
ulm_card_input_boolean_name: Adaptive
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.adaptive_lighting_sleep_mode_default
variables:
ulm_card_input_boolean_name: Sleep
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.adaptive_lighting_adapt_brightness_default
variables:
ulm_card_input_boolean_name: Brightness
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.adaptive_lighting_adapt_color_default
variables:
ulm_card_input_boolean_name: Color

20
lovelace/lights/lightbulbs.yaml Executable file
View File

@ -0,0 +1,20 @@
- type: 'custom:button-card'
template: card_title
name: Light Bulbs
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Ceiling
ulm_card_light_enable_collapse: true
ulm_card_light_name: Ceiling
entity: light.ceiling
- type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Bed
ulm_card_light_enable_collapse: true
ulm_card_light_name: Bed
entity: light.bed_ceiling

View File

@ -0,0 +1,23 @@
- type: 'custom:button-card'
template: card_title
name: Light Groups
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Indirect
ulm_card_light_enable_collapse: true
ulm_card_light_name: Indirect
ulm_input_select_option: light indirect
ulm_input_select: input_select.minimalist_ui_switch
entity: light.all_indirect
- type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Direct
ulm_card_light_enable_collapse: true
ulm_card_light_name: Direct
entity: light.all_direct

59
lovelace/lights/lightmenu.yaml Executable file
View File

@ -0,0 +1,59 @@
- type: 'custom:button-card'
template: card_title
name: Menu Control
- type: 'custom:button-card'
template: card_generic
entity: timer.pos_timer
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_script
variables:
ulm_card_script_title: Left Incr
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.pos_left_incr
- type: 'custom:button-card'
template: card_script
variables:
ulm_card_script_title: Right Incr
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.pos_right_incr
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_script
variables:
ulm_card_script_title: Up
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.pos_up
- type: 'custom:button-card'
template: card_script
variables:
ulm_card_script_title: Down
tap_action:
action: call-service
service: script.turn_on
service_data:
entity_id: script.pos_down
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic
entity: input_number.pos_left
- type: 'custom:button-card'
template: card_generic
entity: input_number.pos_right

View File

@ -0,0 +1,21 @@
- type: 'custom:button-card'
template: card_title
name: Light Stripes
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Bed
ulm_card_light_enable_collapse: true
ulm_card_light_name: Bed
entity: light.bed
- type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Desk
ulm_card_light_enable_collapse: true
ulm_card_light_name: Desk
entity: light.desk

28
lovelace/welcome.yaml → lovelace/lights/scenes.yaml Normal file → Executable file
View File

@ -1,28 +1,22 @@
- view_layout: - type: 'custom:button-card'
grid-area: "card1"
type: 'custom:button-card'
template: card_title template: card_title
name: Home Assistant name: Scenes
- view_layout:
grid-area: "card1" - type: "custom:button-card"
type: "custom:button-card" template:
template: "card_welcome_scenes" - card_scenes
triggers_update: input_boolean.welcome_collapse
entity: input_boolean.welcome_collapse
variables: variables:
ulm_card_welcome_scenes_collapse: input_boolean.welcome_collapse
ulm_weather: "weather.dark_sky"
entity_1: entity_1:
entity_id: scene.light_flux entity_id: scene.light_adaptive
icon: "mdi:theme-light-dark" icon: "mdi:theme-light-dark"
icon_color: "yellow" icon_color: "yellow"
name: "Flux" name: "Adaptive"
bg_color: "yellow" bg_color: "yellow"
entity_2: entity_2:
entity_id: scene.light_blue entity_id: scene.light_bright
icon: "mdi:television-play" icon: "mdi:television-play"
icon_color: "blue" icon_color: "blue"
name: "Blue" name: "Bright"
bg_color: "blue" bg_color: "blue"
entity_3: entity_3:
entity_id: "scene.light_night" entity_id: "scene.light_night"
@ -37,7 +31,7 @@
name: "All On" name: "All On"
bg_color: "green" bg_color: "green"
entity_5: entity_5:
entity_id: "scene.light_alloff" entity_id: "script.light_store_off"
icon: "mdi:lightbulb-group-off-outline" icon: "mdi:lightbulb-group-off-outline"
icon_color: "red" icon_color: "red"
name: "All Off" name: "All Off"

View File

@ -1,15 +1,11 @@
- view_layout: #- type: 'custom:button-card'
grid-area: "card1" # template: card_title
type: 'custom:button-card' # name: Batteries
template: card_title
name: Batteries
- type: "horizontal-stack" - type: "horizontal-stack"
cards: cards:
- view_layout: - type: 'custom:button-card'
grid-area: "card1"
type: 'custom:button-card'
template: card_battery template: card_battery
entity: sensor.iphone_battery_level entity: sensor.iphone_battery_level
variables: variables:
@ -18,9 +14,7 @@
ulm_card_battery_battery_level_warning: 80 ulm_card_battery_battery_level_warning: 80
ulm_card_battery_name: iPhone ulm_card_battery_name: iPhone
- view_layout: - type: 'custom:button-card'
grid-area: "card1"
type: 'custom:button-card'
template: card_battery template: card_battery
entity: sensor.ipad_battery_level entity: sensor.ipad_battery_level
variables: variables:

68
lovelace/overview/climate.yaml Executable file
View File

@ -0,0 +1,68 @@
#- type: 'custom:button-card'
# template: card_title
# name: Climate
- type: custom:apexcharts-card
graph_span: 6h
header:
show: false
series:
- entity: sensor.temperature_kai_temperature
type: line
name: Inside
group_by:
func: avg
duration: 15min
- entity: sensor.temperature_outside
type: column
name: Outside
group_by:
func: avg
duration: 15min
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic
entity: sensor.temperature_kai_temperature
variables:
ulm_card_generic_name: Inside
- type: 'custom:button-card'
template: card_generic
entity: sensor.climate_temp_difference_inside_outside
variables:
ulm_card_generic_name: Diff Outside
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic
entity: sensor.temperature_inside_feelslike
variables:
ulm_card_generic_name: Inside Feelslike
- type: 'custom:button-card'
template: card_generic
entity: sensor.temperature_outside_feelslike
variables:
ulm_card_generic_name: Outside Feelslike
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic
entity: sensor.temperature_kai_humidity
variables:
ulm_card_generic_name: Humidity
- type: 'custom:button-card'
template: card_generic
entity: sensor.temperature_kai_pressure
variables:
ulm_card_generic_name: Pressure
- type: weather-forecast
entity: weather.home

34
lovelace/overview/energy.yaml Executable file
View File

@ -0,0 +1,34 @@
#- type: 'custom:button-card'
# template: card_title
# name: Energy
- type: custom:apexcharts-card
graph_span: 12h
header:
show: false
series:
- entity: sensor.desk_current_consumption
name: Consumption
curve: smooth
type: line
group_by:
duration: 10min
func: avg
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic
entity: sensor.desk_today_s_consumption
variables:
ulm_card_generic_name: Today
ulm_card_generic_icon: "mdi:home-lightning-bolt"
- type: 'custom:button-card'
template: card_generic
entity: sensor.desk_total_consumption
variables:
ulm_card_generic_name: Total
ulm_card_generic_icon: "mdi:home-lightning-bolt"

26
lovelace/overview/feed.yaml Executable file
View File

@ -0,0 +1,26 @@
- type: 'custom:home-feed-card'
title: Feed
card_id: main_feed
show_empty: false
more_info_on_tap: true
state_color: true
compact_mode: true
entities:
- entity: sensor.climate_temp_recommendation
name: Recommendation
content_template: '{{state}}'
# - entity: binary_sensor.warning_duisburg_stadt_1
# exclude_states:
# - "Safe"
# - entity: binary_sensor.warning_duisburg_stadt_2
# exclude_states:
# - "Safe"
# - entity: binary_sensor.warning_duisburg_stadt_3
# exclude_states:
# - "Safe"
# - entity: binary_sensor.warning_duisburg_stadt_4
# exclude_states:
# - "Safe"
# - entity: binary_sensor.warning_duisburg_stadt_5
# exclude_states:
# - "Safe"

35
lovelace/overview/lights.yaml Executable file
View File

@ -0,0 +1,35 @@
#- type: 'custom:button-card'
# template: card_title
# name: Lights
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Indirect
ulm_card_light_enable_collapse: true
ulm_card_light_name: Indirect
entity: light.all_indirect
- type: 'custom:button-card'
template: card_light_slider_collapse
variables:
ulm_card_light_slider_collapse_name: Direct
ulm_card_light_enable_collapse: true
ulm_card_light_name: Direct
entity: light.all_direct
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.adaptive_lighting_default
variables:
ulm_card_input_boolean_name: Adaptive
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.adaptive_lighting_sleep_mode_default
variables:
ulm_card_input_boolean_name: Sleep

View File

@ -0,0 +1,15 @@
#- type: 'custom:button-card'
# template: card_title
# name: Multimedia
- type: "custom:button-card"
template: card_media_player
entity: media_player.denon_avr_x1100w
name: Denon
variables:
ulm_card_media_player_more_info: true
ulm_card_media_player_collapsible: true
ulm_card_media_player_enable_volume_slider: true
ulm_card_media_player_enable_controls: true
ulm_card_media_player_enable_art: false

16
lovelace/nas.yaml → lovelace/overview/nas.yaml Normal file → Executable file
View File

@ -1,15 +1,11 @@
- view_layout: #- type: 'custom:button-card'
grid-area: "card1" # template: card_title
type: 'custom:button-card' # name: NAS
template: card_title
name: NAS
- type: "horizontal-stack" - type: "horizontal-stack"
cards: cards:
- view_layout: - type: 'custom:button-card'
grid-area: "card1"
type: 'custom:button-card'
template: card_script template: card_script
variables: variables:
ulm_card_script_title: WOL ulm_card_script_title: WOL
@ -20,9 +16,7 @@
service_data: service_data:
entity_id: switch.server entity_id: switch.server
- view_layout: - type: 'custom:button-card'
grid-area: "card1"
type: 'custom:button-card'
template: card_binary_sensor template: card_binary_sensor
variables: variables:
ulm_card_binary_sensor_alert: true ulm_card_binary_sensor_alert: true

20
lovelace/overview/vacuum.yaml Executable file
View File

@ -0,0 +1,20 @@
#- type: 'custom:button-card'
# template: card_title
# name: Vacuum
- type: 'custom:valetudo-map-card'
vacuum: valetudo_rockrobo
title:
show_status: false
show_battery_level: false
show_start_button: false
show_pause_button: false
show_stop_button: false
show_home_button: false
show_locate_button: false
- type: "custom:button-card"
template: "card_vacuum"
entity: vacuum.valetudo_rockrobo

42
lovelace/overview/welcome.yaml Executable file
View File

@ -0,0 +1,42 @@
#- type: 'custom:button-card'
# template: card_title
# name: Home Assistant
- type: "custom:button-card"
template: "card_welcome_scenes"
triggers_update: input_boolean.welcome_collapse
entity: input_boolean.welcome_collapse
variables:
ulm_card_welcome_scenes_collapse: input_boolean.welcome_collapse
ulm_weather: weather.home
entity_1:
entity_id: scene.light_adaptive
icon: "mdi:theme-light-dark"
icon_color: "yellow"
name: "Adaptive"
bg_color: "yellow"
entity_2:
entity_id: scene.light_bright
icon: "mdi:television-play"
icon_color: "blue"
name: "Bright"
bg_color: "blue"
entity_3:
entity_id: "scene.light_night"
icon: "mdi:weather-night"
icon_color: "purple"
name: "Night"
bg_color: "purple"
# entity_4:
# entity_id: "script.light_store_restore"
# icon: "mdi:lightbulb-group"
# icon_color: "green"
# name: "All On"
# bg_color: "green"
# entity_5:
# entity_id: "script.light_store_off"
# icon: "mdi:lightbulb-group-off-outline"
# icon_color: "red"
# name: "All Off"
# bg_color: "red"

87
lovelace/pfsense/gateways.yaml Executable file
View File

@ -0,0 +1,87 @@
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_title
name: WAN
label: IPv4
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_wan_gw_delay
variables:
ulm_card_generic_swap_name: Delay
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_wan_gw_loss
variables:
ulm_card_generic_swap_name: Loss
- type: 'custom:button-card'
template: card_title
name: Mullvad
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_title
name: 1
label: IPv4
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_mullvad1gw_delay
variables:
ulm_card_generic_swap_name: Delay
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_mullvad1gw_loss
variables:
ulm_card_generic_swap_name: Loss
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_title
name: 1
label: IPv6
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_mullvad1gwv6_delay
variables:
ulm_card_generic_swap_name: Delay
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_mullvad1gwv6_loss
variables:
ulm_card_generic_swap_name: Loss
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_title
name: 2
label: IPv4
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_mullvad2gw_delay
variables:
ulm_card_generic_swap_name: Delay
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_mullvad2gw_loss
variables:
ulm_card_generic_swap_name: Loss
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_title
name: 2
label: IPv6
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_mullvad2gwv6_delay
variables:
ulm_card_generic_swap_name: Delay
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_gateway_mullvad2gwv6_loss
variables:
ulm_card_generic_swap_name: Loss

36
lovelace/pfsense/load.yaml Executable file
View File

@ -0,0 +1,36 @@
- type: 'custom:button-card'
template: card_title
name: Load Average
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic
entity: sensor.pfsense_cpu_load_average_one_minute
variables:
ulm_card_generic_name: 1m
- type: 'custom:button-card'
template: card_generic
entity: sensor.pfsense_cpu_load_average_five_minute
variables:
ulm_card_generic_name: 5m
- type: 'custom:button-card'
template: card_generic
entity: sensor.pfsense_cpu_load_average_fifteen_minute
variables:
ulm_card_generic_name: 15m
- type: "horizontal-stack"
cards:
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_memory_used_percentage
variables:
ulm_card_generic_swap_name: "Memory Used %"
- type: 'custom:button-card'
template: card_generic_swap
entity: sensor.pfsense_memory_swap_used_percentage
variables:
ulm_card_generic_swap_name: "Swap Used %"

View File

@ -0,0 +1,11 @@
- type: 'custom:button-card'
template: card_title
name: Notifications
- type: 'custom:button-card'
template: card_binary_sensor
variables:
ulm_card_binary_sensor_alert: true
ulm_show_last_changed: false
entity: binary_sensor.pfsense_pending_notices_present

19
lovelace/pfsense/rules.yaml Executable file
View File

@ -0,0 +1,19 @@
- type: 'custom:button-card'
template: card_title
name: Firewall Rules
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.pfsense_filter_rule_1602620992_disablemullvadtower
variables:
ulm_card_input_boolean_name: "LAN: Disable Mullvad PC"
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.pfsense_filter_rule_1608907801_disablemullvadnetflixtower
variables:
ulm_card_input_boolean_name: "LAN: Bypass Netflix PC"
- type: 'custom:button-card'
template: card_input_boolean
entity: switch.pfsense_filter_rule_1602623476_route_ipad_netflix_to_wan
variables:
ulm_card_input_boolean_name: "LAN: Bypass Netflix iPad"

92
lovelace/pfsense/traffic.yaml Executable file
View File

@ -0,0 +1,92 @@
- type: 'custom:button-card'
template: card_title
name: Traffic
- type: custom:apexcharts-card
graph_span: 2h
apex_config:
chart:
height: 250px
series:
- entity: sensor.pfsense_interface_wan_inbytes_kilobytes_per_second
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: WAN In
- entity: sensor.pfsense_interface_wan_outbytes_kilobytes_per_second
invert: true
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: WAN Out
- type: custom:apexcharts-card
graph_span: 2h
apex_config:
chart:
height: 250px
series:
- entity: sensor.pfsense_interface_mullvad1_inbytes_kilobytes_per_second
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: Mullvad1 In
- entity: sensor.pfsense_interface_mullvad1_outbytes_kilobytes_per_second
invert: true
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: Mullvad1 Out
- entity: sensor.pfsense_interface_mullvad2_inbytes_kilobytes_per_second
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: Mullvad2 In
- entity: sensor.pfsense_interface_mullvad2_outbytes_kilobytes_per_second
invert: true
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: Mullvad2 Out
- type: custom:apexcharts-card
graph_span: 2h
apex_config:
chart:
height: 250px
series:
- entity: sensor.pfsense_interface_lan_inbytes_kilobytes_per_second
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: LAN In
- entity: sensor.pfsense_interface_lan_outbytes_kilobytes_per_second
invert: true
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: LAN Out
- entity: sensor.pfsense_interface_backend_inbytes_kilobytes_per_second
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: Backend In
- entity: sensor.pfsense_interface_backend_outbytes_kilobytes_per_second
invert: true
stroke_width: 2
type: area
transform: return x / 1024;
unit: Mb/s
name: Backend In

View File

@ -1,16 +0,0 @@
- type: custom:state-switch
view_layout:
grid-area: popup
show:
mediaquery: "(min-width: 1100px)"
entity: input_select.minimalist_ui
default: default
transition: slide-down
transition_time: 500
states:
## Lights
light indirect:
type: "custom:button-card"
template: "popup_light_brightness"
variables:
ulm_popup_light_entity: lights.all_indirect

View File

@ -1,36 +0,0 @@
- view_layout:
grid-area: "card1"
type: "custom:button-card"
template: "card_title"
name: "Card 1 Testing"
label: "grid-area: card1"
- view_layout:
grid-area: "card1"
type: "custom:button-card"
template: "card_light"
entity: "light.all_indirect"
variables:
ulm_card_light_enable_color: true
ulm_card_light_enable_slider: true
ulm_card_light_enable_popup: true
ulm_input_select_option: light 1
ulm_input_select: input_select.minimalist_ui_switch
- type: custom:state-switch
view_layout:
grid-area: popup
show:
mediaquery: "(min-width: 1100px)"
entity: input_select.minimalist_ui # put your input_select here
default: default
transition: slide-down
transition_time: 500
states:
## Lights
light 1:
type: "custom:button-card"
template: "popup_light_brightness"
variables:
ulm_popup_light_entity: light.all_indirect

View File

@ -0,0 +1,21 @@
input_number:
pos_left:
name: Pos Left
initial: 0
step: 1
min: 0
max: 4
mode: box
pos_right:
name: Pos Right
initial: 0
step: 1
min: 0
max: 9
mode: box
timer:
pos_timer:
duration: "00:00:10"

514
packages/button/button_logic.yaml Executable file
View File

@ -0,0 +1,514 @@
script:
#----------------------------------------------------------------------------------#
# Left
#----------------------------------------------------------------------------------#
pos_left_incr:
alias: pos_left_incr
sequence:
- if:
- condition: numeric_state
entity_id: input_number.pos_right
above: '0'
then:
- service: input_number.set_value
data:
value: 0
target:
entity_id: input_number.pos_right
else:
- if:
- condition: numeric_state
entity_id: input_number.pos_left
above: '3'
then:
- service: input_number.set_value
data:
value: 1
target:
entity_id: input_number.pos_left
else:
- service: input_number.increment
target:
entity_id: input_number.pos_left
# Restart/Start the timer
- service: timer.cancel
target:
entity_id: timer.pos_timer
- service: timer.start
target:
entity_id: timer.pos_timer
mode: single
#----------------------------------------------------------------------------------#
# Right
#----------------------------------------------------------------------------------#
pos_right_incr:
alias: pos_right_incr
sequence:
- if:
- condition: numeric_state
entity_id: input_number.pos_left
above: '0'
then:
- service: input_number.set_value
data:
value: 0
target:
entity_id: input_number.pos_left
else:
- if:
- condition: numeric_state
entity_id: input_number.pos_right
above: '2'
then:
- service: input_number.set_value
data:
value: 1
target:
entity_id: input_number.pos_right
else:
- service: input_number.increment
target:
entity_id: input_number.pos_right
# Restart/Start the timer
- service: timer.cancel
target:
entity_id: timer.pos_timer
- service: timer.start
target:
entity_id: timer.pos_timer
mode: single
#----------------------------------------------------------------------------------#
# Up
#----------------------------------------------------------------------------------#
pos_up:
alias: pos_up
sequence:
# 0,0
- if:
- condition: and
conditions:
- condition: state
entity_id: input_number.pos_left
state: "0.0"
- condition: state
entity_id: input_number.pos_right
state: "0.0"
then:
- if:
- condition:
- condition: state
entity_id: light.all_lights
state: "on"
then:
- service: script.summary_notification
else:
- service: scene.turn_on
target:
entity_id: scene.snapshot_all
#- service: light.turn_on
# target:
# entity_id: light.all_lights
# 1,0 Ceiling
- if:
- condition:
- condition: state
entity_id: input_number.pos_left
state: "1.0"
then:
- service: light.turn_on
target:
entity_id: light.ceiling
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 2,0 Bed
- if:
- condition:
- condition: state
entity_id: input_number.pos_left
state: "2.0"
then:
- service: light.turn_on
target:
entity_id: light.bed_ceiling
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 3,0 Indirect
- if:
- condition:
- condition: state
entity_id: input_number.pos_left
state: "3.0"
then:
- service: light.turn_on
target:
entity_id: light.all_indirect
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 4,0 All Lights
- if:
- condition:
- condition: state
entity_id: input_number.pos_left
state: "4.0"
then:
- service: light.turn_on
target:
entity_id: light.all_lights
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 0,1 Adaptive
- if:
- condition:
- condition: state
entity_id: input_number.pos_right
state: "1.0"
then:
- service: scene.turn_on
target:
entity_id: scene.light_adaptive
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 0,2 Night
- if:
- condition:
- condition: state
entity_id: input_number.pos_right
state: "2.0"
then:
- service: scene.turn_on
target:
entity_id: scene.light_night
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 0,3 Bright
- if:
- condition:
- condition: state
entity_id: input_number.pos_right
state: "3.0"
then:
- service: scene.turn_on
target:
entity_id: scene.light_bright
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
mode: single
#----------------------------------------------------------------------------------#
# Down
#----------------------------------------------------------------------------------#
pos_down:
alias: pos_down
sequence:
# 0,0
- if:
- condition: and
conditions:
- condition: state
entity_id: input_number.pos_left
state: "0.0"
- condition: state
entity_id: input_number.pos_right
state: "0.0"
then:
- if:
- condition:
- condition: state
entity_id: light.all_lights
state: "off"
then:
- service: script.summary_notification
else:
- service: light.turn_off
target:
entity_id: light.all_lights
# 1,0 Ceiling
- if:
- condition:
- condition: state
entity_id: input_number.pos_left
state: "1.0"
then:
- service: light.turn_off
target:
entity_id: light.ceiling
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 2,0 Bed
- if:
- condition:
- condition: state
entity_id: input_number.pos_left
state: "2.0"
then:
- service: light.turn_off
target:
entity_id: light.bed_ceiling
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 3,0 Indirect
- if:
- condition:
- condition: state
entity_id: input_number.pos_left
state: "3.0"
then:
- service: light.turn_off
target:
entity_id: light.all_indirect
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# 4,0 All Lights
- if:
- condition:
- condition: state
entity_id: input_number.pos_left
state: "4.0"
then:
- service: light.turn_off
target:
entity_id: light.all_lights
mode: single
#----------------------------------------------------------------------------------#
# Dimming
#----------------------------------------------------------------------------------#
button_brightness_up:
sequence:
- service: light.turn_on
data_template:
entity_id: light.direct
brightness: >-
{% set current = states.light.direct.attributes.brightness|default(0)|int %}
{% set step = 100 %}
{% set next = current + step %}
{% if next > 255 %}
{% set next = 255 %}
{% endif %}
{{ next }}
- delay:
milliseconds: 1
- service: script.turn_on
data:
entity_id: script.button_brightness_up_loop
button_brightness_up_loop:
sequence:
- service: script.turn_on
data:
entity_id: script.button_brightness_up
button_brightness_down:
sequence:
- service: light.turn_on
data_template:
entity_id: light.direct
brightness: >-
{% set current = states.light.direct.attributes.brightness|default(0)|int %}
{% set step = 100 %}
{% set next = current - step %}
{% if next < 1 %}
{% set next = 1 %}
{% endif %}
{{ next }}
- delay:
milliseconds: 1
- service: script.turn_on
data:
entity_id: script.button_brightness_down_loop
button_brightness_down_loop:
sequence:
- service: script.turn_on
data:
entity_id: script.button_brightness_down
#------------------------------------------------------------------------------------#
# Automations
#------------------------------------------------------------------------------------#
automation:
# Timer
- alias: pos_timer_reset
mode: single
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.pos_timer
action:
- service: input_number.set_value
data:
value: 0
target:
entity_id:
- input_number.pos_left
- input_number.pos_right
# Pos 1,0 Ceiling
- alias: pos_1_0_flash
mode: single
trigger:
- platform: state
entity_id:
- input_number.pos_left
to: "1.0"
action:
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
- service: switch.turn_off
target:
entity_id: switch.adaptive_lighting_default
- service: light.turn_on
data:
effect: Twitter
target:
entity_id: light.ceiling
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 500
- service: scene.turn_on
target:
entity_id: scene.snapshot_all
# Pos 2,0 Ceiling Bed
- alias: pos_2_0_flash
mode: single
trigger:
- platform: state
entity_id:
- input_number.pos_left
to: "2.0"
action:
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
- service: switch.turn_off
target:
entity_id: switch.adaptive_lighting_default
- service: light.turn_on
data:
effect: Twitter
target:
entity_id: light.bed_ceiling
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 500
- service: scene.turn_on
target:
entity_id: scene.snapshot_all
# Pos 3,0 Indirect
- alias: pos_3_0_flash
mode: single
trigger:
- platform: state
entity_id:
- input_number.pos_left
to: "3.0"
action:
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
- service: switch.turn_off
target:
entity_id: switch.adaptive_lighting_default
- service: light.turn_on
data:
effect: Twitter
target:
entity_id: light.all_indirect
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 500
- service: scene.turn_on
target:
entity_id: scene.snapshot_all
# Pos 4,0 All Lights
- alias: pos_4_0_flash
mode: single
trigger:
- platform: state
entity_id:
- input_number.pos_left
to: "4.0"
action:
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
- service: switch.turn_off
target:
entity_id: switch.adaptive_lighting_default
- service: light.turn_on
data:
effect: Twitter
target:
entity_id: light.all_lights
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 500
- service: scene.turn_on
target:
entity_id: scene.snapshot_all
# Pos 0,1 Adaptive
- alias: pos_0_1_flash
mode: single
trigger:
- platform: state
entity_id:
- input_number.pos_right
to: "1.0"
action:
- service: scene.turn_on
target:
entity_id: scene.light_adaptive
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# Pos 0,2
- alias: pos_0_2_flash
mode: single
trigger:
- platform: state
entity_id:
- input_number.pos_right
to: "2.0"
action:
- service: scene.turn_on
target:
entity_id: scene.light_night
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot
# Pos 0,3
- alias: pos_0_3_flash
mode: single
trigger:
- platform: state
entity_id:
- input_number.pos_right
to: "3.0"
action:
- service: scene.turn_on
target:
entity_id: scene.light_bright
- service: automation.trigger
target:
entity_id: automation.light_all_snapshot

104
packages/button/button_press.yaml Executable file
View File

@ -0,0 +1,104 @@
automation:
#----------------------------------------------------------------------------------#
# L/R
#----------------------------------------------------------------------------------#
# Button Left: Pos Left
- alias: button_pos_left
trigger:
# Bed
- platform: device
domain: mqtt
device_id: 4f9d195bf907da59e1461a5d2404f606
type: action
subtype: arrow_left_click
discovery_id: 0x0c4314fffee0bb44 action_arrow_left_click
# Door
- platform: device
domain: mqtt
device_id: 5e67efdee83ccceaac84046dfc6c735e
type: action
subtype: arrow_left_click
discovery_id: 0x0c4314fffef68790 action_arrow_left_click
action:
- service: script.pos_left_incr
mode: single
# Button Left: Pos Right
- alias: button_pos_right
trigger:
# Bed
- platform: device
domain: mqtt
device_id: 4f9d195bf907da59e1461a5d2404f606
type: action
subtype: arrow_right_click
discovery_id: 0x0c4314fffee0bb44 action_arrow_right_click
# Door
- platform: device
domain: mqtt
device_id: 5e67efdee83ccceaac84046dfc6c735e
type: action
subtype: arrow_left_click
discovery_id: 0x0c4314fffef68790 action_arrow_right_click
action:
- service: script.pos_right_incr
mode: single
#----------------------------------------------------------------------------------#
# Up/Down
#----------------------------------------------------------------------------------#
# Up
- alias: button_up
trigger:
# Desk
- platform: device
domain: mqtt
device_id: 121e4230e41feb19254fa92ed5335760
type: action
subtype: "on"
discovery_id: 0x2c1165fffebebf6d action_on
# Bed
- platform: device
domain: mqtt
device_id: 4f9d195bf907da59e1461a5d2404f606
type: action
subtype: "on"
discovery_id: 0x0c4314fffee0bb44 action_on
# Door
- platform: device
domain: mqtt
device_id: 5e67efdee83ccceaac84046dfc6c735e
type: action
subtype: "on"
discovery_id: 0x0c4314fffef68790 action_on
action:
- service: script.pos_up
mode: single
# Down
- alias: button_down
trigger:
# Desk
- platform: device
domain: mqtt
device_id: 121e4230e41feb19254fa92ed5335760
type: action
subtype: "off"
discovery_id: 0x2c1165fffebebf6d action_off
# Bed
- platform: device
domain: mqtt
device_id: 4f9d195bf907da59e1461a5d2404f606
type: action
subtype: "off"
discovery_id: 0x0c4314fffee0bb44 action_off
# Door
- platform: device
domain: mqtt
device_id: 5e67efdee83ccceaac84046dfc6c735e
type: action
subtype: "off"
discovery_id: 0x0c4314fffef68790 action_off
action:
- service: script.pos_down
mode: single

View File

@ -0,0 +1,123 @@
automation:
## -----------------------------------------------------------------------------------------------##
## Notification on state change
## -----------------------------------------------------------------------------------------------##
- alias: "climate_recommendation_close"
trigger:
- platform: state
entity_id: sensor.climate_temp_recommendation
from: 'open the window'
to: 'close the window'
action:
- service: notify.notify
data:
message: "Close the window."
- alias: "climate_recommendation_open"
trigger:
- platform: state
entity_id: sensor.climate_temp_recommendation
from: 'close the window'
to: 'open the window'
action:
- service: notify.notify
data:
message: "Open the window."
## -----------------------------------------------------------------------------------------------##
## Trigger alle 15min um Abfrage und Temperaturanpassung durchzuführen
## -----------------------------------------------------------------------------------------------##
# - alias: climate_set_auto
# initial_state: on
# trigger:
# - platform: time_pattern
# minutes: '/5'
# - platform: state
# entity_id: sensor.climate_temp
# condition:
# - condition: template
# value_template: '{{ states.climate.kai.state != "unavailable" }}'
# action:
# - service: script.turn_on
# entity_id: script.climate_set
# - delay: '00:20'
# - service: script.turn_on
# entity_id: script.climate_set
# - service: input_number.set_value
# data_template:
# entity_id: input_number.climate_temp_last
# value: '{{ states("sensor.aqara_temperature_kai_temperature")|float }}'
# - alias: climate_set_manual
# initial_state: on
# trigger:
# - platform: state
# entity_id: input_number.climate_temp
# condition:
# - condition: template
# value_template: '{{ states.climate.kai.state != "unavailable" }}'
# action:
# - service: input_boolean.turn_off
# entity_id: input_boolean.climate_auto
# - service: script.turn_on
# entity_id: script.climate_set
# - delay: '00:20'
# - service: script.turn_on
# entity_id: script.climate_set
# - alias: climate_set_power_off
# initial_state: on
# trigger:
# - platform: state
# entity_id: input_boolean.climate_power
# to: "off"
# action:
# - service: climate.turn_off
# entity_id: climate.kai
# - delay: '00:20'
# - service: climate.turn_off
# entity_id: climate.kai
# - alias: climate_set_power_on
# initial_state: on
# trigger:
# - platform: state
# entity_id: input_boolean.climate_power
# to: "on"
# action:
# - service: climate.turn_on
# entity_id: climate.kai
# - delay: '00:20'
# - service: climate.turn_on
# entity_id: climate.kai
## -----------------------------------------------------------------------------------------------##
## Trigger alle 5min, wenn Wochentag -> aktiviere Weekday-Boolean
## -----------------------------------------------------------------------------------------------##
- alias: climate_weekday
initial_state: on
trigger:
platform: time_pattern
minutes: '/5'
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
service: input_boolean.turn_on
entity_id: input_boolean.climate_weekday
## -----------------------------------------------------------------------------------------------##
## Trigger alle 5min, wenn Wochenende -> deaktiviere Weekday-Boolean
## -----------------------------------------------------------------------------------------------##
- alias: climate_weekend
initial_state: on
trigger:
platform: time_pattern
minutes: '/5'
condition:
- condition: time
weekday:
- sat
- sun
action:
service: input_boolean.turn_off
entity_id: input_boolean.climate_weekday

View File

@ -0,0 +1,24 @@
sensor:
- platform: temperature_feels_like
name: temperature_outside_feelslike
source:
- weather.openweathermap
- platform: template
sensors:
temperature_inside:
value_template: >
{{ states('sensor.temperature_kai_temperature') }}
friendly_name: 'Temperature'
unit_of_measurement: "°C"
device_class: temperature
humidity_inside:
value_template: >
{{ states('sensor.temperature_kai_humidity') }}
friendly_name: 'Humidity'
- platform: temperature_feels_like
name: temperature_inside_feelslike
source:
- sensor.temperature_inside
- sensor.humidity_inside

View File

@ -0,0 +1,73 @@
## -------------------------------------------------------------------------------------------------##
## Inputs
## -------------------------------------------------------------------------------------------------##
input_number:
climate_temp:
name: Target Manual
#initial: 21.5
min: 15
max: 29
step: 0.5
climate_temp_day:
name: Target Day
#initial: 20.5
min: 15
max: 29
step: 0.5
climate_temp_night:
name: Target Night
#initial: 17.0
min: 15
max: 29
step: 0.5
climate_temp_accuracy:
name: Accuracy
#initial: 1
min: 0
max: 5
step: 0.5
climate_temp_offset:
name: Offset Climate<->Temp
#initial: 1
min: -2
max: 2
step: 0.5
climate_temp_last:
name: Last Temp
min: 0
max: 29
step: 0.01
mode: box
input_datetime:
climate_morning:
name: "Day begins"
has_time: true
has_date: false
#initial: "10:00"
# climate_morning_weekend:
# name: "Day begins Sat."
# has_time: true
# has_date: false
# #initial: "15:30"
climate_night:
name: "Day ends"
has_time: true
has_date: false
#initial: "23:59"
input_boolean:
climate_auto:
name: 'Automatic'
icon: mdi:power
#initial: off
# climate_power:
# name: 'Power'
# icon: mdi:power
# #initial: off
# climate_weekday:
# name: 'Weekday'
# #initial: on
climate_away:
name: 'Away'
#initial: off

View File

@ -0,0 +1,256 @@
## -------------------------------------------------------------------------------------------------##
## Scripts: um einzelne Temperaturen zu setzen da Variable Fehler ausgibt (BUG)
## Ugly but working....
## -------------------------------------------------------------------------------------------------##
script:
climate_set_15_0:
sequence:
- service: climate.turn_off
entity_id: climate.kai
climate_set_15_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "15.50"
hvac_mode: "heat"
climate_set_16_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "16.00"
hvac_mode: "heat"
climate_set_16_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "16.50"
hvac_mode: "heat"
climate_set_17_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "17.00"
hvac_mode: "heat"
climate_set_17_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "17.50"
hvac_mode: "heat"
climate_set_18_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "18.00"
hvac_mode: "heat"
climate_set_18_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "18.50"
hvac_mode: "heat"
climate_set_19_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "19.00"
hvac_mode: "heat"
climate_set_19_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "19.50"
hvac_mode: "heat"
climate_set_20_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "20.00"
hvac_mode: "heat"
climate_set_20_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "20.00"
hvac_mode: "heat"
climate_set_21_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "21.00"
hvac_mode: "heat"
climate_set_21_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "21.50"
hvac_mode: "heat"
climate_set_22_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "22.00"
hvac_mode: "heat"
climate_set_22_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "22.50"
hvac_mode: "heat"
climate_set_23_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "23.00"
hvac_mode: "heat"
climate_set_23_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "23.50"
hvac_mode: "heat"
climate_set_24_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "24.00"
hvac_mode: "heat"
climate_set_24_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "24.50"
hvac_mode: "heat"
climate_set_25_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "25.00"
hvac_mode: "heat"
climate_set_25_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "25.50"
hvac_mode: "heat"
climate_set_26_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "26.00"
hvac_mode: "heat"
climate_set_26_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "26.50"
hvac_mode: "heat"
climate_set_27_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "27.00"
hvac_mode: "heat"
climate_set_27_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "27.50"
hvac_mode: "heat"
climate_set_28_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "28.00"
hvac_mode: "heat"
climate_set_28_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "28.50"
hvac_mode: "heat"
climate_set_29_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "29.00"
hvac_mode: "heat"
climate_set_29_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "29.50"
hvac_mode: "heat"
climate_set_off:
sequence:
- service: climate.turn_off
entity_id: climate.kai
climate_set:
alias: Setze Temperatur
sequence:
- service: script.turn_on
data_template:
entity_id: >
{% set temp_set = ( states("sensor.climate_temp_set") | float ) %}
{% if states("input_boolean.climate_power") == "off" %} script.climate_set_off
{% elif temp_set == ( "00.00" | float ) %} script.climate_set_20_5
{% elif temp_set <= ( "15.00" | float ) %} script.climate_set_15_0
{% elif temp_set == ( "15.50" | float ) %} script.climate_set_15_5
{% elif temp_set == ( "16.00" | float ) %} script.climate_set_16_0
{% elif temp_set == ( "16.50" | float ) %} script.climate_set_16_5
{% elif temp_set == ( "17.00" | float ) %} script.climate_set_17_0
{% elif temp_set == ( "17.50" | float ) %} script.climate_set_17_5
{% elif temp_set == ( "18.00" | float ) %} script.climate_set_18_0
{% elif temp_set == ( "18.50" | float ) %} script.climate_set_18_5
{% elif temp_set == ( "19.00" | float ) %} script.climate_set_19_0
{% elif temp_set == ( "19.50" | float ) %} script.climate_set_19_5
{% elif temp_set == ( "20.00" | float ) %} script.climate_set_20_0
{% elif temp_set == ( "20.50" | float ) %} script.climate_set_20_5
{% elif temp_set == ( "21.00" | float ) %} script.climate_set_21_0
{% elif temp_set == ( "21.50" | float ) %} script.climate_set_21_5
{% elif temp_set == ( "22.00" | float ) %} script.climate_set_22_0
{% elif temp_set == ( "22.50" | float ) %} script.climate_set_22_5
{% elif temp_set == ( "23.00" | float ) %} script.climate_set_23_0
{% elif temp_set == ( "23.50" | float ) %} script.climate_set_23_5
{% elif temp_set == ( "24.00" | float ) %} script.climate_set_24_0
{% elif temp_set == ( "24.50" | float ) %} script.climate_set_24_5
{% elif temp_set == ( "25.00" | float ) %} script.climate_set_25_0
{% elif temp_set == ( "25.50" | float ) %} script.climate_set_25_5
{% elif temp_set == ( "26.00" | float ) %} script.climate_set_26_0
{% elif temp_set == ( "26.50" | float ) %} script.climate_set_26_5
{% elif temp_set == ( "27.00" | float ) %} script.climate_set_27_0
{% elif temp_set == ( "27.50" | float ) %} script.climate_set_27_5
{% elif temp_set == ( "28.00" | float ) %} script.climate_set_28_0
{% elif temp_set == ( "28.50" | float ) %} script.climate_set_28_5
{% elif temp_set == ( "29.00" | float ) %} script.climate_set_29_0
{% elif temp_set >= ( "29.50" | float ) %} script.climate_set_29_5
{% else %} script.climate_set_20_5 {% endif %}

View File

@ -0,0 +1,215 @@
sensor:
## -----------------------------------------------------------------------------------------------##
## Calculation of temperature change
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp_change:
friendly_name: change in temperature
value_template: >
{% set now = states("sensor.aqara_temperature_kai_temperature")|float %}
{% set last = states("input_number.climate_temp_last")|float %}
{% set change = (now | float - last) | float %}
{% if now == ("0.0"|float) %} {% set change = ("0.0"|float) %} {% endif %}
{{ change | round(2) }}
## -----------------------------------------------------------------------------------------------##
## Calculation of the target temperature
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp:
friendly_name: target temperature
unit_of_measurement: '°C'
value_template: >
{% set auto = states("input_boolean.climate_auto") %}
{% set manual_temp = states("input_number.climate_temp") %}
{% if auto == "off" %} {{ manual_temp }}
{% else %}
{% set time = states("sensor.time") %}
{% set morning = states("input_datetime.climate_morning") %}
{% set night = states("input_datetime.climate_night") %}
{% set morning_temp = states("input_number.climate_temp_day")|float %}
{% set night_temp = states("input_number.climate_temp_night")|float %}
{% if night > morning %}
{% if time > morning and time <= night %} {{ morning_temp|float }}
{% else %} {{ night_temp|float }} {% endif %}
{% else %}
{% if time <= morning and time > night %} {{ morning_temp|float }}
{% else %} {{ night_temp|float }} {% endif %}
{% endif %}
{% endif %}
# Mit Weekday
# - platform: template
# sensors:
# climate_temp:
# friendly_name: target temperature
# unit_of_measurement: '°C'
# value_template: >
# {% set auto = states("input_boolean.climate_auto") %}
# {% set manual_temp = states("input_number.climate_temp") %}
# {% if auto == "off" %} {{ manual_temp }}
# {% else %}
# {% set time = states("sensor.time") %}
# {% set morning = states("sensor.climate_morning") %}
# {% set weekday = states("input_boolean.climate_weekday") %}
# {% if weekday == "on" %} {% set morning = states("input_datetime.climate_morning") %}
# {% else %} {% set morning = states("input_datetime.climate_morning_weekend") %} {% endif %}
# {% set night = states("input_datetime.climate_night") %}
# {% set morning_temp = states("input_number.climate_temp_morning")|float %}
# {% set night_temp = states("input_number.climate_temp_night")|float %}
# {% if night > morning %}
# {% if time > morning and time <= night %} {{ morning_temp|float }}
# {% else %} {{ night_temp|float }} {% endif %}
# {% else %}
# {% if time <= morning and time > night %} {{ morning_temp|float }}
# {% else %} {{ night_temp|float }} {% endif %}
# {% endif %}
# {% endif %}
## -----------------------------------------------------------------------------------------------##
## target min and max temperature
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp_min:
friendly_name: target min
unit_of_measurement: '°C'
value_template: >
{% set target = states("sensor.climate_temp")|float %}
{% set accuracy = states("input_number.climate_temp_accuracy")|float %}
{{ target-accuracy|float }}
- platform: template
sensors:
climate_temp_max:
friendly_name: target max
unit_of_measurement: '°C'
value_template: >
{% set target = states("sensor.climate_temp")|float %}
{% set accuracy = states("input_number.climate_temp_accuracy")|float %}
{{ target+accuracy|float }}
## -----------------------------------------------------------------------------------------------##
## Recommendation
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp_recommendation:
friendly_name: temperature recommendation
value_template: >
{% set min = states("sensor.climate_temp_min")|float %}
{% set max = states("sensor.climate_temp_max")|float %}
{% set target = states("sensor.climate_temp")|float %}
{% set temp_inside = states("sensor.temperature_kai_temperature")|float %}
{% set temp_outside = states("sensor.temperature_outside")|float %}
{% set inside_max = temp_inside + states("input_number.climate_temp_accuracy")|float %}
{% set accuracy = states("input_number.climate_temp_accuracy") |float %}
{% if temp_inside >= target and temp_inside >= (temp_outside - accuracy) %}
{{ "open the window" }}
{% else %}
{{ "close the window" }}
{% endif %}
## -----------------------------------------------------------------------------------------------##
## difference to target
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp_difference:
friendly_name: difference to target
value_template: >
{% if states("sensor.temperature_kai_temperature") == "unknown" %}
{{ 0 | float }}
{% else %}
{{ (states("sensor.temperature_kai_temperature") | float - (states.sensor.climate_temp.state | float) ) | round(2) }}
{% endif %}
unit_of_measurement: '°C'
- platform: template
sensors:
climate_temp_difference_inside_outside:
friendly_name: difference inside to outside
value_template: >
{% if states("sensor.temperature_kai_temperature") == "unknown" %}
{{ 0 | float }}
{% else %}
{{ (states("sensor.temperature_outside")|float - states("sensor.temperature_kai_temperature")|float) | round(2) }}
{% endif %}
unit_of_measurement: '°C'
## -----------------------------------------------------------------------------------------------##
## Schrittgröße, mit der die Heizung verstellt werden soll, abhängig vom Unterschied zur realen
## Temperatur
## Variable Schrittgröße, bei positiv (zu warm) größer, bei negativ (zu kalt) geringer
## -----------------------------------------------------------------------------------------------##
# - platform: template
# sensors:
# climate_temp_steps:
# friendly_name: increment
# value_template: >
# {% set difference = (states("sensor.climate_temp_difference" ) | float) %}
# {% set zero = ("0.0" | float ) %}
# {% if difference > zero %}
# {% if difference >= ("2.00"|float) %} {% set steps = ( "3.00" | float ) %}
# {% elif difference >= ("1.50"|float) %} {% set steps = ( "1.50" | float ) %}
# {% elif difference >= ("1.00"|float) %} {% set steps = ( "1.00" | float ) %}
# {% elif difference >= ("0.50"|float) %} {% set steps = ( "0.50" | float ) %}
# {% elif difference >= ("0.00"|float) %} {% set steps = ( "0.00" | float ) %}
# {% endif %}
# {% else %}
# {% if difference <= ("-2.00"|float) %} {% set steps = ( "3.00" | float ) %}
# {% elif difference <= ("-1.50"|float) %} {% set steps = ( "1.50" | float ) %}
# {% elif difference <= ("-1.00"|float) %} {% set steps = ( "0.50" | float ) %}
# {% elif difference <= ("-0.50"|float) %} {% set steps = ( "0.50" | float ) %}
# {% elif difference <= ("-0.00"|float) %} {% set steps = ( "0.00" | float ) %}
# {% endif %}
# {% endif %}
# {{ steps }}
## -----------------------------------------------------------------------------------------------##
## Berechnung der Temperatur, auf die die Heizung gestellt werden soll, um Zieltemperatur zu
## erreichen. Berücksichtigung für Genauigkeit, variable Temperaturanpassung und Temperatur-
## anpassung aufgrund von Offset. Berechnung ob Anpassung Positiv oder Negativ
## -----------------------------------------------------------------------------------------------##
# - platform: template
# sensors:
# climate_temp_set:
# friendly_name: '-> climate'
# value_template: >
# {% set difference = (states("sensor.climate_temp_difference" ) | float) %}
# {% set change = (states("sensor.climate_temp_change" ) | float) %}
# {% set goal = (states("sensor.climate_temp" ) | float) %}
# {% set temp = (states("sensor.aqara_temperature_kai_temperature") | float ) %}
# {% set climate = (state_attr("climate.kai", "temperature") | float ) %}
# {% if climate < ("15.0" | float ) %} {% set climate = ("15.0" | float) %} {% endif %}
# {% set max = states("sensor.climate_temp") | float %}
# {% set min = states("sensor.climate_temp") | float - (states.input_number.climate_temp_accuracy.state | float) %}
# {% set zero = ("0.0" | float ) %}
# {% set difference_max = ("1.5" | float ) %}
# {% set difference_min = ("-2.0" | float ) %}
# {% set change_max = ("1.0" | float ) %}
# {% set offset = (states("input_number.climate_temp_offset") | float ) %}
# {% set climate_goal = (goal | float + ("2.0" | float) | float - offset) | float %}
# {% set steps = (states("sensor.climate_temp_steps") | float) %}
# {% if difference == zero %} {% set result = climate %}
# {% elif (difference > difference_max) %} {% set result = ("15.0"|float) %}
# {% elif (difference < difference_min) %} {% set result = goal - offset %}
# {% elif difference > zero %}
# {% if (climate_goal <= climate) or (change >= change_max) %} {% set result = goal - offset %}
# {% elif temp > max %} {% set result = (climate | float - steps) | float %}
# {% else %} {% set result = climate %} {% endif %}
# {% elif difference < zero %}
# {% if temp < min %}
# {% set result = (climate | float + steps) | float %}
# {% else %}
# {% if change >= change_max %}
# {% set result = goal - offset %}
# {% else %}
# {% set result = climate %}
# {% endif %}
# {% endif %}
# {% endif %}
# {% if result < ("15.0"|float) %} {{ ("15.0"|float) }}
# {% elif result > ("29.5"|float) %} {{ ("29.5"|float) }}
# {% else %} {{ result }}
# {% endif %}
# unit_of_measurement: '°C'

579
packages/climate/eq3.yaml.disabled Normal file → Executable file
View File

@ -6,582 +6,3 @@ climate:
devices: devices:
kai: kai:
mac: '00:1A:22:0E:FB:32' mac: '00:1A:22:0E:FB:32'
## -------------------------------------------------------------------------------------------------##
## Scripts: um einzelne Temperaturen zu setzen da Variable Fehler ausgibt (BUG)
## Ugly but working....
## -------------------------------------------------------------------------------------------------##
script:
climate_set_15_0:
sequence:
- service: climate.turn_off
entity_id: climate.kai
climate_set_15_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "15.50"
hvac_mode: "heat"
climate_set_16_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "16.00"
hvac_mode: "heat"
climate_set_16_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "16.50"
hvac_mode: "heat"
climate_set_17_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "17.00"
hvac_mode: "heat"
climate_set_17_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "17.50"
hvac_mode: "heat"
climate_set_18_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "18.00"
hvac_mode: "heat"
climate_set_18_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "18.50"
hvac_mode: "heat"
climate_set_19_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "19.00"
hvac_mode: "heat"
climate_set_19_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "19.50"
hvac_mode: "heat"
climate_set_20_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "20.00"
hvac_mode: "heat"
climate_set_20_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "20.00"
hvac_mode: "heat"
climate_set_21_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "21.00"
hvac_mode: "heat"
climate_set_21_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "21.50"
hvac_mode: "heat"
climate_set_22_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "22.00"
hvac_mode: "heat"
climate_set_22_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "22.50"
hvac_mode: "heat"
climate_set_23_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "23.00"
hvac_mode: "heat"
climate_set_23_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "23.50"
hvac_mode: "heat"
climate_set_24_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "24.00"
hvac_mode: "heat"
climate_set_24_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "24.50"
hvac_mode: "heat"
climate_set_25_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "25.00"
hvac_mode: "heat"
climate_set_25_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "25.50"
hvac_mode: "heat"
climate_set_26_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "26.00"
hvac_mode: "heat"
climate_set_26_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "26.50"
hvac_mode: "heat"
climate_set_27_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "27.00"
hvac_mode: "heat"
climate_set_27_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "27.50"
hvac_mode: "heat"
climate_set_28_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "28.00"
hvac_mode: "heat"
climate_set_28_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "28.50"
hvac_mode: "heat"
climate_set_29_0:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "29.00"
hvac_mode: "heat"
climate_set_29_5:
sequence:
- service: climate.set_temperature
entity_id: climate.kai
data:
temperature: "29.50"
hvac_mode: "heat"
climate_set_off:
sequence:
- service: climate.turn_off
entity_id: climate.kai
climate_set:
alias: Setze Temperatur
sequence:
- service: script.turn_on
data_template:
entity_id: >
{% set temp_set = ( states("sensor.climate_temp_set") | float ) %}
{% if states("input_boolean.climate_power") == "off" %} script.climate_set_off
{% elif temp_set == ( "00.00" | float ) %} script.climate_set_20_5
{% elif temp_set <= ( "15.00" | float ) %} script.climate_set_15_0
{% elif temp_set == ( "15.50" | float ) %} script.climate_set_15_5
{% elif temp_set == ( "16.00" | float ) %} script.climate_set_16_0
{% elif temp_set == ( "16.50" | float ) %} script.climate_set_16_5
{% elif temp_set == ( "17.00" | float ) %} script.climate_set_17_0
{% elif temp_set == ( "17.50" | float ) %} script.climate_set_17_5
{% elif temp_set == ( "18.00" | float ) %} script.climate_set_18_0
{% elif temp_set == ( "18.50" | float ) %} script.climate_set_18_5
{% elif temp_set == ( "19.00" | float ) %} script.climate_set_19_0
{% elif temp_set == ( "19.50" | float ) %} script.climate_set_19_5
{% elif temp_set == ( "20.00" | float ) %} script.climate_set_20_0
{% elif temp_set == ( "20.50" | float ) %} script.climate_set_20_5
{% elif temp_set == ( "21.00" | float ) %} script.climate_set_21_0
{% elif temp_set == ( "21.50" | float ) %} script.climate_set_21_5
{% elif temp_set == ( "22.00" | float ) %} script.climate_set_22_0
{% elif temp_set == ( "22.50" | float ) %} script.climate_set_22_5
{% elif temp_set == ( "23.00" | float ) %} script.climate_set_23_0
{% elif temp_set == ( "23.50" | float ) %} script.climate_set_23_5
{% elif temp_set == ( "24.00" | float ) %} script.climate_set_24_0
{% elif temp_set == ( "24.50" | float ) %} script.climate_set_24_5
{% elif temp_set == ( "25.00" | float ) %} script.climate_set_25_0
{% elif temp_set == ( "25.50" | float ) %} script.climate_set_25_5
{% elif temp_set == ( "26.00" | float ) %} script.climate_set_26_0
{% elif temp_set == ( "26.50" | float ) %} script.climate_set_26_5
{% elif temp_set == ( "27.00" | float ) %} script.climate_set_27_0
{% elif temp_set == ( "27.50" | float ) %} script.climate_set_27_5
{% elif temp_set == ( "28.00" | float ) %} script.climate_set_28_0
{% elif temp_set == ( "28.50" | float ) %} script.climate_set_28_5
{% elif temp_set == ( "29.00" | float ) %} script.climate_set_29_0
{% elif temp_set >= ( "29.50" | float ) %} script.climate_set_29_5
{% else %} script.climate_set_20_5 {% endif %}
## -------------------------------------------------------------------------------------------------##
## Inputs
## -------------------------------------------------------------------------------------------------##
input_number:
climate_temp:
name: Ziel Manuell
#initial: 21.5
min: 15
max: 29
step: 0.5
climate_temp_morning:
name: Ziel Morgen
#initial: 20.5
min: 15
max: 29
step: 0.5
climate_temp_night:
name: Ziel Nacht
#initial: 17.0
min: 15
max: 29
step: 0.5
climate_temp_accuracy:
name: Genauigkeit
#initial: 1
min: 0
max: 5
step: 0.5
climate_temp_offset:
name: Offset Heizung->Temp
#initial: 1
min: -2
max: 2
step: 0.5
climate_temp_last:
name: Letzte Temp
min: 0
max: 29
step: 0.01
mode: box
input_datetime:
climate_morning:
name: "Morgen"
has_time: true
has_date: false
#initial: "10:00"
climate_morning_weekend:
name: "Morgen Sa"
has_time: true
has_date: false
#initial: "15:30"
climate_night:
name: "Nacht"
has_time: true
has_date: false
#initial: "23:59"
input_boolean:
climate_auto:
name: 'Automatisch'
icon: mdi:power
#initial: off
climate_power:
name: 'Power'
icon: mdi:power
#initial: off
climate_weekday:
name: 'Wochentag'
#initial: on
climate_away:
name: 'Away'
#initial: off
## -------------------------------------------------------------------------------------------------##
## Sensoren
## -------------------------------------------------------------------------------------------------##
sensor:
## -----------------------------------------------------------------------------------------------##
## Berechnung der Temperaturveränderung
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp_change:
friendly_name: Veränderung
value_template: >
{% set now = states("sensor.aqara_temperature_kai_temperature")|float %}
{% set last = states("input_number.climate_temp_last")|float %}
{% set change = (now | float - last) | float %}
{% if now == ("0.0"|float) %} {% set change = ("0.0"|float) %} {% endif %}
{{ change | round(2) }}
## -----------------------------------------------------------------------------------------------##
## Berechnung der aktuellen Zieltemperatur bzgl Morgen/Nacht, Automatik/Manuell
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp:
friendly_name: akt. Ziel
unit_of_measurement: '°C'
value_template: >
{% set auto = states("input_boolean.climate_auto") %}
{% set manual_temp = states("input_number.climate_temp") %}
{% if auto == "off" %} {{ manual_temp }}
{% else %}
{% set time = states("sensor.time") %}
{% set morning = states("sensor.climate_morning") %}
{% set weekday = states("input_boolean.climate_weekday") %}
{% if weekday == "on" %} {% set morning = states("input_datetime.climate_morning") %}
{% else %} {% set morning = states("input_datetime.climate_morning_weekend") %} {% endif %}
{% set night = states("input_datetime.climate_night") %}
{% set morning_temp = states("input_number.climate_temp_morning")|float %}
{% set night_temp = states("input_number.climate_temp_night")|float %}
{% if night > morning %}
{% if time > morning and time <= night %} {{ morning_temp|float }}
{% else %} {{ night_temp|float }} {% endif %}
{% else %}
{% if time <= morning and time > night %} {{ morning_temp|float }}
{% else %} {{ night_temp|float }} {% endif %}
{% endif %}
{% endif %}
## -----------------------------------------------------------------------------------------------##
## Berechnung von Unterschied zwischen Heizungstemperatur und realer Temperatur
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp_difference:
friendly_name: 'akt. Unterschied'
value_template: >
{% if states("sensor.aqara_temperature_kai_temperature") == "unknown" %}
{{ 0 | float }}
{% else %}
{{ ( states("sensor.aqara_temperature_kai_temperature") | float - (states.sensor.climate_temp.state | float) ) | round(2) }}
{% endif %}
unit_of_measurement: '°C'
## -----------------------------------------------------------------------------------------------##
## Schrittgröße, mit der die Heizung verstellt werden soll, abhängig vom Unterschied zur realen
## Temperatur
## Variable Schrittgröße, bei positiv (zu warm) größer, bei negativ (zu kalt) geringer
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp_steps:
friendly_name: 'Schrittgröße'
value_template: >
{% set difference = (states("sensor.climate_temp_difference" ) | float) %}
{% set zero = ("0.0" | float ) %}
{% if difference > zero %}
{% if difference >= ("2.00"|float) %} {% set steps = ( "3.00" | float ) %}
{% elif difference >= ("1.50"|float) %} {% set steps = ( "1.50" | float ) %}
{% elif difference >= ("1.00"|float) %} {% set steps = ( "1.00" | float ) %}
{% elif difference >= ("0.50"|float) %} {% set steps = ( "0.50" | float ) %}
{% elif difference >= ("0.00"|float) %} {% set steps = ( "0.00" | float ) %}
{% endif %}
{% else %}
{% if difference <= ("-2.00"|float) %} {% set steps = ( "3.00" | float ) %}
{% elif difference <= ("-1.50"|float) %} {% set steps = ( "1.50" | float ) %}
{% elif difference <= ("-1.00"|float) %} {% set steps = ( "0.50" | float ) %}
{% elif difference <= ("-0.50"|float) %} {% set steps = ( "0.50" | float ) %}
{% elif difference <= ("-0.00"|float) %} {% set steps = ( "0.00" | float ) %}
{% endif %}
{% endif %}
{{ steps }}
## -----------------------------------------------------------------------------------------------##
## Berechnung der Temperatur, auf die die Heizung gestellt werden soll, um Zieltemperatur zu
## erreichen. Berücksichtigung für Genauigkeit, variable Temperaturanpassung und Temperatur-
## anpassung aufgrund von Offset. Berechnung ob Anpassung Positiv oder Negativ
## -----------------------------------------------------------------------------------------------##
- platform: template
sensors:
climate_temp_set:
friendly_name: '-> Heizung'
value_template: >
{% set difference = (states("sensor.climate_temp_difference" ) | float) %}
{% set change = (states("sensor.climate_temp_change" ) | float) %}
{% set goal = (states("sensor.climate_temp" ) | float) %}
{% set temp = (states("sensor.aqara_temperature_kai_temperature") | float ) %}
{% set climate = (state_attr("climate.kai", "temperature") | float ) %}
{% if climate < ("15.0" | float ) %} {% set climate = ("15.0" | float) %} {% endif %}
{% set max = states("sensor.climate_temp") | float %}
{% set min = states("sensor.climate_temp") | float - (states.input_number.climate_temp_accuracy.state | float) %}
{% set zero = ("0.0" | float ) %}
{% set difference_max = ("1.5" | float ) %}
{% set difference_min = ("-2.0" | float ) %}
{% set change_max = ("1.0" | float ) %}
{% set offset = (states("input_number.climate_temp_offset") | float ) %}
{% set climate_goal = (goal | float + ("2.0" | float) | float - offset) | float %}
{% set steps = (states("sensor.climate_temp_steps") | float) %}
{% if difference == zero %} {% set result = climate %}
{% elif (difference > difference_max) %} {% set result = ("15.0"|float) %}
{% elif (difference < difference_min) %} {% set result = goal - offset %}
{% elif difference > zero %}
{% if (climate_goal <= climate) or (change >= change_max) %} {% set result = goal - offset %}
{% elif temp > max %} {% set result = (climate | float - steps) | float %}
{% else %} {% set result = climate %} {% endif %}
{% elif difference < zero %}
{% if temp < min %}
{% set result = (climate | float + steps) | float %}
{% else %}
{% if change >= change_max %}
{% set result = goal - offset %}
{% else %}
{% set result = climate %}
{% endif %}
{% endif %}
{% endif %}
{% if result < ("15.0"|float) %} {{ ("15.0"|float) }}
{% elif result > ("29.5"|float) %} {{ ("29.5"|float) }}
{% else %} {{ result }}
{% endif %}
unit_of_measurement: '°C'
## -----------------------------------------------------------------------------------------------##
## Time / Date
## -----------------------------------------------------------------------------------------------##
- platform: time_date
display_options:
- 'time'
- 'date'
automation:
## -----------------------------------------------------------------------------------------------##
## Trigger alle 15min um Abfrage und Temperaturanpassung durchzuführen
## -----------------------------------------------------------------------------------------------##
- alias: climate_set_auto
initial_state: on
trigger:
- platform: time_pattern
minutes: '/5'
- platform: state
entity_id: sensor.climate_temp
condition:
- condition: template
value_template: '{{ states.climate.kai.state != "unavailable" }}'
action:
- service: script.turn_on
entity_id: script.climate_set
- delay: '00:20'
- service: script.turn_on
entity_id: script.climate_set
- service: input_number.set_value
data_template:
entity_id: input_number.climate_temp_last
value: '{{ states("sensor.aqara_temperature_kai_temperature")|float }}'
- alias: climate_set_manual
initial_state: on
trigger:
- platform: state
entity_id: input_number.climate_temp
condition:
- condition: template
value_template: '{{ states.climate.kai.state != "unavailable" }}'
action:
- service: input_boolean.turn_off
entity_id: input_boolean.climate_auto
- service: script.turn_on
entity_id: script.climate_set
- delay: '00:20'
- service: script.turn_on
entity_id: script.climate_set
- alias: climate_set_power_off
initial_state: on
trigger:
- platform: state
entity_id: input_boolean.climate_power
to: "off"
action:
- service: climate.turn_off
entity_id: climate.kai
- delay: '00:20'
- service: climate.turn_off
entity_id: climate.kai
- alias: climate_set_power_on
initial_state: on
trigger:
- platform: state
entity_id: input_boolean.climate_power
to: "on"
action:
- service: climate.turn_on
entity_id: climate.kai
- delay: '00:20'
- service: climate.turn_on
entity_id: climate.kai
## -----------------------------------------------------------------------------------------------##
## Trigger alle 5min, wenn Wochentag -> aktiviere Weekday-Boolean
## -----------------------------------------------------------------------------------------------##
- alias: climate_weekday
initial_state: on
trigger:
platform: time_pattern
minutes: '/5'
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
- sun
action:
service: input_boolean.turn_on
entity_id: input_boolean.climate_weekday
## -----------------------------------------------------------------------------------------------##
## Trigger alle 5min, wenn Wochenende -> deaktiviere Weekday-Boolean
## -----------------------------------------------------------------------------------------------##
- alias: climate_weekend
initial_state: on
trigger:
platform: time_pattern
minutes: '/5'
condition:
- condition: time
weekday:
- sat
action:
service: input_boolean.turn_off
entity_id: input_boolean.climate_weekday

26
packages/climate/weather.yaml Executable file
View File

@ -0,0 +1,26 @@
## -------------------------------------------------------------------------------------------------##
## pirateweather
## -------------------------------------------------------------------------------------------------##
## -------------------------------------------------------------------------------------------------##
## Wetter-Plattform
## -------------------------------------------------------------------------------------------------##
sensor:
- platform: template
sensors:
temperature_outside:
value_template: '{{ states.weather.openweathermap.attributes.temperature }}'
friendly_name: 'Outside Temperature'
unit_of_measurement: '°C'
temperature_today:
value_template: >
{{ state_attr('weather.home', 'forecast')[0].temperature }}
friendly_name: 'Max Temperature'
unit_of_measurement: '°C'
temperature_today_condition:
value_template: >
{{ state_attr('weather.home', 'forecast')[0].condition }}
friendly_name: 'Condition'
sun:

View File

@ -1,22 +0,0 @@
## -------------------------------------------------------------------------------------------------##
## DarkSky
## -------------------------------------------------------------------------------------------------##
## -------------------------------------------------------------------------------------------------##
## Wetter-Plattform
## -------------------------------------------------------------------------------------------------##
weather:
- platform: darksky
api_key: !secret darksky
mode: daily
sun:
sensor:
- platform: template
sensors:
temperature_outside_darksky:
value_template: '{{ states.weather.dark_sky.attributes.temperature }}'
friendly_name: 'Outside Temperature'

1
packages/homeassistant/default_theme.yaml Normal file → Executable file
View File

@ -5,7 +5,6 @@ automation:
trigger: trigger:
- event: start - event: start
platform: homeassistant platform: homeassistant
condition: []
action: action:
- data: - data:
name: minimalist-desktop name: minimalist-desktop

37
packages/homeassistant/homeassistant.yaml Normal file → Executable file
View File

@ -8,6 +8,41 @@ homeassistant:
time_zone: Europe/Berlin time_zone: Europe/Berlin
allowlist_external_dirs: allowlist_external_dirs:
- '/tmp' - '/tmp'
auth_providers:
- type: trusted_networks
trusted_networks:
- 10.10.10.0/24
default_config: lovelace:
mode: yaml
resources: !include ../../resources.yaml
http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- ::1
- 10.10.10.0/24
- 172.30.32.0/24
- 172.30.33.0/24
#default_config:
automation:
counter:
dhcp:
energy:
frontend:
history:
map:
mobile_app:
person:
ssdp:
system_health:
timer:
usb:
webhook:
zeroconf:
zone:

View File

@ -0,0 +1,46 @@
homekit:
ip_address: 10.10.10.1
advertise_ip: 10.10.10.1
filter:
include_entities:
- sensor.temperature_kai_humidity
- sensor.temperature_kai_temperature
- light.all_indirect
- light.all_direct
- script.light_store_off
- script.light_store_restore
- scene.light_flux
- scene.light_night
- switch.adaptive_lighting_sleep_mode_default
- switch.adaptive_lighting_default
- switch.server
- switch.server_template
- scene.light_adaptive
entity_config:
sensor.temperature_kai_humidity:
name: Feuchtigkeit
sensor.temperature_kai_temperature:
name: Temperatur
light.all_indirect:
name: Indirekt
light.all_direct:
name: Direkt
script.light_store_off:
name: Licht aus
script.light_store_restore:
name: Licht an
scene.light_adaptive:
name: Licht Adaptiv
scene.light_night:
name: Licht Nacht
switch.adaptive_lighting_default:
name: Adaptiv
switch.adaptive_lighting_sleep_mode_default:
name: Schlaf
switch.server:
name: Server
switch.server_template:
name: Server Status

View File

@ -0,0 +1,12 @@
logbook:
exclude:
entities:
- automation.light_all_snapshot
- automation.climate_weekend
- automation.climate_weekday
entity_globs:
- sensor.pfsense_*
- binary_sensor.pfsense_*
- script.climate_set_*
- sensor.home_*
- sensor.openweathermap_*

View File

@ -1,27 +0,0 @@
lovelace:
mode: yaml
resources:
- url: /hacsfiles/button-card/button-card.js
type: module
- url: /hacsfiles/light-entity-card/light-entity-card.js
type: module
- url: /hacsfiles/lovelace-auto-entities/auto-entities.js
type: module
- url: /hacsfiles/lovelace-card-mod/card-mod.js
type: module
- url: /hacsfiles/mini-graph-card/mini-graph-card-bundle.js
type: module
- url: /hacsfiles/mini-media-player/mini-media-player-bundle.js
type: module
- url: /hacsfiles/my-cards/my-slider.js
type: module
- url: /hacsfiles/simple-weather-card/simple-weather-card-bundle.js
type: module
- url: /hacsfiles/home-assistant-sun-card/home-assistant-sun-card.js
type: module
- url: /hacsfiles/lovelace-layout-card/layout-card.js
type: module
- url: /hacsfiles/lovelace-state-switch/state-switch.js
type: module

View File

@ -0,0 +1,15 @@
script:
summary_notification:
sequence:
- service: notify.notify
data:
message: >
{% set maxTemp = states("sensor.temperature_today") %}
{% set condition = states("sensor.temperature_today_condition") %}
{% set currentTemp = states("sensor.temperature_outside") %}
{% set recommendation = states("sensor.climate_temp_recommendation") %}
{% set insideTemp = states("sensor.temperature_kai_temperature") %}
At the moment it is {{ condition }} outside with a temperature of {{ currentTemp }}°C.
Todays max temperature will be {{ maxTemp }}°C.
It is {{ insideTemp }}°C inside and recommended to {{ recommendation }}.
mode: single

0
packages/homeassistant/recorder.yaml Normal file → Executable file
View File

View File

@ -0,0 +1,8 @@
## -----------------------------------------------------------------------------------------------##
## Time / Date
## -----------------------------------------------------------------------------------------------##
sensor:
- platform: time_date
display_options:
- 'time'
- 'date'

View File

@ -1,62 +0,0 @@
homekit:
ip_address: 10.10.10.50
filter:
include_entities:
- sensor.temperature_kai_humidity
- sensor.temperature_kai_pressure
- sensor.temperature_kai_temperature
- sensor.temperature_outside_darksky
- sensor.schreibtisch_current_consumption
- sensor.schreibtisch_today_s_consumption
- sensor.schreibtisch_total_consumption
- light.all_indirect
- light.all_direct
- light.all_lights
- scene.light_alloff
- scene.light_blue
- scene.light_flux
- scene.light_night
- switch.circadian_lighting_circadian_lighting
- binary_sensor.mullvad_exit_ip
- switch.server
- switch.server_template
entity_config:
sensor.temperature_kai_humidity:
name: Humidity
sensor.temperature_kai_pressure:
name: Pressure
sensor.temperature_kai_temperature:
name: Temperature
sensor.temperature_outside_darksky:
name: Outside
sensor.schreibtisch_current_consumption:
name: Consumption
sensor.schreibtisch_today_s_consumption:
name: Consumption Today
sensor.schreibtisch_total_consumption:
name: Consumption Total
light.all_indirect:
name: Indirect
light.all_direct:
name: Direct
light.all_lights:
name: All Lights
scene.light_alloff:
name: Lights Off
scene.light_blue:
name: Lights Blue
scene.light_flux:
name: Lights Flux
scene.light_night:
name: Lights Night
switch.circadian_lighting_circadian_lighting:
name: Circadian
binary_sensor.mullvad_exit_ip:
name: Mullvad
switch.server:
name: Server
switch.server_template:
name: Server Status

View File

@ -1,16 +0,0 @@
## -------------------------------------------------------------------------------------------------##
## Circadian Lighting / Flux
## -------------------------------------------------------------------------------------------------##
circadian_lighting:
min_colortemp: 2700
max_colortemp: 6500
interval: 450
transition: 8
switch:
- platform: circadian_lighting
lights_ct:
- light.stripe
- light.direct
max_brightness: 80

View File

@ -0,0 +1,18 @@
adaptive_lighting:
- name: "default"
lights:
- light.stripe
- light.direct
prefer_rgb_color: false
transition: 45
initial_transition: 1
interval: 90
min_brightness: 1
max_brightness: 80
min_color_temp: 2500
max_color_temp: 6500
sleep_brightness: 1
sleep_color_temp: 1000
take_over_control: true
detect_non_ha_changes: false
only_once: false

View File

@ -0,0 +1,31 @@
input_boolean:
lights_needed:
name: Lights needed
initial: false
automation:
- alias: lights_needed
mode: single
trigger:
- platform: time_pattern
minutes: "10"
action:
- if:
# Resets at midnight -> OR instead of AND
- condition: or
conditions:
- condition: sun
after: sunset
after_offset: "-01:00"
- condition: sun
before: sunrise
before_offset: "+01:00"
then:
- service: input_boolean.turn_on
target:
entity_id: input_boolean.lights_needed
else:
- service: input_boolean.turn_off
target:
entity_id: input_boolean.lights_needed

View File

@ -0,0 +1,66 @@
automation:
- alias: light_still_on_still_needed_notify
mode: single
trigger:
- platform: state
entity_id:
- light.all_lights
to: "on"
for:
hours: 0
minutes: 15
seconds: 0
condition:
- condition: state
entity_id: input_boolean.lights_needed
state: "off"
for:
hours: 0
minutes: 15
seconds: 0
action:
- service: notify.mobile_app_iphone
data:
message: "Lights are still on."
data:
actions:
- action: "LIGHTTURNOFF"
title: Turn them off
icon: "sfsymbols:lightbulb"
- alias: light_still_on_iphone_offline_notify
mode: single
trigger:
- platform: state
entity_id:
- device_tracker.pfsense_kais_iphone_wnsrt_de
to: not_home
for:
hours: 0
minutes: 2
seconds: 0
condition:
- condition: state
entity_id: light.all_lights
state: "on"
action:
- service: notify.mobile_app_iphone
data:
message: "Lights are still on."
data:
actions:
- action: "LIGHTTURNOFF"
title: Turn them off
icon: "sfsymbols:lightbulb"
- alias: light_still_on_notification_event
trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "LIGHTTURNOFF"
action:
- service: light.turn_off
target:
entity_id: light.all_lights

View File

@ -0,0 +1,34 @@
scene:
- name: light_adaptive
entities:
light.all_direct: false
light.all_indirect: true
switch.adaptive_lighting_default: on
switch.adaptive_lighting_sleep_mode_default: off
- name: light_blue
entities:
switch.adaptive_lighting_default: off
switch.adaptive_lighting_sleep_mode_default: off
light.all_direct: false
light.all_indirect:
rgb_color: [0, 0, 255]
state: true
brightness: 20
- name: light_night
entities:
switch.adaptive_lighting_default: on
light.all_direct: false
light.all_indirect:
rgb_color: [255, 139, 21]
state: true
brightness: 1
switch.adaptive_lighting_sleep_mode_default: on
- name: light_bright
entities:
switch.adaptive_lighting_default: off
light.all_direct: false
light.all_lights:
color_temp: 238
state: true
brightness: 255
switch.adaptive_lighting_sleep_mode_default: off

View File

@ -0,0 +1,20 @@
automation:
- alias: light_all_snapshot
mode: single
trigger:
- platform: time_pattern
seconds: "30"
condition:
- condition: state
entity_id: light.all_lights
state: "on"
action:
- service: scene.create
data:
scene_id: snapshot_all
snapshot_entities:
- light.all_indirect
- light.bed_ceiling
- light.ceiling
- switch.adaptive_lighting_sleep_mode_default
- switch.adaptive_lighting_default

View File

@ -1,25 +0,0 @@
scene:
- name: light_alloff
entities:
light.all_lights: false
- name: light_flux
entities:
light.all_direct: false
light.all_indirect: true
switch.circadian_lighting_circadian_lighting: on
- name: light_blue
entities:
switch.circadian_lighting_circadian_lighting: off
light.all_direct: false
light.all_indirect:
rgb_color: [0, 0, 255]
state: true
brightness: 20
- name: light_night
entities:
switch.circadian_lighting_circadian_lighting: off
light.all_direct: false
light.all_indirect:
rgb_color: [255, 139, 21]
state: true
brightness: 1

View File

@ -1,28 +0,0 @@
## -------------------------------------------------------------------------------------------------##
## Light_Store
## https://github.com/pnbruckner/homeassistant-config/blob/master/python_scripts/light_store.py
## -------------------------------------------------------------------------------------------------##
script:
light_store_save:
sequence:
- service: python_script.light_store
data:
store_name: flash_store
entity_id:
- light.bed
- light.closet
- light.desk
- light.direct
- light.tv
light_store_off:
sequence:
- service: script.light_store_save
- service: light.turn_off
entity_id: light.all_lights
light_store_restore:
sequence:
- service: python_script.light_store
data:
store_name: flash_store
operation: restore

23
packages/light/yeelight.yaml Normal file → Executable file
View File

@ -1,8 +1,3 @@
## -------------------------------------------------------------------------------------------------##
## Yeelight
## -------------------------------------------------------------------------------------------------##
## -------------------------------------------------------------------------------------------------## ## -------------------------------------------------------------------------------------------------##
## Discovery disable ## Discovery disable
## -------------------------------------------------------------------------------------------------## ## -------------------------------------------------------------------------------------------------##
@ -12,40 +7,40 @@ discovery:
## -------------------------------------------------------------------------------------------------## ## -------------------------------------------------------------------------------------------------##
## Lampen-Konfig ## Lights
## -------------------------------------------------------------------------------------------------## ## -------------------------------------------------------------------------------------------------##
yeelight: yeelight:
devices: devices:
10.10.10.82: 10.10.10.82:
name: ceiling1 name: ceiling1
save_on_change: False save_on_change: False
transition: 2500 transition: 500
10.10.10.83: 10.10.10.83:
name: ceiling2 name: ceiling2
save_on_change: False save_on_change: False
transition: 2500 transition: 500
10.10.10.80: 10.10.10.80:
name: ceiling3 name: ceiling3
save_on_change: False save_on_change: False
transition: 2500 transition: 500
10.10.10.81: 10.10.10.81:
name: bed_ceiling name: bed_ceiling
save_on_change: False save_on_change: False
transition: 2500 transition: 500
10.10.10.84: 10.10.10.84:
name: bed name: bed
save_on_change: False save_on_change: False
transition: 2500 transition: 500
model: strip1 model: strip1
10.10.10.85: 10.10.10.85:
name: desk name: desk
save_on_change: False save_on_change: False
transition: 2500 transition: 500
model: strip1 model: strip1
## -------------------------------------------------------------------------------------------------## ## -------------------------------------------------------------------------------------------------##
## Lampengruppen ## Light Groups
## -------------------------------------------------------------------------------------------------## ## -------------------------------------------------------------------------------------------------##
light: light:
- platform: group - platform: group
@ -79,5 +74,3 @@ light:
entities: entities:
- light.all_direct - light.all_direct
- light.all_indirect - light.all_indirect

8
packages/minimalist/custom_entities.yaml Normal file → Executable file
View File

@ -1,11 +1,3 @@
input_boolean: input_boolean:
welcome_collapse: welcome_collapse:
name: welcome_collapse name: welcome_collapse
input_select:
minimalist_ui_switch:
name: Select popup/view
options:
- light.all_indirect
- light.all_direct

2
packages/nas/wol.yaml Normal file → Executable file
View File

@ -3,13 +3,11 @@
## -------------------------------------------------------------------------------------------------## ## -------------------------------------------------------------------------------------------------##
wake_on_lan: wake_on_lan:
switch: switch:
- platform: wake_on_lan - platform: wake_on_lan
mac: 54:04:A6:BF:1E:43 mac: 54:04:A6:BF:1E:43
name: Server name: Server
host: ip.wnsrt.de host: ip.wnsrt.de
#switch:
- platform: template - platform: template
switches: switches:
server_template: server_template:

View File

@ -0,0 +1,29 @@
automation:
- alias: "pfSense WAN Down"
trigger:
- platform: state
entity_id: sensor.pfsense_gateway_wan_gw_status
to: 'False'
action:
- service: notify.notify
data:
message: "WAN Gateway went offline"
- alias: "pfSense Mullvad Down"
trigger:
- platform: state
entity_id: sensor.pfsense_gateway_mullvad1gw_status
to: 'False'
- platform: state
entity_id: sensor.pfsense_gateway_mullvad1gwv6_status
to: 'False'
- platform: state
entity_id: sensor.pfsense_gateway_mullvad2gw_status
to: 'False'
- platform: state
entity_id: sensor.pfsense_gateway_mullvad2gwv6_status
to: 'False'
action:
- service: notify.notify
data:
message: "A Mullvad connection went offline"

View File

@ -1,119 +0,0 @@
VERSION = '1.2.0'
DOMAIN = 'light_store'
ATTR_OPERATION = 'operation'
ATTR_OP_SAVE = 'save'
ATTR_OP_RESTORE = 'restore'
ATTR_OVERWRITE = 'overwrite'
ATTR_STORE_NAME = 'store_name'
ATTR_ENTITY_ID = 'entity_id'
# Select light attributes to save/restore.
ATTR_BRIGHTNESS = "brightness"
ATTR_EFFECT = "effect"
ATTR_WHITE_VALUE = "white_value"
ATTR_COLOR_TEMP = "color_temp"
ATTR_HS_COLOR = "hs_color"
# Save any of these attributes.
GEN_ATTRS = [ATTR_BRIGHTNESS, ATTR_EFFECT]
# Save only one of these attributes, in order of precedence.
COLOR_ATTRS = [ATTR_WHITE_VALUE, ATTR_COLOR_TEMP, ATTR_HS_COLOR]
def store_entity_id(store_name, entity_id):
return '{}.{}'.format(store_name, entity_id.replace('.', '_'))
# Get operation (default to save.)
operation = data.get(ATTR_OPERATION, ATTR_OP_SAVE)
if operation not in [ATTR_OP_SAVE, ATTR_OP_RESTORE]:
logger.error('Invalid operation. Expected {} or {}, got: {}'.format(
ATTR_OP_SAVE, ATTR_OP_RESTORE, operation))
else:
# Get optional store name (default to DOMAIN.)
store_name = data.get(ATTR_STORE_NAME, DOMAIN)
# Get optional overwrite parameter (only applies to saving.)
overwrite = data.get(ATTR_OVERWRITE, True)
# Get optional list (or comma separated string) of switches & lights to
# save/restore.
entity_id = data.get(ATTR_ENTITY_ID)
if isinstance(entity_id, str):
entity_id = [e.strip() for e in entity_id.split(',')]
# Replace any group entities with their contents.
# Repeat until no groups left in list.
expanded_a_group = True
while entity_id and expanded_a_group:
expanded_a_group = False
for e in entity_id:
if e.startswith('group.'):
entity_id.remove(e)
g = hass.states.get(e)
if g and 'entity_id' in g.attributes:
entity_id.extend(g.attributes['entity_id'])
expanded_a_group = True
# Get lists of switches and lights that actually exist,
# and list of entities that were previously saved.
entity_ids = (hass.states.entity_ids('switch') +
hass.states.entity_ids('light'))
saved = hass.states.entity_ids(store_name)
# When restoring, limit to existing entities that were saved.
if operation == ATTR_OP_RESTORE:
saved_entity_ids = []
for e in entity_ids:
if store_entity_id(store_name, e) in saved:
saved_entity_ids.append(e)
entity_ids = saved_entity_ids
# If a list of entities was specified, further limit to just those.
# Otherwise, save all existing switches and lights, or restore
# all existing switches and lights that were previously saved.
if entity_id:
entity_ids = tuple(set(entity_ids).intersection(set(entity_id)))
if operation == ATTR_OP_SAVE:
# Only save if not already saved, or if overwite is True.
if not saved or overwrite:
# Clear out any previously saved states.
for entity_id in saved:
hass.states.remove(entity_id)
# Save selected switches and lights to store.
for entity_id in entity_ids:
cur_state = hass.states.get(entity_id)
if cur_state is None:
logger.error('Could not get state of {}.'.format(entity_id))
else:
attributes = {}
if entity_id.startswith('light.') and cur_state.state == 'on':
for attr in GEN_ATTRS:
if attr in cur_state.attributes:
attributes[attr] = cur_state.attributes[attr]
for attr in COLOR_ATTRS:
if attr in cur_state.attributes:
attributes[attr] = cur_state.attributes[attr]
break
hass.states.set(store_entity_id(store_name, entity_id),
cur_state.state, attributes)
else:
# Restore selected switches and lights from store.
for entity_id in entity_ids:
old_state = hass.states.get(store_entity_id(store_name, entity_id))
if old_state is None:
logger.error('No saved state for {}.'.format(entity_id))
else:
turn_on = old_state.state == 'on'
service_data = {'entity_id': entity_id}
component = entity_id.split('.')[0]
if component == 'light' and turn_on and old_state.attributes:
service_data.update(old_state.attributes)
hass.services.call(component,
'turn_on' if turn_on else 'turn_off',
service_data)
# Remove saved states now that we're done with them.
for entity_id in saved:
hass.states.remove(entity_id)

36
resources.yaml Executable file
View File

@ -0,0 +1,36 @@
- url: /hacsfiles/button-card/button-card.js
type: module
- url: /hacsfiles/light-entity-card/light-entity-card.js
type: module
- url: /hacsfiles/lovelace-auto-entities/auto-entities.js
type: module
- url: /hacsfiles/lovelace-card-mod/card-mod.js
type: module
- url: /hacsfiles/mini-graph-card/mini-graph-card-bundle.js
type: module
- url: /hacsfiles/mini-media-player/mini-media-player-bundle.js
type: module
- url: /hacsfiles/my-cards/my-slider.js
type: module
- url: /hacsfiles/my-cards/my-button.js
type: module
- url: /hacsfiles/simple-weather-card/simple-weather-card-bundle.js
type: module
- url: /hacsfiles/home-assistant-sun-card/home-assistant-sun-card.js
type: module
- url: /hacsfiles/lovelace-layout-card/layout-card.js
type: module
- url: /hacsfiles/lovelace-state-switch/state-switch.js
type: module
- url: /hacsfiles/lovelace-valetudo-map-card/valetudo-map-card.js
type: module
- url: /hacsfiles/apexcharts-card/apexcharts-card.js
type: module
- url: /hacsfiles/lovelace-home-feed-card/lovelace-home-feed-card.js
type: module
- url: /hacsfiles/hass-swipe-navigation/swipe-navigation.js
type: module
- url: /hacsfiles/weather-card/weather-card.js
type: module
- url: /hacsfiles/lovelace-mushroom/mushroom.js
type: module

View File

@ -0,0 +1,129 @@
---
minimalist-desktop:
# Journal
state-icon-color: "rgb(var(--color-theme))"
border-radius: "20px"
ha-card-border-radius: "var(--border-radius)"
error-color: "var(--google-red)"
warning-color: "var(--google-yellow)"
success-color: "var(--google-green)"
info-color: "var(--google-blue)"
divider-color: "rgba(var(--color-theme),.12)"
accent-color: "var(--google-yellow)"
card-mod-theme: "minimalist-desktop"
card-mod-view-yaml: |
"*:first-child$": |
#columns .column > * {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
modes:
light:
# text
primary-text-color: "#212121"
# main interface colors
primary-color: "#434343"
google-red: "#F54436"
google-green: "#01C852"
google-yellow: "#FF9101"
google-blue: "#3D5AFE"
google-violet: "#661FFF"
google-grey: "#BBBBBB"
color-red: "245, 68, 54"
color-green: "1, 200, 82"
color-yellow: "255, 145, 1"
color-blue: "61, 90, 254"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-theme: "51,51,51"
color-background-yellow: "250, 250, 250"
color-background-blue: "250, 250, 250"
color-background-green: "250, 250, 250"
color-background-red: "250, 250, 250"
color-background-pink: "250, 250, 250"
color-background-purple: "250, 250, 250"
color-yellow-text: "var(--primary-text-color)"
color-blue-text: "var(--primary-text-color)"
color-green-text: "var(--primary-text-color)"
color-red-text: "var(--primary-text-color)"
color-pink-text: "var(--primary-text-color)"
color-purple-text: "var(--primary-text-color)"
opacity-bg: "1"
# background and sidebar
card-background-color: "#FAFAFA"
primary-background-color: "#EFEFEF"
secondary-background-color: "#EFEFEF"
# header
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
# paper-tabs-selection-bar-color: "var(--primary-text-color)"
# slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# cards
box-shadow: "0px 2px 4px 0px rgba(0,0,0,0.16)"
ha-card-box-shadow: "var(--box-shadow)"
# sidebar
sidebar-selected-text-color: "var(--google-red)"
sidebar-selected-icon-color: "var(--google-red)"
sidebar-text-color: "#80868b"
# switch
switch-checked-color: "var(--google-blue)"
# media player
mini-media-player-accent-color: "var(--google-blue)"
dark:
# text
primary-text-color: "#DDDDDD"
# main interface colors
primary-color: "#89B3F8"
google-red: "#F18B82"
google-green: "#80C994"
google-yellow: "#FCD663"
google-blue: "#89B3F8"
google-violet: "#BB86FC"
google-grey: "#BBBBBB"
color-red: "241, 139, 130"
color-green: "128, 201, 148"
color-yellow: "252, 214, 99"
color-blue: "137, 179, 248"
color-theme: "221,221,221"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-background-yellow: "var(--color-yellow)"
color-background-blue: "var(--color-blue)"
color-background-green: "var(--color-green)"
color-background-red: "var(--color-red)"
color-background-pink: "var(--color-pink)"
color-background-purple: "var(--color-purple)"
color-yellow-text: "var(--color-yellow)"
color-blue-text: "var(--color-blue)"
color-green-text: "var(--color-green)"
color-red-text: "var(--color-red)"
color-pink-text: "var(--color-pink)"
color-purple-text: "var(--color-purple)"
opacity-bg: "0.1"
# floating button text color
mdc-theme-on-secondary: "var(--card-background-color)"
# background and sidebar
card-background-color: "#1D1D1D"
primary-background-color: "#121212"
secondary-background-color: "#121212"
# header
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
# Sidebar
sidebar-selected-text-color: "rgb(var(--color-blue))"
sidebar-selected-icon-color: "rgb(var(--color-blue))"
# Slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# card
box-shadow: "none"
# media player
mini-media-player-accent-color: "var(--google-blue)"
# Journal
state-icon-color: "rgb(var(--color-theme))"

View File

@ -0,0 +1,206 @@
---
minimalist-ios-tapbar:
# version 1.0.1
# By LRvdLinden
# Journal
state-icon-color: "rgb(var(--color-theme))"
border-radius: "20px"
ha-card-border-radius: "var(--border-radius)"
error-color: "var(--google-red)"
warning-color: "var(--google-yellow)"
success-color: "var(--google-green)"
info-color: "var(--google-blue)"
divider-color: "rgba(var(--color-theme),.12)"
accent-color: "var(--google-yellow)"
card-mod-theme: "minimalist-ios-tapbar"
card-mod-root: |
app-toolbar {
display: none;
}
header-height: "78px"
card-mod-view-yaml: |
"*:first-child$": |
#columns .column > * {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
# Move navbar
card-mod-root-yaml: |
ha-tabs$: |
#tabsContent {
width: 97%;
}
.: |
@media (orientation: portrait) {
a.menu-link[target="_blank"], ha-button-menu, ha-menu-button, [main-title] {
display: none !important;
}
app-toolbar {
padding-right: 0px;
padding-left: 0px;
}
}
ha-app-layout{
transform: initial;
padding: 0 !important;
margin: 0 !important;
width: 100%;
height: 100% !important;
}
app-header {
top: auto;
bottom: 0;
box-shadow: var(--footer-shadow);
position: fixed;
height: var(--header-height) !important;
}
app-toolbar {
height: var(--header-height) !important;
padding: 10px 0px !important;
background: var( --ha-card-background, var(--card-background-color) );
}
#view {
margin-top: calc(-1 * var(--header-height)) !important;
padding-bottom: var(--header-height) !important;
}
ha-tabs {
--paper-tabs-selection-bar-color: var(--header-tab-indicator-color) !important;
--mdc-icon-size: 26px;
display: flex;
justify-content: space-between;
padding: 10px;
margin-top:15px;
height:var(--header-height) !important;
}
paper-tab[aria-selected=true] {
color: var(--header-active-tab-color);
background-color: var(--header-active-tab-bg-color);
}
paper-tab {
color: var(--header-all-tabs-color);
border-radius: 25px;
height:50px;
padding: 0 20px;
}
# Color themes
modes:
light:
# main interface colors
primary-color: "#434343"
google-red: "#F54436"
google-green: "#01C852"
google-yellow: "#FF9101"
google-blue: "#3D5AFE"
google-violet: "#661FFF"
google-grey: "#BBBBBB"
color-red: "245, 68, 54"
color-green: "1, 200, 82"
color-yellow: "255, 145, 1"
color-blue: "61, 90, 254"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-theme: "51,51,51"
color-background-yellow: "250, 250, 250"
color-background-blue: "250, 250, 250"
color-background-green: "250, 250, 250"
color-background-red: "250, 250, 250"
color-background-pink: "250, 250, 250"
color-background-purple: "250, 250, 250"
color-yellow-text: "var(--primary-text-color)"
color-blue-text: "var(--primary-text-color)"
color-green-text: "var(--primary-text-color)"
color-red-text: "var(--primary-text-color)"
color-pink-text: "var(--primary-text-color)"
color-purple-text: "var(--primary-text-color)"
opacity-bg: "1"
# Header / Footer
header-active-tab-color: "rgb(var(--color-blue))"
header-active-tab-bg-color: "rgba(var(--color-blue), .3)"
header-all-tabs-color: "var(--paper-item-icon-color)"
header-tab-indicator-color: "rgba(0, 0, 0, 0)"
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
footer-shadow: "0px -1px 3px 0px rgba(0,0,0,0.12)"
# background and sidebar
card-background-color: "#FAFAFA"
primary-background-color: "#EFEFEF"
secondary-background-color: "#EFEFEF"
# text
primary-text-color: "#212121"
# slider
slider-color: "rgb(var(--google-blue))"
slider-bar-color: "rgba(var(--google-blue),0.38)"
# cards
box-shadow: "0px 2px 4px 0px rgba(0,0,0,0.16)"
ha-card-box-shadow: "var(--box-shadow)"
# sidebar
sidebar-selected-text-color: "rgb(var(--color-blue))"
sidebar-selected-icon-color: "rgb(var(--color-blue))"
sidebar-text-color: "#80868b"
# switch
switch-checked-color: "rgb(var(--color-blue))"
# media player
mini-media-player-accent-color: "rgb(var(--color-blue))"
dark:
# main interface colors
primary-color: "#89B3F8"
google-red: "#F18B82"
google-green: "#80C994"
google-yellow: "#FCD663"
google-blue: "#89B3F8"
google-violet: "#BB86FC"
google-grey: "#BBBBBB"
color-red: "241, 139, 130"
color-green: "128, 201, 148"
color-yellow: "252, 214, 99"
color-blue: "137, 179, 248"
color-theme: "221,221,221"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-amber: "255, 145, 1"
color-background-yellow: "var(--color-yellow)"
color-background-blue: "var(--color-blue)"
color-background-green: "var(--color-green)"
color-background-red: "var(--color-red)"
color-background-pink: "var(--color-pink)"
color-background-purple: "var(--color-purple)"
color-yellow-text: "var(--color-yellow)"
color-blue-text: "var(--color-blue)"
color-green-text: "var(--color-green)"
color-red-text: "var(--color-red)"
color-pink-text: "var(--color-pink)"
color-purple-text: "var(--color-purple)"
opacity-bg: "0.1"
# Header / Footer
header-active-tab-color: "rgb(var(--color-amber))"
header-active-tab-bg-color: "rgba(var(--color-amber), .3)"
header-all-tabs-color: "var(--paper-item-icon-color)"
header-tab-indicator-color: "rgba(0, 0, 0, 0)"
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
footer-shadow: "0px -1px 3px 0px rgba(0,0,0,0.12)"
# background and sidebar
card-background-color: "#1D1D1D"
primary-background-color: "#121212"
secondary-background-color: "#121212"
# text
primary-text-color: "#DDDDDD"
# floating button text color
mdc-theme-on-secondary: "var(--card-background-color)"
# Sidebar
sidebar-selected-text-color: "rgb(var(--color-amber))"
sidebar-selected-icon-color: "rgb(var(--color-amber))"
# Slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# card
box-shadow: "none"
# media player
mini-media-player-accent-color: "var(--google-blue)"
# Journal
state-icon-color: "rgb(var(--color-theme))"

View File

@ -0,0 +1,206 @@
---
minimalist-mobile-tapbar:
# Journal
state-icon-color: "rgb(var(--color-theme))"
border-radius: "20px"
ha-card-border-radius: "var(--border-radius)"
error-color: "var(--google-red)"
warning-color: "var(--google-yellow)"
success-color: "var(--google-green)"
info-color: "var(--google-blue)"
divider-color: "rgba(var(--color-theme),.12)"
accent-color: "var(--google-yellow)"
card-mod-theme: "minimalist-mobile-tapbar"
header-height: "calc(var(--header-base-height) + env(safe-area-inset-bottom))"
header-base-height: "70px"
app-header-selection-bar-color: "transparent"
card-mod-view-yaml: |
"*:first-child$": |
#columns .column > * {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
# Move navbar
card-mod-root-yaml: |
ha-tabs$: |
#tabsContent {
width: 97%;
}
.: |
@media (orientation: portrait) {
a.menu-link[target="_blank"], ha-button-menu, ha-menu-button, [main-title] {
display: none !important;
}
app-toolbar {
padding-right: 0px;
padding-left: 0px;
}
}
ha-app-layout{
transform: initial;
padding: 0 !important;
margin: 0 !important;
width: 100%;
height: 100% !important;
}
app-header {
top: auto;
bottom: 0;
box-shadow: var(--footer-shadow);
position: fixed;
height: var(--header-height) !important;
}
app-toolbar {
height: var(--header-base-height) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
#view {
margin-top: calc(-1 * var(--header-height)) !important;
padding-bottom: var(--header-height);
}
ha-tabs {
--paper-tabs-selection-bar-color: var(--header-tab-indicator-color);
--mdc-icon-size: 26px;
display: flex;
justify-content: space-between;
padding: 0 10px;
height:50px !important;
}
paper-tab[aria-selected=true] {
color: var(--header-active-tab-color);
background-color: var(--header-active-tab-bg-color);
}
paper-tab {
color: var(--header-all-tabs-color);
border-radius: 25px;
height:50px;
/*width: calc(100% / 4);
padding: 0;*/
padding-left: 20px;
padding-right: 20px;
}
# Color themes
modes:
light:
# main interface colors
primary-color: "#434343"
google-red: "#F54436"
google-green: "#01C852"
google-yellow: "#FF9101"
google-blue: "#3D5AFE"
google-violet: "#661FFF"
google-grey: "#BBBBBB"
color-red: "245, 68, 54"
color-green: "1, 200, 82"
color-yellow: "255, 145, 1"
color-blue: "61, 90, 254"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-theme: "51,51,51"
color-background-yellow: "250, 250, 250"
color-background-blue: "250, 250, 250"
color-background-green: "250, 250, 250"
color-background-red: "250, 250, 250"
color-background-pink: "250, 250, 250"
color-background-purple: "250, 250, 250"
color-yellow-text: "var(--primary-text-color)"
color-blue-text: "var(--primary-text-color)"
color-green-text: "var(--primary-text-color)"
color-red-text: "var(--primary-text-color)"
color-pink-text: "var(--primary-text-color)"
color-purple-text: "var(--primary-text-color)"
opacity-bg: "1"
# Header / Footer
header-active-tab-color: "rgb(var(--color-blue))"
header-active-tab-bg-color: "rgba(var(--color-blue), .3)"
header-all-tabs-color: "var(--paper-item-icon-color)"
header-tab-indicator-color: "rgba(0, 0, 0, 0)"
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var( --ha-card-background, var(--card-background-color, white) )"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
footer-shadow: "0px -1px 3px 0px rgba(0,0,0,0.12)"
# background and sidebar
card-background-color: "#FAFAFA"
primary-background-color: "#EFEFEF"
secondary-background-color: "#EFEFEF"
# text
primary-text-color: "#212121"
# slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# cards
box-shadow: "0px 2px 4px 0px rgba(0,0,0,0.16)"
ha-card-box-shadow: "var(--box-shadow)"
# sidebar
sidebar-selected-text-color: "rgb(var(--color-blue))"
sidebar-selected-icon-color: "rgb(var(--color-blue))"
sidebar-text-color: "#80868b"
# switch
switch-checked-color: "rgb(var(--color-blue))"
# media player
mini-media-player-accent-color: "rgb(var(--color-blue))"
dark:
# main interface colors
primary-color: "#89B3F8"
google-red: "#F18B82"
google-green: "#80C994"
google-yellow: "#FCD663"
google-blue: "#89B3F8"
google-violet: "#BB86FC"
google-grey: "#BBBBBB"
color-red: "241, 139, 130"
color-green: "128, 201, 148"
color-yellow: "252, 214, 99"
color-blue: "137, 179, 248"
color-theme: "221,221,221"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-amber: "255, 145, 1"
color-background-yellow: "var(--color-yellow)"
color-background-blue: "var(--color-blue)"
color-background-green: "var(--color-green)"
color-background-red: "var(--color-red)"
color-background-pink: "var(--color-pink)"
color-background-purple: "var(--color-purple)"
color-yellow-text: "var(--color-yellow)"
color-blue-text: "var(--color-blue)"
color-green-text: "var(--color-green)"
color-red-text: "var(--color-red)"
color-pink-text: "var(--color-pink)"
color-purple-text: "var(--color-purple)"
opacity-bg: "0.1"
# Header / Footer
header-active-tab-color: "rgb(var(--color-amber))"
header-active-tab-bg-color: "rgba(var(--color-amber), .3)"
header-all-tabs-color: "var(--paper-item-icon-color)"
header-tab-indicator-color: "rgba(0, 0, 0, 0)"
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var( --ha-card-background, var(--card-background-color, rgb(29, 29, 29)) )"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
footer-shadow: "0px -1px 3px 0px rgba(0,0,0,0.12)"
# background and sidebar
card-background-color: "#1D1D1D"
primary-background-color: "#121212"
secondary-background-color: "#121212"
# text
primary-text-color: "#DDDDDD"
# floating button text color
mdc-theme-on-secondary: "var(--card-background-color)"
# Sidebar
sidebar-selected-text-color: "rgb(var(--color-amber))"
sidebar-selected-icon-color: "rgb(var(--color-amber))"
# Slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# card
box-shadow: "none"
# media player
mini-media-player-accent-color: "var(--google-blue)"
# Journal
state-icon-color: "rgb(var(--color-theme))"

View File

@ -0,0 +1,133 @@
---
minimalist-mobile:
# Journal
state-icon-color: "rgb(var(--color-theme))"
border-radius: "20px"
ha-card-border-radius: "var(--border-radius)"
error-color: "var(--google-red)"
warning-color: "var(--google-yellow)"
success-color: "var(--google-green)"
info-color: "var(--google-blue)"
divider-color: "rgba(var(--color-theme),.12)"
accent-color: "var(--google-yellow)"
card-mod-theme: "minimalist-mobile"
card-mod-root: |
app-toolbar {
display: none;
}
card-mod-view-yaml: |
"*:first-child$": |
#columns .column > * {
padding-left: 5px;
padding-right: 5px;
padding-bottom: 5px;
}
modes:
light:
# text
primary-text-color: "#212121"
# main interface colors
primary-color: "#434343"
google-red: "#F54436"
google-green: "#01C852"
google-yellow: "#FF9101"
google-blue: "#3D5AFE"
google-violet: "#661FFF"
google-grey: "#BBBBBB"
color-red: "245, 68, 54"
color-green: "1, 200, 82"
color-yellow: "255, 145, 1"
color-blue: "61, 90, 254"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-theme: "51,51,51"
color-background-yellow: "250, 250, 250"
color-background-blue: "250, 250, 250"
color-background-green: "250, 250, 250"
color-background-red: "250, 250, 250"
color-background-pink: "250, 250, 250"
color-background-purple: "250, 250, 250"
color-yellow-text: "var(--primary-text-color)"
color-blue-text: "var(--primary-text-color)"
color-green-text: "var(--primary-text-color)"
color-red-text: "var(--primary-text-color)"
color-pink-text: "var(--primary-text-color)"
color-purple-text: "var(--primary-text-color)"
opacity-bg: "1"
# background and sidebar
card-background-color: "#FAFAFA"
primary-background-color: "#EFEFEF"
secondary-background-color: "#EFEFEF"
# header
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
# paper-tabs-selection-bar-color: "var(--primary-text-color)"
# slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# cards
box-shadow: "0px 2px 4px 0px rgba(0,0,0,0.16)"
ha-card-box-shadow: "var(--box-shadow)"
# sidebar
sidebar-selected-text-color: "var(--google-red)"
sidebar-selected-icon-color: "var(--google-red)"
sidebar-text-color: "#80868b"
# switch
switch-checked-color: "var(--google-blue)"
# media player
mini-media-player-accent-color: "var(--google-blue)"
dark:
# text
primary-text-color: "#DDDDDD"
# main interface colors
primary-color: "#89B3F8"
google-red: "#F18B82"
google-green: "#80C994"
google-yellow: "#FCD663"
google-blue: "#89B3F8"
google-violet: "#BB86FC"
google-grey: "#BBBBBB"
color-red: "241, 139, 130"
color-green: "128, 201, 148"
color-yellow: "252, 214, 99"
color-blue: "137, 179, 248"
color-theme: "221,221,221"
color-purple: "102, 31, 255"
color-grey: "187, 187, 187"
color-pink: "233, 30, 99"
color-background-yellow: "var(--color-yellow)"
color-background-blue: "var(--color-blue)"
color-background-green: "var(--color-green)"
color-background-red: "var(--color-red)"
color-background-pink: "var(--color-pink)"
color-background-purple: "var(--color-purple)"
color-yellow-text: "var(--color-yellow)"
color-blue-text: "var(--color-blue)"
color-green-text: "var(--color-green)"
color-red-text: "var(--color-red)"
color-pink-text: "var(--color-pink)"
color-purple-text: "var(--color-purple)"
opacity-bg: "0.1"
# floating button text color
mdc-theme-on-secondary: "var(--card-background-color)"
# background and sidebar
card-background-color: "#1D1D1D"
primary-background-color: "#121212"
secondary-background-color: "#121212"
# header
app-header-text-color: "var(--primary-text-color)"
app-header-background-color: "var(--primary-background-color)"
paper-tabs-selection-bar-color: "var(--primary-text-color)"
# Sidebar
sidebar-selected-text-color: "rgb(var(--color-blue))"
sidebar-selected-icon-color: "rgb(var(--color-blue))"
# Slider
slider-color: "rgb(var(--color-blue))"
slider-bar-color: "rgba(var(--color-blue),0.38)"
# card
box-shadow: "none"
# media player
mini-media-player-accent-color: "var(--google-blue)"
# Journal
state-icon-color: "rgb(var(--color-theme))"

170
ui-lovelace.yaml Normal file → Executable file
View File

@ -7,62 +7,144 @@ theme: "minimalist-desktop"
background: "var(--background-image)" background: "var(--background-image)"
swipe_nav:
wrap: true
animate: swipe
prevent_default: true
swipe_amount: 30
views: views:
- type: "custom:grid-layout" #----------------------------------------------------------------------------------#
# Dashboard
#----------------------------------------------------------------------------------#
- type: custom:vertical-layout
title: "Overview" title: "Overview"
path: 0 path: 0
layout:
grid-template-columns: "1fr 1fr 1fr"
grid-template-rows: "min-content"
grid-template-areas: |
"main popup"
mediaquery:
"(max-width: 1100px), (orientation: portrait)":
grid-template-columns: "100%"
grid-template-areas: "main"
cards: cards:
## Column 1
- type: "vertical-stack" - type: custom:vertical-layout
type: "vertical-stack"
cards: cards:
!include lovelace/welcome.yaml !include lovelace/overview/welcome.yaml
- type: custom:vertical-layout
- type: "vertical-stack" type: "vertical-stack"
cards: cards:
!include lovelace/lights.yaml !include lovelace/overview/lights.yaml
- type: custom:vertical-layout
- type: "vertical-stack" type: "vertical-stack"
cards: cards:
!include lovelace/climate.yaml !include lovelace/overview/feed.yaml
- type: custom:layout-break
- type: "vertical-stack" ## Column 2
- type: custom:vertical-layout
type: "vertical-stack"
cards: cards:
!include lovelace/batteries.yaml !include lovelace/overview/climate.yaml
- type: custom:vertical-layout
- type: "vertical-stack" type: "vertical-stack"
cards: cards:
!include lovelace/energy.yaml !include lovelace/overview/batteries.yaml
- type: custom:vertical-layout
- type: "vertical-stack" type: "vertical-stack"
cards: cards:
!include lovelace/nas.yaml !include lovelace/overview/nas.yaml
- type: custom:layout-break
- type: "vertical-stack" ## Column 3
- type: custom:vertical-layout
type: "vertical-stack"
cards: cards:
!include lovelace/popup.yaml !include lovelace/overview/energy.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/overview/multimedia.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/overview/vacuum.yaml
#----------------------------------------------------------------------------------#
- type: "custom:grid-layout" # Lights
title: "Testing" #----------------------------------------------------------------------------------#
- type: custom:vertical-layout
title: "Lights"
path: 1 path: 1
layout:
grid-template-columns: "1fr 1fr 1fr"
grid-template-rows: "min-content"
grid-template-areas: |
"main popup"
mediaquery:
"(max-width: 1100px), (orientation: portrait)":
grid-template-columns: "100%"
grid-template-areas: "main"
cards: cards:
## Column 1
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/lights/scenes.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/lights/adaptive.yaml
- type: custom:layout-break
## Column 2
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/lights/lightgroups.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/lights/lightbulbs.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/lights/lightstripes.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/lights/lightmenu.yaml
!include lovelace/testing.yaml #----------------------------------------------------------------------------------#
# pfSense
#----------------------------------------------------------------------------------#
- type: custom:vertical-layout
title: "pfSense"
path: 2
cards:
## Column 1
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/pfsense/notifications.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/pfsense/load.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/pfsense/gateways.yaml
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/pfsense/rules.yaml
- type: custom:layout-break
## Column 2
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/pfsense/traffic.yaml
#----------------------------------------------------------------------------------#
# Climate
#----------------------------------------------------------------------------------#
- type: custom:vertical-layout
title: "Climate"
path: 3
cards:
## Column 1
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/climate/setup.yaml
- type: custom:layout-break
## Column 2
- type: custom:vertical-layout
type: "vertical-stack"
cards:
!include lovelace/climate/recommendation.yaml

View File

@ -0,0 +1,12 @@
---
ulm_custom_actions:
variables:
ulm_card_tap_action: "toggle"
ulm_card_hold_action: "popup"
ulm_card_double_tap_action: "adaptive"
ulm_icon_tap_action: "toggle"
ulm_icon_hold_action: "popup"
ulm_icon_double_tap_action: "adaptive"
ulm_name_tap_action: "toggle"
ulm_name_hold_action: "popup"
ulm_name_double_tap_action: "adaptive"

View File

@ -0,0 +1,39 @@
---
custom_card_httpedo13_sun:
show_icon: false
show_name: false
show_label: false
variables:
darkMode: "[[[ return hass.themes.darkMode; ]]]"
language: "[[[ return hass.language; ]]]"
showAzimuth: false
showElevation: false
timeFormat: "24h"
title:
tap-action:
action: "none"
styles:
grid:
- grid-template-areas: "'item1'"
- grid-template-columns: "1fr"
- grid-template-rows: "min-content"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item1:
card:
type: "custom:sun-card"
darkMode: "[[[ return variables.darkMode; ]]]"
language: "[[[ return variables.language; ]]]"
showAzimuth: "[[[ return variables.showAzimuth; ]]]"
showElevation: "[[[ return variables.showElevation; ]]]"
timeFormat: "[[[ return variables.timeFormat; ]]]"
title: "[[[ return variables.title; ]]]"
card_mod:
style: |
ha-card.type-custom-sun-card {
border-radius: 14px;
box-shadow: none;
}

View File

@ -0,0 +1,172 @@
---
card_input_datetime:
show_name: false
show_icon: false
variables:
ulm_card_input_datetime_name: "n/a"
triggers_update: "all"
styles:
grid:
- grid-template-areas: "'item1' 'item2'"
- grid-template-columns: "1fr"
- grid-template-rows: "min-content min-content"
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item1:
card:
type: "custom:button-card"
template:
- "icon_info"
- "ulm_translation_engine"
- "input_datetime"
tap_action:
action: "more-info"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_card_input_datetime_name ]]]"
item2:
card:
type: "custom:button-card"
template: "list_3_items"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "input_datetime.set_datetime"
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
time: >
[[[
var timestamp = entity.attributes.timestamp
let unix_timestamp = timestamp - 4500;
// Create a new JavaScript Date object based on the timestamp
// multiplied by 1000 so that the argument is in milliseconds, not seconds.
var date = new Date(unix_timestamp * 1000);
// Hours part from the timestamp
var hours = date.getHours();
// Minutes part from the timestamp
var minutes = "0" + date.getMinutes();
// Seconds part from the timestamp
var seconds = "0" + date.getSeconds();
// Will display time in 10:30:23 format
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
return formattedTime;
]]]
icon: "mdi:arrow-down"
item2:
card:
type: "custom:button-card"
template: "widget_text"
entity: "[[[ return entity.entity_id ]]]"
tap_action:
action: "call-service"
service: "input_datetime.set_datetime"
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
time: >
[[[
var timestamp = entity.attributes.timestamp
let unix_timestamp = timestamp - 3540;
// Create a new JavaScript Date object based on the timestamp
// multiplied by 1000 so that the argument is in milliseconds, not seconds.
var date = new Date(unix_timestamp * 1000);
// Hours part from the timestamp
var hours = date.getHours();
// Minutes part from the timestamp
var minutes = "0" + date.getMinutes();
// Seconds part from the timestamp
var seconds = "0" + date.getSeconds();
// Will display time in 10:30:23 format
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
return formattedTime;
]]]
hold_action:
action: "call-service"
service: "input_datetime.set_datetime"
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
time: >
[[[
var timestamp = entity.attributes.timestamp
let unix_timestamp = timestamp - 3660;
// Create a new JavaScript Date object based on the timestamp
// multiplied by 1000 so that the argument is in milliseconds, not seconds.
var date = new Date(unix_timestamp * 1000);
// Hours part from the timestamp
var hours = date.getHours();
// Minutes part from the timestamp
var minutes = "0" + date.getMinutes();
// Seconds part from the timestamp
var seconds = "0" + date.getSeconds();
// Will display time in 10:30:23 format
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
return formattedTime;
]]]
item3:
card:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: "input_datetime.set_datetime"
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
time: >
[[[
var timestamp = entity.attributes.timestamp
let unix_timestamp = timestamp - 2700;
var date = new Date(unix_timestamp * 1000);
var hours = date.getHours();
var minutes = "0" + date.getMinutes();
var seconds = "0" + date.getSeconds();
var formattedTime = hours + ':' + minutes.substr(-2) + ':' + seconds.substr(-2);
return formattedTime;
]]]
icon: "mdi:arrow-up"
input_datetime:
tap_action:
action: "more-info"
show_last_changed: true
widget_text:
tap_action:
action: "toggle"
template:
- "ulm_translation_engine"
show_icon: false
show_label: true
show_name: false
label: "[[[ return variables.ulm_translation_state_unit ]]]"
styles:
grid:
- grid-template-areas: "'l'"
card:
- box-shadow: "none"
- padding: "0px"
- background-color: "rgba(var(--color-theme),0.05)"
- border-radius: "14px"
- place-self: "center"
- height: "42px"
state:
- color: "rgba(var(--color-theme),0.9)"
size: "20px"
color: "var(--google-grey)"

View File

@ -0,0 +1,107 @@
---
card_input_number:
variables:
ulm_card_input_number_name: "[[[ return entity.attributes.friendly_name ]]]"
triggers_update: "all"
show_icon: false
show_label: false
show_name: false
styles:
grid:
- grid-template-areas: "'item1' 'item2'"
- grid-template-columns: "1fr"
- grid-template-rows: "min-content min-content"
- row-gap: "12px"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item1:
card:
type: "custom:button-card"
template:
- "icon_info"
- "ulm_translation_engine"
- "input_number"
tap_action:
action: "more-info"
entity: "[[[ return entity.entity_id ]]]"
name: "[[[ return variables.ulm_card_input_number_name ]]]"
item2:
card:
type: "custom:button-card"
template: "list_3_items"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: |
[[[
if( entity.entity_id.startsWith("input_number.") )
return "input_number.decrement";
if( entity.entity_id.startsWith("counter.") )
return "counter.decrement";
return "";
]]]
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
icon: "mdi:arrow-down"
item2:
card:
type: "custom:button-card"
template: "widget_text"
entity: "[[[ return entity.entity_id ]]]"
tap_action:
action: "call-service"
service: "cover.stop_cover"
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
item3:
card:
type: "custom:button-card"
template: "widget_icon"
tap_action:
action: "call-service"
service: |
[[[
if( entity.entity_id.startsWith("input_number.") )
return "input_number.increment";
if( entity.entity_id.startsWith("counter.") )
return "counter.increment";
return "";
]]]
service_data:
entity_id: "[[[ return entity.entity_id ]]]"
icon: "mdi:arrow-up"
input_number:
tap_action:
action: "more-info"
show_last_changed: true
widget_text:
tap_action:
action: "toggle"
template:
- "ulm_translation_engine"
show_icon: false
show_label: true
show_name: false
label: "[[[ return variables.ulm_translation_state_unit ]]]"
styles:
grid:
- grid-template-areas: "'l'"
card:
- box-shadow: "none"
- padding: "0px"
- border-radius: "14px"
- place-self: "center"
- height: "42px"
state:
- color: "rgba(var(--color-theme),0.9)"
size: "20px"
color: "var(--google-grey)"

View File

@ -0,0 +1,243 @@
---
card_scenes:
show_icon: false
show_name: false
show_label: false
variables:
entity_1:
entity_id:
icon: "mdi:help-circle-outline"
icon_color: "gray"
name: "n/a"
bg_color: "gray"
entity_2:
entity_id:
icon: "mdi:help-circle-outline"
icon_color: "gray"
name: "n/a"
bg_color: "gray"
entity_3:
entity_id:
icon: "mdi:help-circle-outline"
icon_color: "gray"
name: "n/a"
bg_color: "gray"
entity_4:
entity_id:
icon: "mdi:help-circle-outline"
icon_color: "gray"
name: "n/a"
bg_color: "gray"
entity_5:
entity_id:
icon: "mdi:help-circle-outline"
icon_color: "gray"
name: "n/a"
bg_color: "gray"
styles:
grid:
- grid-template-areas: "'item1 item2 item3 item4 item5'"
- grid-template-columns: "1fr 1fr 1fr 1fr 1fr"
- grid-template-rows: "min-content"
- justify-items: "center"
- column-gap: "auto"
card:
- border-radius: "var(--border-radius)"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
custom_fields:
item1:
card:
type: "custom:button-card"
template: "card_scenes_pill"
entity: "[[[ return variables.entity_1.entity_id ]]]"
icon: "[[[ return variables.entity_1.icon ]]]"
name: "[[[ return variables.entity_1.name ]]]"
variables:
color_icon: "[[[ return variables.entity_1.icon_color ]]]"
color_bg: "[[[ return variables.entity_1.bg_color ]]]"
tap_action:
action: "call-service"
service: |
[[[
let domain = variables.entity_1.entity_id.substr(0, variables.entity_1.entity_id.indexOf("."));
if (domain == "automation") {
return "automation.trigger"
} else {
return "homeassistant.turn_on"
}
]]]
service_data:
entity_id: "[[[ return variables.entity_1.entity_id ]]]"
item2:
card:
type: "custom:button-card"
template: "card_scenes_pill"
entity: "[[[ return variables.entity_2.entity_id ]]]"
icon: "[[[ return variables.entity_2.icon ]]]"
name: "[[[ return variables.entity_2.name ]]]"
variables:
color_icon: "[[[ return variables.entity_2.icon_color ]]]"
color_bg: "[[[ return variables.entity_2.bg_color ]]]"
tap_action:
action: "call-service"
service: |
[[[
let domain = variables.entity_2.entity_id.substr(0, variables.entity_2.entity_id.indexOf("."));
if (domain == "automation") {
return "automation.trigger"
} else {
return "homeassistant.turn_on"
}
]]]
service_data:
entity_id: "[[[ return variables.entity_2.entity_id ]]]"
item3:
card:
type: "custom:button-card"
template: "card_scenes_pill"
entity: "[[[ return variables.entity_3.entity_id ]]]"
icon: "[[[ return variables.entity_3.icon ]]]"
name: "[[[ return variables.entity_3.name ]]]"
variables:
color_icon: "[[[ return variables.entity_3.icon_color ]]]"
color_bg: "[[[ return variables.entity_3.bg_color ]]]"
tap_action:
action: "call-service"
service: |
[[[
let domain = variables.entity_3.entity_id.substr(0, variables.entity_3.entity_id.indexOf("."));
if (domain == "automation") {
return "automation.trigger"
} else {
return "homeassistant.turn_on"
}
]]]
service_data:
entity_id: "[[[ return variables.entity_3.entity_id ]]]"
item4:
card:
type: "custom:button-card"
template: "card_scenes_pill"
entity: "[[[ return variables.entity_4.entity_id ]]]"
icon: "[[[ return variables.entity_4.icon ]]]"
name: "[[[ return variables.entity_4.name ]]]"
variables:
color_icon: "[[[ return variables.entity_4.icon_color ]]]"
color_bg: "[[[ return variables.entity_4.bg_color ]]]"
tap_action:
action: "call-service"
service: |
[[[
let domain = variables.entity_4.entity_id.substr(0, variables.entity_4.entity_id.indexOf("."));
if (domain == "automation") {
return "automation.trigger"
} else {
return "homeassistant.turn_on"
}
]]]
service_data:
entity_id: "[[[ return variables.entity_4.entity_id ]]]"
item5:
card:
type: "custom:button-card"
template: "card_scenes_pill"
entity: "[[[ return variables.entity_5.entity_id ]]]"
icon: "[[[ return variables.entity_5.icon ]]]"
name: "[[[ return variables.entity_5.name ]]]"
variables:
color_icon: "[[[ return variables.entity_5.icon_color ]]]"
color_bg: "[[[ return variables.entity_5.bg_color ]]]"
tap_action:
action: "call-service"
service: |
[[[
let domain = variables.entity_5.entity_id.substr(0, variables.entity_5.entity_id.indexOf("."));
if (domain == "automation") {
return "automation.trigger"
} else {
return "homeassistant.turn_on"
}
]]]
service_data:
entity_id: "[[[ return variables.entity_5.entity_id ]]]"
card_scenes_pill:
show_icon: true
show_label: false
show_name: true
variables:
color_icon: "gray"
color_bg: "gray"
styles:
grid:
- grid-template-areas: "'i' 'n'"
- grid-template-columns: "min-content"
- grid-template-rows: "1fr 1fr"
- row-gap: "12px"
- justify-items: "center"
- column-gap: "auto"
card:
- box-shadow: "none"
- padding: "5px"
- box-shadow: >
[[[
if (hass.themes.darkMode){
return "0px 2px 4px 0px rgba(0,0,0,0.80)";
} else {
return "var(--box-shadow)";
}
]]]
- border-radius: "50px"
- place-self: "center"
- width: "52px"
- height: "84px"
icon:
- color: >
[[[
var color = [variables.color_icon];
if (color == "gray"){
var color = "rgba(var(--color-theme),0.20)";
} else if(color == "yellow"){
var color = "rgba(var(--color-yellow),1)";
} else if(color == "blue"){
var color = "rgba(var(--color-blue),1)";
} else if(color == "purple"){
var color = "rgba(var(--color-purple),1)";
} else if(color == "green"){
var color = "rgba(var(--color-green),1)";
} else if(color == "red"){
var color = "rgba(var(--color-red),1)";
}
return color;
]]]
img_cell:
- background-color: >
[[[
var color = [variables.color_bg];
if (color == "gray"){
var color = "rgba(var(--color-theme),0.05)";
} else if(color == "yellow"){
var color = "rgba(var(--color-yellow),0.20)";
} else if(color == "blue"){
var color = "rgba(var(--color-blue),0.20)";
} else if(color == "purple"){
var color = "rgba(var(--color-purple),0.20)";
} else if(color == "green"){
var color = "rgba(var(--color-green),0.20)";
} else if(color == "red"){
var color = "rgba(var(--color-red),0.20)";
}
return color;
]]]
- border-radius: "50%"
- width: "42px"
- height: "42px"
name:
- font-weight: "bold"
- font-size: "9.5px"
- width: "33px"
- padding-bottom: "7px"
state:
- color: "rgba(var(--color-theme),0.9)"
color: "var(--google-grey)"