From 4f30e8f1a0d9f287c3994e8cb9b35598f51ff15d Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 12:36:09 +0000 Subject: [PATCH 01/57] revert 79919e5857d11923028f7a8c3c6d75a446701ca3 revert Testing Views --- lovelace/testing.yaml | 32 +------------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) diff --git a/lovelace/testing.yaml b/lovelace/testing.yaml index 4da536e..fb55988 100644 --- a/lovelace/testing.yaml +++ b/lovelace/testing.yaml @@ -3,34 +3,4 @@ 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 \ No newline at end of file + label: "grid-area: card1" \ No newline at end of file From 65ac701cfb59a0475e3f1360ba1404facfc938b0 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 12:36:28 +0000 Subject: [PATCH 02/57] revert 79919e5857d11923028f7a8c3c6d75a446701ca3 revert Testing Views From 1e15b2e1cd55ddc8f4d2690d8389291b21887c8e Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 12:38:01 +0000 Subject: [PATCH 03/57] revert 96237977e6a9ec391a019ed672938f729204f386 revert Testing Views --- lovelace/testing.yaml | 6 ------ ui-lovelace.yaml | 21 ++------------------- 2 files changed, 2 insertions(+), 25 deletions(-) delete mode 100644 lovelace/testing.yaml diff --git a/lovelace/testing.yaml b/lovelace/testing.yaml deleted file mode 100644 index fb55988..0000000 --- a/lovelace/testing.yaml +++ /dev/null @@ -1,6 +0,0 @@ -- view_layout: - grid-area: "card1" - type: "custom:button-card" - template: "card_title" - name: "Card 1 Testing" - label: "grid-area: card1" \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 18dc3df..d8b5e82 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -12,7 +12,7 @@ views: title: "Overview" path: 0 layout: - grid-template-columns: "1fr 1fr 1fr" + grid-template-columns: "1fr 1fr" grid-template-rows: "min-content" grid-template-areas: | "main popup" @@ -48,21 +48,4 @@ views: - type: "vertical-stack" cards: - !include lovelace/popup.yaml - - - - type: "custom:grid-layout" - title: "Testing" - 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: - - !include lovelace/testing.yaml \ No newline at end of file + !include lovelace/popup.yaml \ No newline at end of file From b309a912d40de174013de465ed3182fe23bd4a73 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 12:38:15 +0000 Subject: [PATCH 04/57] revert 693d350459836b555300cc02fb9f267efd304f89 revert Light Tests --- lovelace/lights.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lovelace/lights.yaml b/lovelace/lights.yaml index b7e4a6f..8d38431 100644 --- a/lovelace/lights.yaml +++ b/lovelace/lights.yaml @@ -48,5 +48,5 @@ 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_option: light 1 ulm_input_select: input_select.minimalist_ui_switch \ No newline at end of file From 71006ac63ef3963dc79a18e96b6f4e3c54c4bfb6 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 12:38:31 +0000 Subject: [PATCH 05/57] revert 6e358e26c29753db1970250e69c9c453b7cecea9 revert Light Tests --- lovelace/lights.yaml | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/lovelace/lights.yaml b/lovelace/lights.yaml index 8d38431..3a13f96 100644 --- a/lovelace/lights.yaml +++ b/lovelace/lights.yaml @@ -36,17 +36,4 @@ 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 1 - ulm_input_select: input_select.minimalist_ui_switch \ No newline at end of file + ulm_card_input_boolean_name: Circadian Lighting \ No newline at end of file From bdcbc7dd8d210ca2942b708f46b54df494d7795e Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 12:39:41 +0000 Subject: [PATCH 06/57] revert de21ffeae5bc70acf924157ad6a20001e76f706a revert Custom Grid Layout --- ui-lovelace.yaml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index d8b5e82..6ece867 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -8,18 +8,8 @@ background: "var(--background-image)" views: - - type: "custom:grid-layout" - title: "Overview" + - title: "Overview" path: 0 - layout: - grid-template-columns: "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: - type: "vertical-stack" From 23766d963eeb382b5ed7e48a30d84bbbccce6e99 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 15:15:27 +0200 Subject: [PATCH 07/57] Lovelace Updates --- lovelace/lights/lightbulbs.yaml | 39 ++++++++++++++++++++ lovelace/lights/lightgroups.yaml | 22 ++++++++++++ lovelace/lights/lightstripes.yaml | 19 ++++++++++ lovelace/lights/scenes.yaml | 49 ++++++++++++++++++++++++++ lovelace/{ => overview}/batteries.yaml | 12 ++----- lovelace/{ => overview}/climate.yaml | 24 ++++--------- lovelace/{ => overview}/energy.yaml | 16 +++------ lovelace/{ => overview}/lights.yaml | 16 +++------ lovelace/{ => overview}/nas.yaml | 12 ++----- lovelace/{ => overview}/welcome.yaml | 8 ++--- lovelace/popup.yaml | 16 --------- packages/homeassistant/lovelace.yaml | 8 +++-- ui-lovelace.yaml | 31 ++++++++++++---- 13 files changed, 180 insertions(+), 92 deletions(-) create mode 100644 lovelace/lights/lightbulbs.yaml create mode 100644 lovelace/lights/lightgroups.yaml create mode 100644 lovelace/lights/lightstripes.yaml create mode 100644 lovelace/lights/scenes.yaml rename lovelace/{ => overview}/batteries.yaml (75%) rename lovelace/{ => overview}/climate.yaml (70%) rename lovelace/{ => overview}/energy.yaml (72%) rename lovelace/{ => overview}/lights.yaml (73%) rename lovelace/{ => overview}/nas.yaml (68%) rename lovelace/{ => overview}/welcome.yaml (88%) delete mode 100644 lovelace/popup.yaml diff --git a/lovelace/lights/lightbulbs.yaml b/lovelace/lights/lightbulbs.yaml new file mode 100644 index 0000000..c5d66fb --- /dev/null +++ b/lovelace/lights/lightbulbs.yaml @@ -0,0 +1,39 @@ +- type: 'custom:button-card' + template: card_title + name: Light Bulbs + +- type: custom:button-card + template: card_light_colorpick + entity: light.ceiling1 + variables: + ulm_card_light_slider_horizontal_colors_name: Ceiling 1 + ulm_card_light_slider_horizontal_colors_transition: 1 + +- type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Ceiling 1 + ulm_card_light_enable_collapse: false + ulm_card_light_name: Ceiling 1 + entity: light.ceiling1 +- type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Ceiling 2 + ulm_card_light_enable_collapse: false + ulm_card_light_name: Ceiling 2 + entity: light.ceiling2 +- type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Ceiling 3 + ulm_card_light_enable_collapse: false + ulm_card_light_name: Ceiling 3 + entity: light.ceiling3 +- type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Bed + ulm_card_light_enable_collapse: false + ulm_card_light_name: Bed + entity: light.bed_ceiling \ No newline at end of file diff --git a/lovelace/lights/lightgroups.yaml b/lovelace/lights/lightgroups.yaml new file mode 100644 index 0000000..3272af5 --- /dev/null +++ b/lovelace/lights/lightgroups.yaml @@ -0,0 +1,22 @@ +- type: 'custom:button-card' + template: card_title + name: Light Groups + + +- 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 + +- 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 \ No newline at end of file diff --git a/lovelace/lights/lightstripes.yaml b/lovelace/lights/lightstripes.yaml new file mode 100644 index 0000000..7def890 --- /dev/null +++ b/lovelace/lights/lightstripes.yaml @@ -0,0 +1,19 @@ +- type: 'custom:button-card' + template: card_title + name: Light Stripes + +- type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Bed + ulm_card_light_enable_collapse: false + 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: false + ulm_card_light_name: Desk + entity: light.desk \ No newline at end of file diff --git a/lovelace/lights/scenes.yaml b/lovelace/lights/scenes.yaml new file mode 100644 index 0000000..820ba6a --- /dev/null +++ b/lovelace/lights/scenes.yaml @@ -0,0 +1,49 @@ +- type: 'custom:button-card' + template: card_title + name: Scenes + +- type: "custom:button-card" + template: + - card_scenes + variables: + entity_1: + entity_id: scene.light_flux + icon: "mdi:YOUR_ICON" + icon_color: "yellow" + name: Flux + bg_color: "yellow" + entity_2: + entity_id: scene.light_blue + icon: "mdi:YOUR_ICON" + icon_color: "blue" + name: Blue + bg_color: "blue" + entity_3: + entity_id: scene.light_night + icon: "mdi:YOUR_ICON" + icon_color: "purple" + name: Night + bg_color: "purple" + entity_4: + entity_id: scene.light_alloff + icon: "mdi:YOUR_ICON" + icon_color: "green" + name: All Off + bg_color: "green" + entity_5: + entity_id: scene.light_alloff + icon: "mdi:YOUR_ICON" + icon_color: "red" + name: All Off + bg_color: "red" + + +- type: 'custom:button-card' + template: card_title + name: Switches + +- type: 'custom:button-card' + template: card_input_boolean + entity: switch.circadian_lighting_circadian_lighting + variables: + ulm_card_input_boolean_name: Circadian Lighting \ No newline at end of file diff --git a/lovelace/batteries.yaml b/lovelace/overview/batteries.yaml similarity index 75% rename from lovelace/batteries.yaml rename to lovelace/overview/batteries.yaml index b7e9176..1b403d6 100644 --- a/lovelace/batteries.yaml +++ b/lovelace/overview/batteries.yaml @@ -1,15 +1,11 @@ -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_title name: Batteries - type: "horizontal-stack" cards: - - view_layout: - grid-area: "card1" - type: 'custom:button-card' + - type: 'custom:button-card' template: card_battery entity: sensor.iphone_battery_level variables: @@ -18,9 +14,7 @@ ulm_card_battery_battery_level_warning: 80 ulm_card_battery_name: iPhone - - view_layout: - grid-area: "card1" - type: 'custom:button-card' + - type: 'custom:button-card' template: card_battery entity: sensor.ipad_battery_level variables: diff --git a/lovelace/climate.yaml b/lovelace/overview/climate.yaml similarity index 70% rename from lovelace/climate.yaml rename to lovelace/overview/climate.yaml index 9e71630..fc87aca 100644 --- a/lovelace/climate.yaml +++ b/lovelace/overview/climate.yaml @@ -1,19 +1,13 @@ -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_title name: Climate -- view_layout: - grid-area: "card1" - type: custom:button-card +- type: custom:button-card template: custom_card_httpedo13_sun -- view_layout: - grid-area: "card1" - type: "custom:button-card" +- type: "custom:button-card" template: card_weather entity: weather.dark_sky variables: @@ -25,9 +19,7 @@ fade: true -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_graph entity: sensor.temperature_kai_temperature variables: @@ -42,17 +34,13 @@ - type: "horizontal-stack" cards: - - view_layout: - grid-area: "card1" - type: 'custom:button-card' + - 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' + - type: 'custom:button-card' template: card_generic entity: sensor.temperature_kai_pressure variables: diff --git a/lovelace/energy.yaml b/lovelace/overview/energy.yaml similarity index 72% rename from lovelace/energy.yaml rename to lovelace/overview/energy.yaml index 4a296f6..8629107 100644 --- a/lovelace/energy.yaml +++ b/lovelace/overview/energy.yaml @@ -1,13 +1,9 @@ -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_title name: Energy -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_graph entity: sensor.schreibtisch_current_consumption variables: @@ -20,18 +16,14 @@ - type: "horizontal-stack" cards: - - view_layout: - grid-area: "card1" - type: 'custom:button-card' + - 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' + - type: 'custom:button-card' template: card_generic entity: sensor.schreibtisch_total_consumption variables: diff --git a/lovelace/lights.yaml b/lovelace/overview/lights.yaml similarity index 73% rename from lovelace/lights.yaml rename to lovelace/overview/lights.yaml index 3a13f96..3a2d196 100644 --- a/lovelace/lights.yaml +++ b/lovelace/overview/lights.yaml @@ -1,15 +1,11 @@ -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_title name: Lights - type: "horizontal-stack" cards: - - view_layout: - grid-area: "card1" - type: 'custom:button-card' + - type: 'custom:button-card' template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Indirect @@ -19,9 +15,7 @@ ulm_input_select: input_select.minimalist_ui_switch entity: light.all_indirect - - view_layout: - grid-area: "card1" - type: 'custom:button-card' + - type: 'custom:button-card' template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Direct @@ -30,9 +24,7 @@ entity: light.all_direct -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_input_boolean entity: switch.circadian_lighting_circadian_lighting variables: diff --git a/lovelace/nas.yaml b/lovelace/overview/nas.yaml similarity index 68% rename from lovelace/nas.yaml rename to lovelace/overview/nas.yaml index 5b35e6c..87e3295 100644 --- a/lovelace/nas.yaml +++ b/lovelace/overview/nas.yaml @@ -1,15 +1,11 @@ -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_title name: NAS - type: "horizontal-stack" cards: - - view_layout: - grid-area: "card1" - type: 'custom:button-card' + - type: 'custom:button-card' template: card_script variables: ulm_card_script_title: WOL @@ -20,9 +16,7 @@ service_data: entity_id: switch.server - - view_layout: - grid-area: "card1" - type: 'custom:button-card' + - type: 'custom:button-card' template: card_binary_sensor variables: ulm_card_binary_sensor_alert: true diff --git a/lovelace/welcome.yaml b/lovelace/overview/welcome.yaml similarity index 88% rename from lovelace/welcome.yaml rename to lovelace/overview/welcome.yaml index 3d7d21d..84b71a5 100644 --- a/lovelace/welcome.yaml +++ b/lovelace/overview/welcome.yaml @@ -1,11 +1,7 @@ -- view_layout: - grid-area: "card1" - type: 'custom:button-card' +- type: 'custom:button-card' template: card_title name: Home Assistant -- view_layout: - grid-area: "card1" - type: "custom:button-card" +- type: "custom:button-card" template: "card_welcome_scenes" triggers_update: input_boolean.welcome_collapse entity: input_boolean.welcome_collapse diff --git a/lovelace/popup.yaml b/lovelace/popup.yaml deleted file mode 100644 index fb6bec9..0000000 --- a/lovelace/popup.yaml +++ /dev/null @@ -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 \ No newline at end of file diff --git a/packages/homeassistant/lovelace.yaml b/packages/homeassistant/lovelace.yaml index 35fcfac..e16496c 100644 --- a/packages/homeassistant/lovelace.yaml +++ b/packages/homeassistant/lovelace.yaml @@ -20,8 +20,10 @@ lovelace: 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 + #- url: /hacsfiles/lovelace-layout-card/layout-card.js + # type: module + #- url: /hacsfiles/lovelace-state-switch/state-switch.js + # type: module + - url: /hacsfiles/rgb-light-card/card.js type: module \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 6ece867..d4656e6 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -14,28 +14,45 @@ views: - type: "vertical-stack" cards: - !include lovelace/welcome.yaml + !include lovelace/overview/welcome.yaml - type: "vertical-stack" cards: - !include lovelace/lights.yaml + !include lovelace/overview/lights.yaml - type: "vertical-stack" cards: - !include lovelace/climate.yaml + !include lovelace/overview/climate.yaml - type: "vertical-stack" cards: - !include lovelace/batteries.yaml + !include lovelace/overview/batteries.yaml - type: "vertical-stack" cards: - !include lovelace/energy.yaml + !include lovelace/overview/energy.yaml - type: "vertical-stack" cards: - !include lovelace/nas.yaml + !include lovelace/overview/nas.yaml + + + - title: "Lights" + path: 1 + cards: - type: "vertical-stack" cards: - !include lovelace/popup.yaml \ No newline at end of file + !include lovelace/lights/scenes.yaml + + - type: "vertical-stack" + cards: + !include lovelace/lights//lightgroups.yaml + + - type: "vertical-stack" + cards: + !include lovelace/lights/lightbulbs.yaml + + - type: "vertical-stack" + cards: + !include lovelace/lights/lightstripes.yaml \ No newline at end of file From fb09ce6188a3152e1e94d9a772404a21f447be63 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 15:18:05 +0200 Subject: [PATCH 08/57] UI Minimalist Custom Cards --- .../custom_cards/card_light_colorpick.yaml | 118 +++++++++ .../custom_cards/custom_card_httpedo13.yaml | 39 +++ .../custom_cards/custom_card_scenes.yaml | 243 ++++++++++++++++++ 3 files changed, 400 insertions(+) create mode 100644 ui_lovelace_minimalist/custom_cards/card_light_colorpick.yaml create mode 100644 ui_lovelace_minimalist/custom_cards/custom_card_httpedo13.yaml create mode 100644 ui_lovelace_minimalist/custom_cards/custom_card_scenes.yaml diff --git a/ui_lovelace_minimalist/custom_cards/card_light_colorpick.yaml b/ui_lovelace_minimalist/custom_cards/card_light_colorpick.yaml new file mode 100644 index 0000000..cfed384 --- /dev/null +++ b/ui_lovelace_minimalist/custom_cards/card_light_colorpick.yaml @@ -0,0 +1,118 @@ +--- +card_light_colorpick: + template: + - "ulm_translation_engine" + variables: + ulm_card_light_colorpick_name: "[[[ return entity.attributes.friendly_name ]]]" + ulm_card_light_colorpick_transition: 1 + show_icon: false + show_name: false + show_label: false + state: + - operator: "template" + value: "[[[ return entity.state == 'on' ]]]" + styles: + card: + - background-color: "rgba(var(--color-background-yellow),var(--opacity-bg))" + grid: + - row-gap: "12px" + styles: + grid: + - grid-template-areas: | + "item1 item2" + "item3 item3" + - grid-template-columns: "1fr 1fr" + - grid-template-rows: "min-content min-content" + card: + - border-radius: "var(--border-radius)" + - box-shadow: "var(--box-shadow)" + - padding: "12px" + custom_fields: + item1: + card: + type: "custom:button-card" + template: + - "icon_info" + - "yellow_slider" + entity: "[[[ return entity.entity_id ]]]" + label: >- + [[[ + var label = variables.ulm_translation_state + if (entity.attributes.brightness != null && entity.state == 'on'){ + var bri = Math.round(entity.attributes.brightness / 2.55); + var label = (bri ? bri : "0") + "%"; + } + return label; + ]]] + name: "[[[ return variables.ulm_card_light_slider_horizontal_name ]]]" + styles: + card: + - box-shadow: "none" + - border-radius: "var(--border-radius) var(--border-radius) var(--border-radius) var(--border-radius)" + - padding: "0px" + item2: + card: + type: "custom:my-slider" + entity: "[[[ return entity.entity_id ]]]" + radius: "14px" + height: "42px" + mainSliderColor: "rgba(var(--color-yellow),1)" + secondarySliderColor: "rgba(var(--color-yellow),0.2)" + mainSliderColorOff: "rgba(var(--color-theme),0.05)" + secondarySliderColorOff: "rgba(var(--color-theme),0.05)" + thumbHorizontalPadding: "0px" + thumbVerticalPadding: "0px" + thumbWidth: "0px" + card_mod: + style: | + ha-card { + border-radius: 14px; + box-shadow: none; + } + item3: + card: + type: "conditional" + conditions: + - entity: "[[[ return entity.entity_id ]]]" + state: "on" + card: + type: "custom:rgb-light-card" + entity: "[[[ return entity.entity_id ]]]" + justify: "around" + colors: + - rgb_color: + - 255 + - 255 + - 255 + icon_color: "rgba(255, 255, 255, 0.8)" + transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" + - rgb_color: + - 245 + - 68 + - 54 + icon_color: "rgba(245, 68, 54, 0.8)" + transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" + - rgb_color: + - 51 + - 102 + - 204 + icon_color: "rgba(51, 102, 204, 0.8)" + transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" + - rgb_color: + - 51 + - 204 + - 51 + icon_color: "rgba(51, 204, 51, 0.8)" + transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" + - rgb_color: + - 255 + - 0 + - 255 + icon_color: "rgba(255, 0, 255, 0.8)" + transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" + - rgb_color: + - 0 + - 255 + - 255 + icon_color: "rgba(0, 255, 255, 0.8)" + transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" diff --git a/ui_lovelace_minimalist/custom_cards/custom_card_httpedo13.yaml b/ui_lovelace_minimalist/custom_cards/custom_card_httpedo13.yaml new file mode 100644 index 0000000..3aa77f4 --- /dev/null +++ b/ui_lovelace_minimalist/custom_cards/custom_card_httpedo13.yaml @@ -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; + } diff --git a/ui_lovelace_minimalist/custom_cards/custom_card_scenes.yaml b/ui_lovelace_minimalist/custom_cards/custom_card_scenes.yaml new file mode 100644 index 0000000..d316b54 --- /dev/null +++ b/ui_lovelace_minimalist/custom_cards/custom_card_scenes.yaml @@ -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)" From b37d2cd9c5aa1cefc65938ffe364517fe7528d58 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 15:26:24 +0200 Subject: [PATCH 09/57] Lovelace Updates --- lovelace/lights/lightbulbs.yaml | 7 -- packages/homeassistant/lovelace.yaml | 5 +- .../custom_cards/card_light_colorpick.yaml | 118 ------------------ 3 files changed, 1 insertion(+), 129 deletions(-) delete mode 100644 ui_lovelace_minimalist/custom_cards/card_light_colorpick.yaml diff --git a/lovelace/lights/lightbulbs.yaml b/lovelace/lights/lightbulbs.yaml index c5d66fb..1feefb7 100644 --- a/lovelace/lights/lightbulbs.yaml +++ b/lovelace/lights/lightbulbs.yaml @@ -2,13 +2,6 @@ template: card_title name: Light Bulbs -- type: custom:button-card - template: card_light_colorpick - entity: light.ceiling1 - variables: - ulm_card_light_slider_horizontal_colors_name: Ceiling 1 - ulm_card_light_slider_horizontal_colors_transition: 1 - - type: 'custom:button-card' template: card_light_slider_collapse variables: diff --git a/packages/homeassistant/lovelace.yaml b/packages/homeassistant/lovelace.yaml index e16496c..170c54b 100644 --- a/packages/homeassistant/lovelace.yaml +++ b/packages/homeassistant/lovelace.yaml @@ -23,7 +23,4 @@ lovelace: #- url: /hacsfiles/lovelace-layout-card/layout-card.js # type: module #- url: /hacsfiles/lovelace-state-switch/state-switch.js - # type: module - - url: /hacsfiles/rgb-light-card/card.js - type: module - \ No newline at end of file + # type: module \ No newline at end of file diff --git a/ui_lovelace_minimalist/custom_cards/card_light_colorpick.yaml b/ui_lovelace_minimalist/custom_cards/card_light_colorpick.yaml deleted file mode 100644 index cfed384..0000000 --- a/ui_lovelace_minimalist/custom_cards/card_light_colorpick.yaml +++ /dev/null @@ -1,118 +0,0 @@ ---- -card_light_colorpick: - template: - - "ulm_translation_engine" - variables: - ulm_card_light_colorpick_name: "[[[ return entity.attributes.friendly_name ]]]" - ulm_card_light_colorpick_transition: 1 - show_icon: false - show_name: false - show_label: false - state: - - operator: "template" - value: "[[[ return entity.state == 'on' ]]]" - styles: - card: - - background-color: "rgba(var(--color-background-yellow),var(--opacity-bg))" - grid: - - row-gap: "12px" - styles: - grid: - - grid-template-areas: | - "item1 item2" - "item3 item3" - - grid-template-columns: "1fr 1fr" - - grid-template-rows: "min-content min-content" - card: - - border-radius: "var(--border-radius)" - - box-shadow: "var(--box-shadow)" - - padding: "12px" - custom_fields: - item1: - card: - type: "custom:button-card" - template: - - "icon_info" - - "yellow_slider" - entity: "[[[ return entity.entity_id ]]]" - label: >- - [[[ - var label = variables.ulm_translation_state - if (entity.attributes.brightness != null && entity.state == 'on'){ - var bri = Math.round(entity.attributes.brightness / 2.55); - var label = (bri ? bri : "0") + "%"; - } - return label; - ]]] - name: "[[[ return variables.ulm_card_light_slider_horizontal_name ]]]" - styles: - card: - - box-shadow: "none" - - border-radius: "var(--border-radius) var(--border-radius) var(--border-radius) var(--border-radius)" - - padding: "0px" - item2: - card: - type: "custom:my-slider" - entity: "[[[ return entity.entity_id ]]]" - radius: "14px" - height: "42px" - mainSliderColor: "rgba(var(--color-yellow),1)" - secondarySliderColor: "rgba(var(--color-yellow),0.2)" - mainSliderColorOff: "rgba(var(--color-theme),0.05)" - secondarySliderColorOff: "rgba(var(--color-theme),0.05)" - thumbHorizontalPadding: "0px" - thumbVerticalPadding: "0px" - thumbWidth: "0px" - card_mod: - style: | - ha-card { - border-radius: 14px; - box-shadow: none; - } - item3: - card: - type: "conditional" - conditions: - - entity: "[[[ return entity.entity_id ]]]" - state: "on" - card: - type: "custom:rgb-light-card" - entity: "[[[ return entity.entity_id ]]]" - justify: "around" - colors: - - rgb_color: - - 255 - - 255 - - 255 - icon_color: "rgba(255, 255, 255, 0.8)" - transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" - - rgb_color: - - 245 - - 68 - - 54 - icon_color: "rgba(245, 68, 54, 0.8)" - transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" - - rgb_color: - - 51 - - 102 - - 204 - icon_color: "rgba(51, 102, 204, 0.8)" - transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" - - rgb_color: - - 51 - - 204 - - 51 - icon_color: "rgba(51, 204, 51, 0.8)" - transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" - - rgb_color: - - 255 - - 0 - - 255 - icon_color: "rgba(255, 0, 255, 0.8)" - transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" - - rgb_color: - - 0 - - 255 - - 255 - icon_color: "rgba(0, 255, 255, 0.8)" - transition: "[[[ return variables.ulm_card_light_colorpick_transition; ]]]" From dda10f05a58b2f170b7f796edf203afe8f3a8c17 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 13:37:32 +0000 Subject: [PATCH 10/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5aaac75..ebcc07a 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,13 @@ - card-mod - Sun Card - mini-graph-card -- My Cards Bundle (https://github.com/AnthonMS/my-cards) \ No newline at end of file +- My Cards Bundle (https://github.com/AnthonMS/my-cards) + + +## Todo + +- Climate control +- Temperature warnings/recommendations (inside vs outside) +- pfSense control + dashboard +- Light automations +- Push notifications \ No newline at end of file From 3d77f07f68f92bd437a4e6f490d2dfaff99f1fa0 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 16:41:49 +0200 Subject: [PATCH 11/57] Grouping --- lovelace/lights/lightbulbs.yaml | 60 ++++++++++++++++--------------- lovelace/lights/lightgroups.yaml | 35 +++++++++--------- lovelace/lights/lightstripes.yaml | 30 ++++++++-------- 3 files changed, 66 insertions(+), 59 deletions(-) diff --git a/lovelace/lights/lightbulbs.yaml b/lovelace/lights/lightbulbs.yaml index 1feefb7..40cd401 100644 --- a/lovelace/lights/lightbulbs.yaml +++ b/lovelace/lights/lightbulbs.yaml @@ -2,31 +2,35 @@ template: card_title name: Light Bulbs -- type: 'custom:button-card' - template: card_light_slider_collapse - variables: - ulm_card_light_slider_collapse_name: Ceiling 1 - ulm_card_light_enable_collapse: false - ulm_card_light_name: Ceiling 1 - entity: light.ceiling1 -- type: 'custom:button-card' - template: card_light_slider_collapse - variables: - ulm_card_light_slider_collapse_name: Ceiling 2 - ulm_card_light_enable_collapse: false - ulm_card_light_name: Ceiling 2 - entity: light.ceiling2 -- type: 'custom:button-card' - template: card_light_slider_collapse - variables: - ulm_card_light_slider_collapse_name: Ceiling 3 - ulm_card_light_enable_collapse: false - ulm_card_light_name: Ceiling 3 - entity: light.ceiling3 -- type: 'custom:button-card' - template: card_light_slider_collapse - variables: - ulm_card_light_slider_collapse_name: Bed - ulm_card_light_enable_collapse: false - ulm_card_light_name: Bed - entity: light.bed_ceiling \ No newline at end of file +- type: "horizontal-stack" + cards: + - type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Ceiling 1 + ulm_card_light_enable_collapse: false + ulm_card_light_name: Ceiling 1 + entity: light.ceiling1 + - type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Ceiling 2 + ulm_card_light_enable_collapse: false + ulm_card_light_name: Ceiling 2 + entity: light.ceiling2 +- type: "horizontal-stack" + cards: + - type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Ceiling 3 + ulm_card_light_enable_collapse: false + ulm_card_light_name: Ceiling 3 + entity: light.ceiling3 + - type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Bed + ulm_card_light_enable_collapse: false + ulm_card_light_name: Bed + entity: light.bed_ceiling \ No newline at end of file diff --git a/lovelace/lights/lightgroups.yaml b/lovelace/lights/lightgroups.yaml index 3272af5..707f8f7 100644 --- a/lovelace/lights/lightgroups.yaml +++ b/lovelace/lights/lightgroups.yaml @@ -2,21 +2,22 @@ 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: false + 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: 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 - -- 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 \ No newline at end of file + - 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 \ No newline at end of file diff --git a/lovelace/lights/lightstripes.yaml b/lovelace/lights/lightstripes.yaml index 7def890..71ec789 100644 --- a/lovelace/lights/lightstripes.yaml +++ b/lovelace/lights/lightstripes.yaml @@ -2,18 +2,20 @@ template: card_title name: Light Stripes -- type: 'custom:button-card' - template: card_light_slider_collapse - variables: - ulm_card_light_slider_collapse_name: Bed - ulm_card_light_enable_collapse: false - ulm_card_light_name: Bed - entity: light.bed +- 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: false + 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: false - ulm_card_light_name: Desk - entity: light.desk \ No newline at end of file + - type: 'custom:button-card' + template: card_light_slider_collapse + variables: + ulm_card_light_slider_collapse_name: Desk + ulm_card_light_enable_collapse: false + ulm_card_light_name: Desk + entity: light.desk \ No newline at end of file From 11f6f5eed3422cbe5f72df3243bf3dec4331b687 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 17:46:12 +0200 Subject: [PATCH 12/57] pfsense --- lovelace/pfsense/gateways.yaml | 87 +++++++++++++++++++++++++++++ lovelace/pfsense/load.yaml | 36 ++++++++++++ lovelace/pfsense/notifications.yaml | 11 ++++ lovelace/pfsense/rules.yaml | 19 +++++++ lovelace/pfsense/traffic.yaml | 64 +++++++++++++++++++++ ui-lovelace.yaml | 34 +++++++---- 6 files changed, 239 insertions(+), 12 deletions(-) create mode 100644 lovelace/pfsense/gateways.yaml create mode 100644 lovelace/pfsense/load.yaml create mode 100644 lovelace/pfsense/notifications.yaml create mode 100644 lovelace/pfsense/rules.yaml create mode 100644 lovelace/pfsense/traffic.yaml diff --git a/lovelace/pfsense/gateways.yaml b/lovelace/pfsense/gateways.yaml new file mode 100644 index 0000000..dc71079 --- /dev/null +++ b/lovelace/pfsense/gateways.yaml @@ -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 \ No newline at end of file diff --git a/lovelace/pfsense/load.yaml b/lovelace/pfsense/load.yaml new file mode 100644 index 0000000..84da5c9 --- /dev/null +++ b/lovelace/pfsense/load.yaml @@ -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 %" \ No newline at end of file diff --git a/lovelace/pfsense/notifications.yaml b/lovelace/pfsense/notifications.yaml new file mode 100644 index 0000000..6e9a3f8 --- /dev/null +++ b/lovelace/pfsense/notifications.yaml @@ -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 \ No newline at end of file diff --git a/lovelace/pfsense/rules.yaml b/lovelace/pfsense/rules.yaml new file mode 100644 index 0000000..cdb3401 --- /dev/null +++ b/lovelace/pfsense/rules.yaml @@ -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" \ No newline at end of file diff --git a/lovelace/pfsense/traffic.yaml b/lovelace/pfsense/traffic.yaml new file mode 100644 index 0000000..d0c2a1e --- /dev/null +++ b/lovelace/pfsense/traffic.yaml @@ -0,0 +1,64 @@ +- type: 'custom:button-card' + template: card_title + name: Traffic + + +- type: 'custom:button-card' + template: card_graph + entity: sensor.pfsense_interface_wan_inbytes_kilobytes_per_second + variables: + ulm_card_graph_color: "var(--google-blue)" + ulm_card_graph_name: WAN Incoming + ulm_card_graph_entity: sensor.pfsense_interface_wan_inbytes_kilobytes_per_second + ulm_card_graph_color2: "var(--google-green)" + ulm_card_graph_entity2: sensor.pfsense_interface_wan_outbytes_kilobytes_per_second + ulm_card_graph_type: fill + ulm_card_graph_hours: 1 +- type: "horizontal-stack" + cards: + - type: 'custom:button-card' + template: card_graph + entity: sensor.pfsense_interface_mullvad1_inbytes_kilobytes_per_second + variables: + ulm_card_graph_color: "var(--google-blue)" + ulm_card_graph_name: Mullvad1 Incoming + ulm_card_graph_entity: sensor.pfsense_interface_mullvad1_inbytes_kilobytes_per_second + ulm_card_graph_color2: "var(--google-green)" + ulm_card_graph_entity2: sensor.pfsense_interface_mullvad1_outbytes_kilobytes_per_second + ulm_card_graph_type: fill + ulm_card_graph_hours: 1 + - type: 'custom:button-card' + template: card_graph + entity: sensor.pfsense_interface_mullvad2_inbytes_kilobytes_per_second + variables: + ulm_card_graph_color: "var(--google-blue)" + ulm_card_graph_name: Mullvad2 Incoming + ulm_card_graph_entity: sensor.pfsense_interface_mullvad2_inbytes_kilobytes_per_second + ulm_card_graph_color2: "var(--google-green)" + ulm_card_graph_entity2: sensor.pfsense_interface_mullvad2_outbytes_kilobytes_per_second + ulm_card_graph_type: fill + ulm_card_graph_hours: 1 +- type: "horizontal-stack" + cards: + - type: 'custom:button-card' + template: card_graph + entity: sensor.pfsense_interface_lan_inbytes_kilobytes_per_second + variables: + ulm_card_graph_color: "var(--google-blue)" + ulm_card_graph_name: LAN Incoming + ulm_card_graph_entity: sensor.pfsense_interface_lan_inbytes_kilobytes_per_second + ulm_card_graph_color2: "var(--google-green)" + ulm_card_graph_entity2: sensor.pfsense_interface_lan_outbytes_kilobytes_per_second + ulm_card_graph_type: fill + ulm_card_graph_hours: 1 + - type: 'custom:button-card' + template: card_graph + entity: sensor.pfsense_interface_backend_inbytes_kilobytes_per_second + variables: + ulm_card_graph_color: "var(--google-blue)" + ulm_card_graph_name: Backend Incoming + ulm_card_graph_entity: sensor.pfsense_interface_backend_inbytes_kilobytes_per_second + ulm_card_graph_color2: "var(--google-green)" + ulm_card_graph_entity2: sensor.pfsense_interface_backend_outbytes_kilobytes_per_second + ulm_card_graph_type: fill + ulm_card_graph_hours: 1 \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index d4656e6..7673936 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -11,27 +11,21 @@ views: - title: "Overview" path: 0 cards: - - type: "vertical-stack" cards: !include lovelace/overview/welcome.yaml - - type: "vertical-stack" cards: !include lovelace/overview/lights.yaml - - type: "vertical-stack" cards: !include lovelace/overview/climate.yaml - - type: "vertical-stack" cards: !include lovelace/overview/batteries.yaml - - type: "vertical-stack" cards: !include lovelace/overview/energy.yaml - - type: "vertical-stack" cards: !include lovelace/overview/nas.yaml @@ -40,19 +34,35 @@ views: - title: "Lights" path: 1 cards: - - type: "vertical-stack" cards: !include lovelace/lights/scenes.yaml - - type: "vertical-stack" cards: - !include lovelace/lights//lightgroups.yaml - + !include lovelace/lights/lightgroups.yaml - type: "vertical-stack" cards: !include lovelace/lights/lightbulbs.yaml - - type: "vertical-stack" cards: - !include lovelace/lights/lightstripes.yaml \ No newline at end of file + !include lovelace/lights/lightstripes.yaml + + + - title: "pfSense" + path: 2 + cards: + - type: "vertical-stack" + cards: + !include lovelace/pfsense/notifications.yaml + - type: "vertical-stack" + cards: + !include lovelace/pfsense/load.yaml + - type: "vertical-stack" + cards: + !include lovelace/pfsense/gateways.yaml + - type: "vertical-stack" + cards: + !include lovelace/pfsense/traffic.yaml + - type: "vertical-stack" + cards: + !include lovelace/pfsense/rules.yaml \ No newline at end of file From 3eb29fd6650de273bd3650ed91ce0a5aa2d7ba00 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 15:53:11 +0000 Subject: [PATCH 13/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index ebcc07a..f21b6d8 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,5 @@ - Climate control - Temperature warnings/recommendations (inside vs outside) -- pfSense control + dashboard - Light automations - Push notifications \ No newline at end of file From e43efbab85e9fc132dc8cb8b0175eb4d0d9af560 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 17:57:34 +0200 Subject: [PATCH 14/57] Climate --- packages/climate/eq3.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 packages/climate/eq3.yaml diff --git a/packages/climate/eq3.yaml b/packages/climate/eq3.yaml new file mode 100644 index 0000000..b02029c --- /dev/null +++ b/packages/climate/eq3.yaml @@ -0,0 +1,8 @@ +## -------------------------------------------------------------------------------------------------## +## EQ3-Heizthermostat +## -------------------------------------------------------------------------------------------------## +climate: + - platform: eq3btsmart + devices: + kai: + mac: '00:1A:22:0E:FB:32' \ No newline at end of file From a3f11fb0288f5b64e36483db2188a70519edb067 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 17:58:01 +0200 Subject: [PATCH 15/57] Climate --- packages/climate/climate_automation.yaml | 99 ++++ packages/climate/climate_inputs.yaml | 73 +++ packages/climate/climate_scripts.yaml | 256 ++++++++++ packages/climate/climate_sensors.yaml | 136 ++++++ packages/climate/eq3.yaml.disabled | 587 ----------------------- packages/time_date.yaml | 7 + 6 files changed, 571 insertions(+), 587 deletions(-) create mode 100644 packages/climate/climate_automation.yaml create mode 100644 packages/climate/climate_inputs.yaml create mode 100644 packages/climate/climate_scripts.yaml create mode 100644 packages/climate/climate_sensors.yaml delete mode 100644 packages/climate/eq3.yaml.disabled create mode 100644 packages/time_date.yaml diff --git a/packages/climate/climate_automation.yaml b/packages/climate/climate_automation.yaml new file mode 100644 index 0000000..e4f43fa --- /dev/null +++ b/packages/climate/climate_automation.yaml @@ -0,0 +1,99 @@ +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 \ No newline at end of file diff --git a/packages/climate/climate_inputs.yaml b/packages/climate/climate_inputs.yaml new file mode 100644 index 0000000..b0d7703 --- /dev/null +++ b/packages/climate/climate_inputs.yaml @@ -0,0 +1,73 @@ +## -------------------------------------------------------------------------------------------------## +## 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 \ No newline at end of file diff --git a/packages/climate/climate_scripts.yaml b/packages/climate/climate_scripts.yaml new file mode 100644 index 0000000..3902a3b --- /dev/null +++ b/packages/climate/climate_scripts.yaml @@ -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 %} \ No newline at end of file diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml new file mode 100644 index 0000000..bebc158 --- /dev/null +++ b/packages/climate/climate_sensors.yaml @@ -0,0 +1,136 @@ +## -------------------------------------------------------------------------------------------------## +## 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' \ No newline at end of file diff --git a/packages/climate/eq3.yaml.disabled b/packages/climate/eq3.yaml.disabled deleted file mode 100644 index f685acf..0000000 --- a/packages/climate/eq3.yaml.disabled +++ /dev/null @@ -1,587 +0,0 @@ -## -------------------------------------------------------------------------------------------------## -## EQ3-Heizthermostat -## -------------------------------------------------------------------------------------------------## -climate: - - platform: eq3btsmart - devices: - kai: - 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 \ No newline at end of file diff --git a/packages/time_date.yaml b/packages/time_date.yaml new file mode 100644 index 0000000..cf202bf --- /dev/null +++ b/packages/time_date.yaml @@ -0,0 +1,7 @@ + ## -----------------------------------------------------------------------------------------------## + ## Time / Date + ## -----------------------------------------------------------------------------------------------## + - platform: time_date + display_options: + - 'time' + - 'date' \ No newline at end of file From af43e54c29ad2eb919db3f339eb294bc6c431e41 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 18:03:16 +0200 Subject: [PATCH 16/57] Fix: Time and Date --- packages/time_date.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/time_date.yaml b/packages/time_date.yaml index cf202bf..c1a0f76 100644 --- a/packages/time_date.yaml +++ b/packages/time_date.yaml @@ -1,7 +1,7 @@ - ## -----------------------------------------------------------------------------------------------## - ## Time / Date - ## -----------------------------------------------------------------------------------------------## - - platform: time_date - display_options: - - 'time' - - 'date' \ No newline at end of file +## -----------------------------------------------------------------------------------------------## +## Time / Date +## -----------------------------------------------------------------------------------------------## +- platform: time_date + display_options: + - 'time' + - 'date' \ No newline at end of file From 06493560fe38cc9cadc5795eeb6bc82b08af1ab9 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sat, 30 Jul 2022 18:04:34 +0200 Subject: [PATCH 17/57] Fix: Time and Date --- packages/time_date.yaml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/time_date.yaml b/packages/time_date.yaml index c1a0f76..16b9f5a 100644 --- a/packages/time_date.yaml +++ b/packages/time_date.yaml @@ -1,7 +1,8 @@ ## -----------------------------------------------------------------------------------------------## ## Time / Date ## -----------------------------------------------------------------------------------------------## -- platform: time_date - display_options: - - 'time' - - 'date' \ No newline at end of file +sensor: + - platform: time_date + display_options: + - 'time' + - 'date' \ No newline at end of file From 3c40ee265df2759437e375ca29264a2dcda8aceb Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sun, 31 Jul 2022 02:46:27 +0200 Subject: [PATCH 18/57] Sync Updates --- lovelace/overview/climate.yaml | 2 +- ....yaml => climate_automation.yaml.disabled} | 0 ...puts.yaml => climate_inputs.yaml.disabled} | 0 ...pts.yaml => climate_scripts.yaml.disabled} | 0 ...ors.yaml => climate_sensors.yaml.disabled} | 0 packages/homeassistant/homeassistant.yaml | 29 ++++++++++++++++++- packages/homeassistant/lovelace.yaml | 12 +++++--- packages/pfsense/pfsense_automations.yaml | 29 +++++++++++++++++++ .../{darksky.yaml => pirate_weather.yaml} | 11 +++---- 9 files changed, 72 insertions(+), 11 deletions(-) rename packages/climate/{climate_automation.yaml => climate_automation.yaml.disabled} (100%) rename packages/climate/{climate_inputs.yaml => climate_inputs.yaml.disabled} (100%) rename packages/climate/{climate_scripts.yaml => climate_scripts.yaml.disabled} (100%) rename packages/climate/{climate_sensors.yaml => climate_sensors.yaml.disabled} (100%) create mode 100644 packages/pfsense/pfsense_automations.yaml rename packages/{darksky.yaml => pirate_weather.yaml} (69%) diff --git a/lovelace/overview/climate.yaml b/lovelace/overview/climate.yaml index fc87aca..fe37586 100644 --- a/lovelace/overview/climate.yaml +++ b/lovelace/overview/climate.yaml @@ -27,7 +27,7 @@ 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_entity2: sensor.temperature_outside_pirateweather ulm_card_graph_type: fill ulm_card_graph_hours: 6 diff --git a/packages/climate/climate_automation.yaml b/packages/climate/climate_automation.yaml.disabled similarity index 100% rename from packages/climate/climate_automation.yaml rename to packages/climate/climate_automation.yaml.disabled diff --git a/packages/climate/climate_inputs.yaml b/packages/climate/climate_inputs.yaml.disabled similarity index 100% rename from packages/climate/climate_inputs.yaml rename to packages/climate/climate_inputs.yaml.disabled diff --git a/packages/climate/climate_scripts.yaml b/packages/climate/climate_scripts.yaml.disabled similarity index 100% rename from packages/climate/climate_scripts.yaml rename to packages/climate/climate_scripts.yaml.disabled diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml.disabled similarity index 100% rename from packages/climate/climate_sensors.yaml rename to packages/climate/climate_sensors.yaml.disabled diff --git a/packages/homeassistant/homeassistant.yaml b/packages/homeassistant/homeassistant.yaml index ba3c8b9..6dfef91 100644 --- a/packages/homeassistant/homeassistant.yaml +++ b/packages/homeassistant/homeassistant.yaml @@ -10,4 +10,31 @@ homeassistant: - '/tmp' -default_config: \ No newline at end of file +http: + use_x_forwarded_for: true + trusted_proxies: + - 127.0.0.1 + - ::1 + - 192.168.1.2 + - 192.168.1.1 + - 192.168.1.16 + - 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: \ No newline at end of file diff --git a/packages/homeassistant/lovelace.yaml b/packages/homeassistant/lovelace.yaml index 170c54b..e849465 100644 --- a/packages/homeassistant/lovelace.yaml +++ b/packages/homeassistant/lovelace.yaml @@ -16,11 +16,15 @@ lovelace: type: module - url: /hacsfiles/my-cards/my-slider.js type: module + #- url: /hacsfiles/my-cards/my-slider-v2.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 \ No newline at end of file + - url: /hacsfiles/lovelace-layout-card/layout-card.js + type: module + - url: /hacsfiles/lovelace-state-switch/state-switch.js + type: module \ No newline at end of file diff --git a/packages/pfsense/pfsense_automations.yaml b/packages/pfsense/pfsense_automations.yaml new file mode 100644 index 0000000..c183d2d --- /dev/null +++ b/packages/pfsense/pfsense_automations.yaml @@ -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" \ No newline at end of file diff --git a/packages/darksky.yaml b/packages/pirate_weather.yaml similarity index 69% rename from packages/darksky.yaml rename to packages/pirate_weather.yaml index 400de81..44cea2c 100644 --- a/packages/darksky.yaml +++ b/packages/pirate_weather.yaml @@ -1,5 +1,5 @@ ## -------------------------------------------------------------------------------------------------## -## DarkSky +## pirateweather ## -------------------------------------------------------------------------------------------------## @@ -7,8 +7,8 @@ ## Wetter-Plattform ## -------------------------------------------------------------------------------------------------## weather: - - platform: darksky - api_key: !secret darksky + - platform: pirateweather + api_key: !secret pirateweather mode: daily sun: @@ -16,7 +16,8 @@ sun: sensor: - platform: template + #api_key: !secret pirateweather sensors: - temperature_outside_darksky: - value_template: '{{ states.weather.dark_sky.attributes.temperature }}' + temperature_outside_pirateweather: + value_template: '{{ states.weather.pirateweather.attributes.temperature }}' friendly_name: 'Outside Temperature' \ No newline at end of file From 8fc6880290403c7267f32b3b148f29e72313a3cd Mon Sep 17 00:00:00 2001 From: root Date: Sun, 31 Jul 2022 13:28:12 +0200 Subject: [PATCH 19/57] Updates --- packages/climate/{eq3.yaml => eq3.yaml.disabled} | 0 packages/homeassistant/homeassistant.yaml | 9 ++++++--- 2 files changed, 6 insertions(+), 3 deletions(-) rename packages/climate/{eq3.yaml => eq3.yaml.disabled} (100%) diff --git a/packages/climate/eq3.yaml b/packages/climate/eq3.yaml.disabled similarity index 100% rename from packages/climate/eq3.yaml rename to packages/climate/eq3.yaml.disabled diff --git a/packages/homeassistant/homeassistant.yaml b/packages/homeassistant/homeassistant.yaml index 6dfef91..0bedb08 100644 --- a/packages/homeassistant/homeassistant.yaml +++ b/packages/homeassistant/homeassistant.yaml @@ -8,6 +8,10 @@ homeassistant: time_zone: Europe/Berlin allowlist_external_dirs: - '/tmp' + auth_providers: + - type: trusted_networks + trusted_networks: + - 10.10.10.0/24 http: @@ -15,9 +19,8 @@ http: trusted_proxies: - 127.0.0.1 - ::1 - - 192.168.1.2 - - 192.168.1.1 - - 192.168.1.16 + - 10.10.10.0/24 + - 172.30.32.0/24 - 172.30.33.0/24 From 3ddd1568fb7e2762dc5879f702aa8fbf20058ac1 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 1 Aug 2022 02:00:02 +0200 Subject: [PATCH 20/57] Updates --- lovelace/climate/recommendation.yaml | 50 +++++ lovelace/climate/setup.yaml | 58 +++++ lovelace/overview/climate.yaml | 12 +- lovelace/overview/welcome.yaml | 2 +- ...puts.yaml.disabled => climate_inputs.yaml} | 44 ++-- packages/climate/climate_sensors.yaml | 205 ++++++++++++++++++ .../climate/climate_sensors.yaml.disabled | 136 ------------ ui-lovelace.yaml | 13 +- .../custom_card_input_datetime.yaml | 172 +++++++++++++++ .../custom_card_input_number.yaml | 107 +++++++++ 10 files changed, 629 insertions(+), 170 deletions(-) create mode 100644 lovelace/climate/recommendation.yaml create mode 100644 lovelace/climate/setup.yaml rename packages/climate/{climate_inputs.yaml.disabled => climate_inputs.yaml} (66%) create mode 100644 packages/climate/climate_sensors.yaml delete mode 100644 packages/climate/climate_sensors.yaml.disabled create mode 100644 ui_lovelace_minimalist/custom_cards/custom_card_input_datetime.yaml create mode 100644 ui_lovelace_minimalist/custom_cards/custom_card_input_number.yaml diff --git a/lovelace/climate/recommendation.yaml b/lovelace/climate/recommendation.yaml new file mode 100644 index 0000000..6eecafc --- /dev/null +++ b/lovelace/climate/recommendation.yaml @@ -0,0 +1,50 @@ +- 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_pirateweather + 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: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.climate_temp + ulm_card_graph_type: fill + ulm_card_graph_hours: 6 + +- 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 \ No newline at end of file diff --git a/lovelace/climate/setup.yaml b/lovelace/climate/setup.yaml new file mode 100644 index 0000000..8e6d9b5 --- /dev/null +++ b/lovelace/climate/setup.yaml @@ -0,0 +1,58 @@ +- type: "vertical-stack" + cards: + - type: 'custom:button-card' + template: card_title + name: Day/Night + - 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 \ No newline at end of file diff --git a/lovelace/overview/climate.yaml b/lovelace/overview/climate.yaml index fe37586..4f4ed00 100644 --- a/lovelace/overview/climate.yaml +++ b/lovelace/overview/climate.yaml @@ -7,16 +7,8 @@ template: custom_card_httpedo13_sun -- 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 +- type: custom:simple-weather-card + entity: weather.pirateweather - type: 'custom:button-card' diff --git a/lovelace/overview/welcome.yaml b/lovelace/overview/welcome.yaml index 84b71a5..7606d81 100644 --- a/lovelace/overview/welcome.yaml +++ b/lovelace/overview/welcome.yaml @@ -7,7 +7,7 @@ entity: input_boolean.welcome_collapse variables: ulm_card_welcome_scenes_collapse: input_boolean.welcome_collapse - ulm_weather: "weather.dark_sky" + ulm_weather: weather.pirateweather entity_1: entity_id: scene.light_flux icon: "mdi:theme-light-dark" diff --git a/packages/climate/climate_inputs.yaml.disabled b/packages/climate/climate_inputs.yaml similarity index 66% rename from packages/climate/climate_inputs.yaml.disabled rename to packages/climate/climate_inputs.yaml index b0d7703..9fbf1e8 100644 --- a/packages/climate/climate_inputs.yaml.disabled +++ b/packages/climate/climate_inputs.yaml @@ -3,37 +3,37 @@ ## -------------------------------------------------------------------------------------------------## input_number: climate_temp: - name: Ziel Manuell + name: Target Manual #initial: 21.5 min: 15 max: 29 step: 0.5 - climate_temp_morning: - name: Ziel Morgen + climate_temp_day: + name: Target Day #initial: 20.5 min: 15 max: 29 step: 0.5 climate_temp_night: - name: Ziel Nacht + name: Target Night #initial: 17.0 min: 15 max: 29 step: 0.5 climate_temp_accuracy: - name: Genauigkeit + name: Accuracy #initial: 1 min: 0 max: 5 step: 0.5 climate_temp_offset: - name: Offset Heizung->Temp + name: Offset Climate<->Temp #initial: 1 min: -2 max: 2 step: 0.5 climate_temp_last: - name: Letzte Temp + name: Last Temp min: 0 max: 29 step: 0.01 @@ -41,33 +41,33 @@ input_number: input_datetime: climate_morning: - name: "Morgen" + name: "Day begins" 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_morning_weekend: +# name: "Day begins Sat." +# has_time: true +# has_date: false +# #initial: "15:30" climate_night: - name: "Nacht" + name: "Day ends" has_time: true has_date: false #initial: "23:59" input_boolean: climate_auto: - name: 'Automatisch' + name: 'Automatic' icon: mdi:power #initial: off - climate_power: - name: 'Power' - icon: mdi:power - #initial: off - climate_weekday: - name: 'Wochentag' - #initial: on +# climate_power: +# name: 'Power' +# icon: mdi:power +# #initial: off +# climate_weekday: +# name: 'Weekday' +# #initial: on climate_away: name: 'Away' #initial: off \ No newline at end of file diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml new file mode 100644 index 0000000..600d13a --- /dev/null +++ b/packages/climate/climate_sensors.yaml @@ -0,0 +1,205 @@ +## -------------------------------------------------------------------------------------------------## +## Sensoren +## -------------------------------------------------------------------------------------------------## +sensor: + ## -----------------------------------------------------------------------------------------------## + ## Berechnung der Temperaturveränderung + ## -----------------------------------------------------------------------------------------------## + - 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) }} + ## -----------------------------------------------------------------------------------------------## + ## Berechnung der aktuellen Zieltemperatur bzgl Morgen/Nacht, Automatik/Manuell + ## -----------------------------------------------------------------------------------------------## + - 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 %} + + + ## -----------------------------------------------------------------------------------------------## + ## Unterer + Oberer Schwellwert + ## -----------------------------------------------------------------------------------------------## + - 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_pirateweather")|float %} + {% if temp_inside > max %} + {% if temp_inside > temp_outside %} {{ "open window" }} + {% else %} {{ "close window" }} {% endif %} + {% endif %} + {% if temp_inside < min %} {{ "turn the heater on" }} {% endif %} + + + ## -----------------------------------------------------------------------------------------------## + ## Differenz zu Ziel + ## -----------------------------------------------------------------------------------------------## + - 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' + + + ## -----------------------------------------------------------------------------------------------## + ## 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' \ No newline at end of file diff --git a/packages/climate/climate_sensors.yaml.disabled b/packages/climate/climate_sensors.yaml.disabled deleted file mode 100644 index bebc158..0000000 --- a/packages/climate/climate_sensors.yaml.disabled +++ /dev/null @@ -1,136 +0,0 @@ -## -------------------------------------------------------------------------------------------------## -## 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' \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 7673936..54b5dfd 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -65,4 +65,15 @@ views: !include lovelace/pfsense/traffic.yaml - type: "vertical-stack" cards: - !include lovelace/pfsense/rules.yaml \ No newline at end of file + !include lovelace/pfsense/rules.yaml + + + - title: "Climate" + path: 3 + cards: + - type: "vertical-stack" + cards: + !include lovelace/climate/setup.yaml + - type: "vertical-stack" + cards: + !include lovelace/climate/recommendation.yaml \ No newline at end of file diff --git a/ui_lovelace_minimalist/custom_cards/custom_card_input_datetime.yaml b/ui_lovelace_minimalist/custom_cards/custom_card_input_datetime.yaml new file mode 100644 index 0000000..c7cdce2 --- /dev/null +++ b/ui_lovelace_minimalist/custom_cards/custom_card_input_datetime.yaml @@ -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)" \ No newline at end of file diff --git a/ui_lovelace_minimalist/custom_cards/custom_card_input_number.yaml b/ui_lovelace_minimalist/custom_cards/custom_card_input_number.yaml new file mode 100644 index 0000000..215f17a --- /dev/null +++ b/ui_lovelace_minimalist/custom_cards/custom_card_input_number.yaml @@ -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)" \ No newline at end of file From 8757dd4e6394f2ebed17819396c0d9c913878d51 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 1 Aug 2022 02:09:44 +0200 Subject: [PATCH 21/57] recommendation to dashboard --- lovelace/overview/climate.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lovelace/overview/climate.yaml b/lovelace/overview/climate.yaml index 4f4ed00..80b027d 100644 --- a/lovelace/overview/climate.yaml +++ b/lovelace/overview/climate.yaml @@ -2,6 +2,9 @@ template: card_title name: Climate +- type: 'custom:button-card' + template: card_generic + entity: sensor.climate_temp_recommendation - type: custom:button-card template: custom_card_httpedo13_sun From 3b5df0ad864fbec10a270957fd2463a22519207f Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 1 Aug 2022 02:11:03 +0200 Subject: [PATCH 22/57] dashboard fixes --- lovelace/overview/climate.yaml | 4 +--- lovelace/overview/welcome.yaml | 6 +++++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lovelace/overview/climate.yaml b/lovelace/overview/climate.yaml index 80b027d..f5418f9 100644 --- a/lovelace/overview/climate.yaml +++ b/lovelace/overview/climate.yaml @@ -2,13 +2,11 @@ template: card_title name: Climate + - type: 'custom:button-card' template: card_generic entity: sensor.climate_temp_recommendation -- type: custom:button-card - template: custom_card_httpedo13_sun - - type: custom:simple-weather-card entity: weather.pirateweather diff --git a/lovelace/overview/welcome.yaml b/lovelace/overview/welcome.yaml index 7606d81..917caaf 100644 --- a/lovelace/overview/welcome.yaml +++ b/lovelace/overview/welcome.yaml @@ -37,4 +37,8 @@ icon: "mdi:lightbulb-group-off-outline" icon_color: "red" name: "All Off" - bg_color: "red" \ No newline at end of file + bg_color: "red" + + +- type: custom:button-card + template: custom_card_httpedo13_sun \ No newline at end of file From 9db4448fa41e6c1659f33b11c9eb0b083851b57e Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 2 Aug 2022 14:03:44 +0200 Subject: [PATCH 23/57] Updates --- lovelace/climate/setup.yaml | 2 + lovelace/lights/adaptive.yaml | 31 +++++ lovelace/lights/lightbulbs.yaml | 22 +--- lovelace/lights/scenes.yaml | 23 +--- lovelace/overview/batteries.yaml | 20 ++- lovelace/overview/climate.yaml | 49 +++---- lovelace/overview/energy.yaml | 6 +- lovelace/overview/feed.yaml | 26 ++++ lovelace/overview/lights.yaml | 24 ++-- lovelace/overview/multimedia.yaml | 15 +++ lovelace/overview/nas.yaml | 6 +- lovelace/overview/vacuum.yaml | 20 +++ lovelace/overview/welcome.yaml | 20 ++- packages/climate/climate_automation.yaml | 121 ++++++++++++++++++ .../climate/climate_automation.yaml.disabled | 99 -------------- packages/homeassistant/homeassistant.yaml | 6 + packages/homeassistant/lovelace.yaml | 30 ----- packages/homekit.yaml | 4 +- packages/light/adaptive.yaml | 18 +++ ...circadian.yaml => circadian.yaml.disabled} | 0 packages/light/lightscenes.yaml | 16 +-- packages/light/lightstore.yaml | 4 +- packages/light/yeelight.yaml | 12 +- packages/pirate_weather.yaml | 3 +- resources.yaml | 36 ++++++ ui-lovelace-testing.yaml | 14 ++ ui-lovelace.yaml | 54 ++++++-- 27 files changed, 436 insertions(+), 245 deletions(-) create mode 100644 lovelace/lights/adaptive.yaml create mode 100644 lovelace/overview/feed.yaml create mode 100644 lovelace/overview/multimedia.yaml create mode 100644 lovelace/overview/vacuum.yaml create mode 100644 packages/climate/climate_automation.yaml delete mode 100644 packages/climate/climate_automation.yaml.disabled delete mode 100644 packages/homeassistant/lovelace.yaml create mode 100644 packages/light/adaptive.yaml rename packages/light/{circadian.yaml => circadian.yaml.disabled} (100%) create mode 100644 resources.yaml create mode 100644 ui-lovelace-testing.yaml diff --git a/lovelace/climate/setup.yaml b/lovelace/climate/setup.yaml index 8e6d9b5..451b614 100644 --- a/lovelace/climate/setup.yaml +++ b/lovelace/climate/setup.yaml @@ -3,6 +3,8 @@ - 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" diff --git a/lovelace/lights/adaptive.yaml b/lovelace/lights/adaptive.yaml new file mode 100644 index 0000000..f634b94 --- /dev/null +++ b/lovelace/lights/adaptive.yaml @@ -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 \ No newline at end of file diff --git a/lovelace/lights/lightbulbs.yaml b/lovelace/lights/lightbulbs.yaml index 40cd401..d52f5be 100644 --- a/lovelace/lights/lightbulbs.yaml +++ b/lovelace/lights/lightbulbs.yaml @@ -7,26 +7,10 @@ - type: 'custom:button-card' template: card_light_slider_collapse variables: - ulm_card_light_slider_collapse_name: Ceiling 1 + ulm_card_light_slider_collapse_name: Ceiling ulm_card_light_enable_collapse: false - ulm_card_light_name: Ceiling 1 - entity: light.ceiling1 - - type: 'custom:button-card' - template: card_light_slider_collapse - variables: - ulm_card_light_slider_collapse_name: Ceiling 2 - ulm_card_light_enable_collapse: false - ulm_card_light_name: Ceiling 2 - entity: light.ceiling2 -- type: "horizontal-stack" - cards: - - type: 'custom:button-card' - template: card_light_slider_collapse - variables: - ulm_card_light_slider_collapse_name: Ceiling 3 - ulm_card_light_enable_collapse: false - ulm_card_light_name: Ceiling 3 - entity: light.ceiling3 + ulm_card_light_name: Ceiling + entity: light.ceiling - type: 'custom:button-card' template: card_light_slider_collapse variables: diff --git a/lovelace/lights/scenes.yaml b/lovelace/lights/scenes.yaml index 820ba6a..e499229 100644 --- a/lovelace/lights/scenes.yaml +++ b/lovelace/lights/scenes.yaml @@ -7,10 +7,10 @@ - card_scenes variables: entity_1: - entity_id: scene.light_flux + entity_id: scene.light_adaptive icon: "mdi:YOUR_ICON" icon_color: "yellow" - name: Flux + name: Adaptive bg_color: "yellow" entity_2: entity_id: scene.light_blue @@ -25,25 +25,14 @@ name: Night bg_color: "purple" entity_4: - entity_id: scene.light_alloff + entity_id: script.light_store_restore icon: "mdi:YOUR_ICON" icon_color: "green" - name: All Off + name: All On bg_color: "green" entity_5: - entity_id: scene.light_alloff + entity_id: script.light_store_off icon: "mdi:YOUR_ICON" icon_color: "red" name: All Off - bg_color: "red" - - -- type: 'custom:button-card' - template: card_title - name: Switches - -- type: 'custom:button-card' - template: card_input_boolean - entity: switch.circadian_lighting_circadian_lighting - variables: - ulm_card_input_boolean_name: Circadian Lighting \ No newline at end of file + bg_color: "red" \ No newline at end of file diff --git a/lovelace/overview/batteries.yaml b/lovelace/overview/batteries.yaml index 1b403d6..9f921a0 100644 --- a/lovelace/overview/batteries.yaml +++ b/lovelace/overview/batteries.yaml @@ -1,6 +1,6 @@ -- type: 'custom:button-card' - template: card_title - name: Batteries +#- type: 'custom:button-card' +# template: card_title +# name: Batteries - type: "horizontal-stack" @@ -21,4 +21,16 @@ ulm_card_battery_charger_type_entity_id: sensor.ipad_battery_level ulm_card_battery_battery_level_danger: 30 ulm_card_battery_battery_level_warning: 80 - ulm_card_battery_name: iPad \ No newline at end of file + ulm_card_battery_name: iPad + + +# - type: "horizontal-stack" +# cards: +# - type: 'custom:button-card' +# template: card_battery +# entity: sensor.kais_apple_watch_battery_state +# variables: +# ulm_card_battery_charger_type_entity_id: sensor.kais_apple_watch_battery_state +# ulm_card_battery_battery_level_danger: 30 +# ulm_card_battery_battery_level_warning: 80 +# ulm_card_battery_name: Watch \ No newline at end of file diff --git a/lovelace/overview/climate.yaml b/lovelace/overview/climate.yaml index f5418f9..7e0a473 100644 --- a/lovelace/overview/climate.yaml +++ b/lovelace/overview/climate.yaml @@ -1,28 +1,29 @@ -- type: 'custom:button-card' - template: card_title - name: Climate +#- type: 'custom:button-card' +# template: card_title +# name: Climate -- type: 'custom:button-card' - template: card_generic - entity: sensor.climate_temp_recommendation +#- type: custom:simple-weather-card +# entity: weather.pirateweather -- type: custom:simple-weather-card - entity: weather.pirateweather - - -- 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_pirateweather - ulm_card_graph_type: fill - ulm_card_graph_hours: 6 +- 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_pirateweather + type: column + name: Outside + group_by: + func: avg + duration: 30min - type: "horizontal-stack" @@ -37,4 +38,8 @@ template: card_generic entity: sensor.temperature_kai_pressure variables: - ulm_card_generic_name: Pressure \ No newline at end of file + ulm_card_generic_name: Pressure + + +- type: custom:weather-card + entity: weather.pirateweather \ No newline at end of file diff --git a/lovelace/overview/energy.yaml b/lovelace/overview/energy.yaml index 8629107..90d0b29 100644 --- a/lovelace/overview/energy.yaml +++ b/lovelace/overview/energy.yaml @@ -1,6 +1,6 @@ -- type: 'custom:button-card' - template: card_title - name: Energy +#- type: 'custom:button-card' +# template: card_title +# name: Energy - type: 'custom:button-card' diff --git a/lovelace/overview/feed.yaml b/lovelace/overview/feed.yaml new file mode 100644 index 0000000..7fcea53 --- /dev/null +++ b/lovelace/overview/feed.yaml @@ -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" \ No newline at end of file diff --git a/lovelace/overview/lights.yaml b/lovelace/overview/lights.yaml index 3a2d196..098d43a 100644 --- a/lovelace/overview/lights.yaml +++ b/lovelace/overview/lights.yaml @@ -1,6 +1,6 @@ -- type: 'custom:button-card' - template: card_title - name: Lights +#- type: 'custom:button-card' +# template: card_title +# name: Lights - type: "horizontal-stack" @@ -24,8 +24,16 @@ entity: light.all_direct -- type: 'custom:button-card' - template: card_input_boolean - entity: switch.circadian_lighting_circadian_lighting - variables: - ulm_card_input_boolean_name: Circadian Lighting \ No newline at end of file +- 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 diff --git a/lovelace/overview/multimedia.yaml b/lovelace/overview/multimedia.yaml new file mode 100644 index 0000000..07ddc12 --- /dev/null +++ b/lovelace/overview/multimedia.yaml @@ -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 \ No newline at end of file diff --git a/lovelace/overview/nas.yaml b/lovelace/overview/nas.yaml index 87e3295..7dc2ea8 100644 --- a/lovelace/overview/nas.yaml +++ b/lovelace/overview/nas.yaml @@ -1,6 +1,6 @@ -- type: 'custom:button-card' - template: card_title - name: NAS +#- type: 'custom:button-card' +# template: card_title +# name: NAS - type: "horizontal-stack" diff --git a/lovelace/overview/vacuum.yaml b/lovelace/overview/vacuum.yaml new file mode 100644 index 0000000..f431064 --- /dev/null +++ b/lovelace/overview/vacuum.yaml @@ -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 \ No newline at end of file diff --git a/lovelace/overview/welcome.yaml b/lovelace/overview/welcome.yaml index 917caaf..13ddb83 100644 --- a/lovelace/overview/welcome.yaml +++ b/lovelace/overview/welcome.yaml @@ -1,6 +1,8 @@ -- type: 'custom:button-card' - template: card_title - name: Home Assistant +#- type: 'custom:button-card' +# template: card_title +# name: Home Assistant + + - type: "custom:button-card" template: "card_welcome_scenes" triggers_update: input_boolean.welcome_collapse @@ -9,10 +11,10 @@ ulm_card_welcome_scenes_collapse: input_boolean.welcome_collapse ulm_weather: weather.pirateweather entity_1: - entity_id: scene.light_flux + entity_id: scene.light_adaptive icon: "mdi:theme-light-dark" icon_color: "yellow" - name: "Flux" + name: "Adaptive" bg_color: "yellow" entity_2: entity_id: scene.light_blue @@ -33,12 +35,8 @@ name: "All On" bg_color: "green" entity_5: - entity_id: "scene.light_alloff" + entity_id: "script.light_store_off" icon: "mdi:lightbulb-group-off-outline" icon_color: "red" name: "All Off" - bg_color: "red" - - -- type: custom:button-card - template: custom_card_httpedo13_sun \ No newline at end of file + bg_color: "red" \ No newline at end of file diff --git a/packages/climate/climate_automation.yaml b/packages/climate/climate_automation.yaml new file mode 100644 index 0000000..3be685e --- /dev/null +++ b/packages/climate/climate_automation.yaml @@ -0,0 +1,121 @@ +automation: + ## -----------------------------------------------------------------------------------------------## + ## Notification on state change + ## -----------------------------------------------------------------------------------------------## + - alias: "climate_recommendation_close" + trigger: + - platform: state + entity_id: sensor.climate_temp_recommendation + to: 'close window' + action: + - service: notify.notify + data: + message: "Close the window." + - alias: "climate_recommendation_open" + trigger: + - platform: state + entity_id: sensor.climate_temp_recommendation + to: 'open 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 \ No newline at end of file diff --git a/packages/climate/climate_automation.yaml.disabled b/packages/climate/climate_automation.yaml.disabled deleted file mode 100644 index e4f43fa..0000000 --- a/packages/climate/climate_automation.yaml.disabled +++ /dev/null @@ -1,99 +0,0 @@ -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 \ No newline at end of file diff --git a/packages/homeassistant/homeassistant.yaml b/packages/homeassistant/homeassistant.yaml index 0bedb08..a36ac90 100644 --- a/packages/homeassistant/homeassistant.yaml +++ b/packages/homeassistant/homeassistant.yaml @@ -14,6 +14,11 @@ homeassistant: - 10.10.10.0/24 +lovelace: + mode: yaml + resources: !include ../../resources.yaml + + http: use_x_forwarded_for: true trusted_proxies: @@ -34,6 +39,7 @@ history: map: mobile_app: person: +python_script: ssdp: system_health: timer: diff --git a/packages/homeassistant/lovelace.yaml b/packages/homeassistant/lovelace.yaml deleted file mode 100644 index e849465..0000000 --- a/packages/homeassistant/lovelace.yaml +++ /dev/null @@ -1,30 +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/my-cards/my-slider-v2.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 \ No newline at end of file diff --git a/packages/homekit.yaml b/packages/homekit.yaml index 45d0978..731c16b 100644 --- a/packages/homekit.yaml +++ b/packages/homekit.yaml @@ -48,8 +48,8 @@ homekit: name: Lights Off scene.light_blue: name: Lights Blue - scene.light_flux: - name: Lights Flux + scene.light_adaptive: + name: Lights Adaptive scene.light_night: name: Lights Night switch.circadian_lighting_circadian_lighting: diff --git a/packages/light/adaptive.yaml b/packages/light/adaptive.yaml new file mode 100644 index 0000000..36e02e8 --- /dev/null +++ b/packages/light/adaptive.yaml @@ -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: 2700 + max_color_temp: 6500 + sleep_brightness: 1 + sleep_color_temp: 1000 + take_over_control: true + detect_non_ha_changes: false + only_once: false \ No newline at end of file diff --git a/packages/light/circadian.yaml b/packages/light/circadian.yaml.disabled similarity index 100% rename from packages/light/circadian.yaml rename to packages/light/circadian.yaml.disabled diff --git a/packages/light/lightscenes.yaml b/packages/light/lightscenes.yaml index 4e59de2..8920883 100644 --- a/packages/light/lightscenes.yaml +++ b/packages/light/lightscenes.yaml @@ -1,15 +1,14 @@ scene: - - name: light_alloff - entities: - light.all_lights: false - - name: light_flux + - name: light_adaptive entities: light.all_direct: false light.all_indirect: true - switch.circadian_lighting_circadian_lighting: on + switch.adaptive_lighting_default: on + switch.adaptive_lighting_sleep_mode_default: off - name: light_blue entities: - switch.circadian_lighting_circadian_lighting: off + switch.adaptive_lighting_default: off + switch.adaptive_lighting_sleep_mode_default: off light.all_direct: false light.all_indirect: rgb_color: [0, 0, 255] @@ -17,9 +16,10 @@ scene: brightness: 20 - name: light_night entities: - switch.circadian_lighting_circadian_lighting: off + switch.adaptive_lighting_default: on light.all_direct: false light.all_indirect: rgb_color: [255, 139, 21] state: true - brightness: 1 \ No newline at end of file + brightness: 1 + switch.adaptive_lighting_sleep_mode_default: on \ No newline at end of file diff --git a/packages/light/lightstore.yaml b/packages/light/lightstore.yaml index 8f7a7dc..b93bdff 100644 --- a/packages/light/lightstore.yaml +++ b/packages/light/lightstore.yaml @@ -10,9 +10,9 @@ script: store_name: flash_store entity_id: - light.bed - - light.closet + - light.ceiling - light.desk - - light.direct + - light.bed_ceiling - light.tv light_store_off: sequence: diff --git a/packages/light/yeelight.yaml b/packages/light/yeelight.yaml index 02b7c01..9643372 100644 --- a/packages/light/yeelight.yaml +++ b/packages/light/yeelight.yaml @@ -19,28 +19,28 @@ yeelight: 10.10.10.82: name: ceiling1 save_on_change: False - transition: 2500 + transition: 1500 10.10.10.83: name: ceiling2 save_on_change: False - transition: 2500 + transition: 1500 10.10.10.80: name: ceiling3 save_on_change: False - transition: 2500 + transition: 1500 10.10.10.81: name: bed_ceiling save_on_change: False - transition: 2500 + transition: 1500 10.10.10.84: name: bed save_on_change: False - transition: 2500 + transition: 1500 model: strip1 10.10.10.85: name: desk save_on_change: False - transition: 2500 + transition: 1500 model: strip1 diff --git a/packages/pirate_weather.yaml b/packages/pirate_weather.yaml index 44cea2c..582f1a2 100644 --- a/packages/pirate_weather.yaml +++ b/packages/pirate_weather.yaml @@ -20,4 +20,5 @@ sensor: sensors: temperature_outside_pirateweather: value_template: '{{ states.weather.pirateweather.attributes.temperature }}' - friendly_name: 'Outside Temperature' \ No newline at end of file + friendly_name: 'Outside Temperature' + unit_of_measurement: '°C' \ No newline at end of file diff --git a/resources.yaml b/resources.yaml new file mode 100644 index 0000000..71dd7c5 --- /dev/null +++ b/resources.yaml @@ -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 \ No newline at end of file diff --git a/ui-lovelace-testing.yaml b/ui-lovelace-testing.yaml new file mode 100644 index 0000000..68e13bd --- /dev/null +++ b/ui-lovelace-testing.yaml @@ -0,0 +1,14 @@ +--- +button_card_templates: !include_dir_merge_named "custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/" + + +title: "Testing" +theme: "minimalist-desktop" +background: "var(--background-image)" + + +swipe_nav: + wrap: true + animate: swipe + prevent_default: true + swipe_amount: 30 \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 54b5dfd..a7e1bdf 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -4,31 +4,62 @@ button_card_templates: !include_dir_merge_named "custom_components/ui_lovelace_m title: "Overview" theme: "minimalist-desktop" -background: "var(--background-image)" +background: "var(--background-image)" + + +swipe_nav: + wrap: true + animate: swipe + prevent_default: true + swipe_amount: 30 views: - - title: "Overview" + - type: custom:vertical-layout + title: "Overview" path: 0 cards: - - type: "vertical-stack" + ## Column 1 + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/overview/welcome.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/overview/lights.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" + cards: + !include lovelace/overview/feed.yaml + - type: custom:layout-break + ## Column 2 + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/overview/climate.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/overview/batteries.yaml - - type: "vertical-stack" - cards: - !include lovelace/overview/energy.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/overview/nas.yaml + - type: custom:layout-break + ## Column 3 + - type: custom:vertical-layout + type: "vertical-stack" + cards: + !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 - title: "Lights" @@ -37,6 +68,9 @@ views: - type: "vertical-stack" cards: !include lovelace/lights/scenes.yaml + - type: "vertical-stack" + cards: + !include lovelace/lights/adaptive.yaml - type: "vertical-stack" cards: !include lovelace/lights/lightgroups.yaml From 78259b2dc4e657a4c0de2a4b49f264debcf492a6 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 2 Aug 2022 18:57:48 +0200 Subject: [PATCH 24/57] Updates --- lovelace/climate/recommendation.yaml | 28 +++-- lovelace/lights/lightbulbs.yaml | 4 +- lovelace/lights/lightgroups.yaml | 4 +- lovelace/lights/lightstripes.yaml | 4 +- lovelace/overview/energy.yaml | 25 +++-- lovelace/overview/lights.yaml | 4 +- lovelace/pfsense/traffic.yaml | 146 ++++++++++++++++----------- packages/light/lightscenes.yaml | 8 +- ui-lovelace.yaml | 59 +++++++---- 9 files changed, 174 insertions(+), 108 deletions(-) diff --git a/lovelace/climate/recommendation.yaml b/lovelace/climate/recommendation.yaml index 6eecafc..64be368 100644 --- a/lovelace/climate/recommendation.yaml +++ b/lovelace/climate/recommendation.yaml @@ -23,17 +23,23 @@ variables: ulm_card_generic_swap_name: difference -- 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.climate_temp - ulm_card_graph_type: fill - ulm_card_graph_hours: 6 +- 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_pirateweather + type: column + name: Outside + group_by: + func: avg + duration: 30min - type: "horizontal-stack" cards: diff --git a/lovelace/lights/lightbulbs.yaml b/lovelace/lights/lightbulbs.yaml index d52f5be..1f993e5 100644 --- a/lovelace/lights/lightbulbs.yaml +++ b/lovelace/lights/lightbulbs.yaml @@ -8,13 +8,13 @@ template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Ceiling - ulm_card_light_enable_collapse: false + 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: false + ulm_card_light_enable_collapse: true ulm_card_light_name: Bed entity: light.bed_ceiling \ No newline at end of file diff --git a/lovelace/lights/lightgroups.yaml b/lovelace/lights/lightgroups.yaml index 707f8f7..ad90f84 100644 --- a/lovelace/lights/lightgroups.yaml +++ b/lovelace/lights/lightgroups.yaml @@ -8,7 +8,7 @@ template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Indirect - ulm_card_light_enable_collapse: false + 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 @@ -18,6 +18,6 @@ template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Direct - ulm_card_light_enable_collapse: false + ulm_card_light_enable_collapse: true ulm_card_light_name: Direct entity: light.all_direct \ No newline at end of file diff --git a/lovelace/lights/lightstripes.yaml b/lovelace/lights/lightstripes.yaml index 71ec789..646d459 100644 --- a/lovelace/lights/lightstripes.yaml +++ b/lovelace/lights/lightstripes.yaml @@ -8,7 +8,7 @@ template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Bed - ulm_card_light_enable_collapse: false + ulm_card_light_enable_collapse: true ulm_card_light_name: Bed entity: light.bed @@ -16,6 +16,6 @@ template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Desk - ulm_card_light_enable_collapse: false + ulm_card_light_enable_collapse: true ulm_card_light_name: Desk entity: light.desk \ No newline at end of file diff --git a/lovelace/overview/energy.yaml b/lovelace/overview/energy.yaml index 90d0b29..948781b 100644 --- a/lovelace/overview/energy.yaml +++ b/lovelace/overview/energy.yaml @@ -3,29 +3,32 @@ # name: Energy -- 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: 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.schreibtisch_today_s_consumption + 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.schreibtisch_total_consumption + entity: sensor.desk_total_consumption variables: ulm_card_generic_name: Total ulm_card_generic_icon: "mdi:home-lightning-bolt" \ No newline at end of file diff --git a/lovelace/overview/lights.yaml b/lovelace/overview/lights.yaml index 098d43a..cdbcc69 100644 --- a/lovelace/overview/lights.yaml +++ b/lovelace/overview/lights.yaml @@ -9,7 +9,7 @@ template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Indirect - ulm_card_light_enable_collapse: false + 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 @@ -19,7 +19,7 @@ template: card_light_slider_collapse variables: ulm_card_light_slider_collapse_name: Direct - ulm_card_light_enable_collapse: false + ulm_card_light_enable_collapse: true ulm_card_light_name: Direct entity: light.all_direct diff --git a/lovelace/pfsense/traffic.yaml b/lovelace/pfsense/traffic.yaml index d0c2a1e..9c653a2 100644 --- a/lovelace/pfsense/traffic.yaml +++ b/lovelace/pfsense/traffic.yaml @@ -3,62 +3,90 @@ name: Traffic -- type: 'custom:button-card' - template: card_graph - entity: sensor.pfsense_interface_wan_inbytes_kilobytes_per_second - variables: - ulm_card_graph_color: "var(--google-blue)" - ulm_card_graph_name: WAN Incoming - ulm_card_graph_entity: sensor.pfsense_interface_wan_inbytes_kilobytes_per_second - ulm_card_graph_color2: "var(--google-green)" - ulm_card_graph_entity2: sensor.pfsense_interface_wan_outbytes_kilobytes_per_second - ulm_card_graph_type: fill - ulm_card_graph_hours: 1 -- type: "horizontal-stack" - cards: - - type: 'custom:button-card' - template: card_graph - entity: sensor.pfsense_interface_mullvad1_inbytes_kilobytes_per_second - variables: - ulm_card_graph_color: "var(--google-blue)" - ulm_card_graph_name: Mullvad1 Incoming - ulm_card_graph_entity: sensor.pfsense_interface_mullvad1_inbytes_kilobytes_per_second - ulm_card_graph_color2: "var(--google-green)" - ulm_card_graph_entity2: sensor.pfsense_interface_mullvad1_outbytes_kilobytes_per_second - ulm_card_graph_type: fill - ulm_card_graph_hours: 1 - - type: 'custom:button-card' - template: card_graph - entity: sensor.pfsense_interface_mullvad2_inbytes_kilobytes_per_second - variables: - ulm_card_graph_color: "var(--google-blue)" - ulm_card_graph_name: Mullvad2 Incoming - ulm_card_graph_entity: sensor.pfsense_interface_mullvad2_inbytes_kilobytes_per_second - ulm_card_graph_color2: "var(--google-green)" - ulm_card_graph_entity2: sensor.pfsense_interface_mullvad2_outbytes_kilobytes_per_second - ulm_card_graph_type: fill - ulm_card_graph_hours: 1 -- type: "horizontal-stack" - cards: - - type: 'custom:button-card' - template: card_graph - entity: sensor.pfsense_interface_lan_inbytes_kilobytes_per_second - variables: - ulm_card_graph_color: "var(--google-blue)" - ulm_card_graph_name: LAN Incoming - ulm_card_graph_entity: sensor.pfsense_interface_lan_inbytes_kilobytes_per_second - ulm_card_graph_color2: "var(--google-green)" - ulm_card_graph_entity2: sensor.pfsense_interface_lan_outbytes_kilobytes_per_second - ulm_card_graph_type: fill - ulm_card_graph_hours: 1 - - type: 'custom:button-card' - template: card_graph - entity: sensor.pfsense_interface_backend_inbytes_kilobytes_per_second - variables: - ulm_card_graph_color: "var(--google-blue)" - ulm_card_graph_name: Backend Incoming - ulm_card_graph_entity: sensor.pfsense_interface_backend_inbytes_kilobytes_per_second - ulm_card_graph_color2: "var(--google-green)" - ulm_card_graph_entity2: sensor.pfsense_interface_backend_outbytes_kilobytes_per_second - ulm_card_graph_type: fill - ulm_card_graph_hours: 1 \ No newline at end of file +- 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 \ No newline at end of file diff --git a/packages/light/lightscenes.yaml b/packages/light/lightscenes.yaml index 8920883..e58d968 100644 --- a/packages/light/lightscenes.yaml +++ b/packages/light/lightscenes.yaml @@ -22,4 +22,10 @@ scene: rgb_color: [255, 139, 21] state: true brightness: 1 - switch.adaptive_lighting_sleep_mode_default: on \ No newline at end of file + switch.adaptive_lighting_sleep_mode_default: on + - name: light_all_on + entities: + script.light_store_restore: on + - name: light_all_off + entities: + script.light_store_off: on \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index a7e1bdf..d36a653 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -61,53 +61,76 @@ views: cards: !include lovelace/overview/vacuum.yaml - - - title: "Lights" + - type: custom:vertical-layout + title: "Lights" path: 1 cards: - - type: "vertical-stack" + ## Column 1 + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/lights/scenes.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/lights/adaptive.yaml - - type: "vertical-stack" + - type: custom:layout-break + ## Column 2 + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/lights/lightgroups.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/lights/lightbulbs.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/lights/lightstripes.yaml - - title: "pfSense" + - type: custom:vertical-layout + title: "pfSense" path: 2 cards: - - type: "vertical-stack" + ## Column 1 + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/pfsense/notifications.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/pfsense/load.yaml - - type: "vertical-stack" + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/pfsense/gateways.yaml - - type: "vertical-stack" - cards: - !include lovelace/pfsense/traffic.yaml - - type: "vertical-stack" + - 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 - - title: "Climate" + - type: custom:vertical-layout + title: "Climate" path: 3 cards: - - type: "vertical-stack" + ## Column 1 + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/climate/setup.yaml - - type: "vertical-stack" + - type: custom:layout-break + ## Column 2 + - type: custom:vertical-layout + type: "vertical-stack" cards: !include lovelace/climate/recommendation.yaml \ No newline at end of file From 34d1ad936738681e3c07d4a1dd309f58f941857d Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 2 Aug 2022 20:31:36 +0200 Subject: [PATCH 25/57] Recommended: threshold --- packages/climate/climate_sensors.yaml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index 600d13a..6d53612 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -104,11 +104,14 @@ sensor: {% set target = states("sensor.climate_temp")|float %} {% set temp_inside = states("sensor.temperature_kai_temperature")|float %} {% set temp_outside = states("sensor.temperature_outside_pirateweather")|float %} - {% if temp_inside > max %} - {% if temp_inside > temp_outside %} {{ "open window" }} - {% else %} {{ "close window" }} {% endif %} + {% set inside_max = temp_inside + states("input_number.climate_temp_accuracy")|float %} + {% set inside_min = temp_inside - states("input_number.climate_temp_accuracy")|float %} + {% if temp_inside > target %} + {% if inside_max > temp_outside %} {{ "open window" }} {% endif %} + {% else %} + {% if temp_inside < min %} {{ "close window" }} {% endif %} {% endif %} - {% if temp_inside < min %} {{ "turn the heater on" }} {% endif %} + ## -----------------------------------------------------------------------------------------------## From ff50b2ecacd30a5f3997e61dc219340147b92eb5 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Wed, 3 Aug 2022 00:59:17 +0200 Subject: [PATCH 26/57] Szenen --- packages/homekit.yaml | 55 ++++++++++++--------------------- packages/light/adaptive.yaml | 2 +- packages/light/lightscenes.yaml | 8 +---- 3 files changed, 21 insertions(+), 44 deletions(-) diff --git a/packages/homekit.yaml b/packages/homekit.yaml index 731c16b..b11f9ba 100644 --- a/packages/homekit.yaml +++ b/packages/homekit.yaml @@ -4,58 +4,41 @@ homekit: 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 + - script.light_store_off + - script.light_store_restore - scene.light_flux - scene.light_night - - switch.circadian_lighting_circadian_lighting - - binary_sensor.mullvad_exit_ip + - 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: Humidity - sensor.temperature_kai_pressure: - name: Pressure + name: Feuchtigkeit 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 + name: Temperatur light.all_indirect: - name: Indirect + name: Indirekt light.all_direct: - name: Direct - light.all_lights: - name: All Lights - scene.light_alloff: - name: Lights Off - scene.light_blue: - name: Lights Blue + name: Direkt + script.light_store_off: + name: Licht aus + script.light_store_restore: + name: Licht an scene.light_adaptive: - name: Lights Adaptive + name: Licht Adaptiv scene.light_night: - name: Lights Night - switch.circadian_lighting_circadian_lighting: - name: Circadian - binary_sensor.mullvad_exit_ip: - name: Mullvad + name: Licht Nacht + switch.adaptive_lighting_default: + name: Adaptiv + switch.adaptive_lighting_sleep_mode_default: + name: Schlaf switch.server: name: Server switch.server_template: diff --git a/packages/light/adaptive.yaml b/packages/light/adaptive.yaml index 36e02e8..de0608d 100644 --- a/packages/light/adaptive.yaml +++ b/packages/light/adaptive.yaml @@ -9,7 +9,7 @@ adaptive_lighting: interval: 90 min_brightness: 1 max_brightness: 80 - min_color_temp: 2700 + min_color_temp: 2500 max_color_temp: 6500 sleep_brightness: 1 sleep_color_temp: 1000 diff --git a/packages/light/lightscenes.yaml b/packages/light/lightscenes.yaml index e58d968..8920883 100644 --- a/packages/light/lightscenes.yaml +++ b/packages/light/lightscenes.yaml @@ -22,10 +22,4 @@ scene: rgb_color: [255, 139, 21] state: true brightness: 1 - switch.adaptive_lighting_sleep_mode_default: on - - name: light_all_on - entities: - script.light_store_restore: on - - name: light_all_off - entities: - script.light_store_off: on \ No newline at end of file + switch.adaptive_lighting_sleep_mode_default: on \ No newline at end of file From f15ef84cceacc53fed90fe50d86bdf45ad8f7ede Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Wed, 3 Aug 2022 11:43:24 +0200 Subject: [PATCH 27/57] Template Sensor Logic fixes --- packages/climate/climate_sensors.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index 6d53612..8ad5e92 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -105,11 +105,11 @@ sensor: {% set temp_inside = states("sensor.temperature_kai_temperature")|float %} {% set temp_outside = states("sensor.temperature_outside_pirateweather")|float %} {% set inside_max = temp_inside + states("input_number.climate_temp_accuracy")|float %} - {% set inside_min = temp_inside - states("input_number.climate_temp_accuracy")|float %} - {% if temp_inside > target %} - {% if inside_max > temp_outside %} {{ "open window" }} {% endif %} + {% set accuracy = states("input_number.climate_temp_accuracy") |float %} + {% if temp_inside >= target and temp_inside >= (temp_outside - accuracy) %} + {{ "open window" }} {% else %} - {% if temp_inside < min %} {{ "close window" }} {% endif %} + {{ "close window" }} {% endif %} From 51ac800ef178d4cd19a61e424ca6fe1c924f2162 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Fri, 5 Aug 2022 09:29:17 +0000 Subject: [PATCH 28/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index f21b6d8..d578500 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,10 @@ # Homeassistant Config -## Hacs - -### Integrations - -- Circadian Lighting -- browser_mod -- UI Lovelace Minimalist - - -### Frontend - -- button-card -- Mini Media Player -- Simple Weather Card -- Light Entity Card -- auto-entities -- card-mod -- Sun Card -- mini-graph-card -- My Cards Bundle (https://github.com/AnthonMS/my-cards) - +# ## Todo - Climate control -- Temperature warnings/recommendations (inside vs outside) -- Light automations -- Push notifications \ No newline at end of file +- morning automations +- vacuum dashboard +- button_hold brightness \ No newline at end of file From 3933d3b42a4648ead8bd0883d95f3f23800b6c35 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Fri, 5 Aug 2022 09:29:43 +0000 Subject: [PATCH 29/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d578500..38d5ad5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Homeassistant Config -# - ## Todo - Climate control From ff7a978c6b8f2e5cab3490ad0ad726fb119b155f Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Fri, 5 Aug 2022 12:54:01 +0200 Subject: [PATCH 30/57] Pirateweather -> Accuweather for current weather --- lovelace/climate/recommendation.yaml | 4 +- lovelace/overview/climate.yaml | 10 +- lovelace/overview/welcome.yaml | 2 +- packages/button/automations.yaml | 116 ++++++++++++++++++ packages/button/dimming.yaml | 13 ++ packages/climate/climate_automation.yaml | 2 + packages/climate/climate_sensors.yaml | 2 +- packages/light/yeelight.yaml | 12 +- .../{pirate_weather.yaml => weather.yaml} | 4 +- 9 files changed, 146 insertions(+), 19 deletions(-) create mode 100644 packages/button/automations.yaml create mode 100644 packages/button/dimming.yaml rename packages/{pirate_weather.yaml => weather.yaml} (84%) diff --git a/lovelace/climate/recommendation.yaml b/lovelace/climate/recommendation.yaml index 64be368..981f995 100644 --- a/lovelace/climate/recommendation.yaml +++ b/lovelace/climate/recommendation.yaml @@ -14,7 +14,7 @@ ulm_card_generic_swap_name: inside - type: 'custom:button-card' template: card_generic_swap - entity: sensor.temperature_outside_pirateweather + entity: sensor.temperature_outside variables: ulm_card_generic_swap_name: outside - type: 'custom:button-card' @@ -34,7 +34,7 @@ group_by: func: avg duration: 30min - - entity: sensor.temperature_outside_pirateweather + - entity: sensor.temperature_outside type: column name: Outside group_by: diff --git a/lovelace/overview/climate.yaml b/lovelace/overview/climate.yaml index 7e0a473..1a970fe 100644 --- a/lovelace/overview/climate.yaml +++ b/lovelace/overview/climate.yaml @@ -3,10 +3,6 @@ # name: Climate -#- type: custom:simple-weather-card -# entity: weather.pirateweather - - - type: custom:apexcharts-card graph_span: 6h header: @@ -17,13 +13,13 @@ name: Inside group_by: func: avg - duration: 30min - - entity: sensor.temperature_outside_pirateweather + duration: 15min + - entity: sensor.temperature_outside type: column name: Outside group_by: func: avg - duration: 30min + duration: 15min - type: "horizontal-stack" diff --git a/lovelace/overview/welcome.yaml b/lovelace/overview/welcome.yaml index 13ddb83..301d2f7 100644 --- a/lovelace/overview/welcome.yaml +++ b/lovelace/overview/welcome.yaml @@ -9,7 +9,7 @@ entity: input_boolean.welcome_collapse variables: ulm_card_welcome_scenes_collapse: input_boolean.welcome_collapse - ulm_weather: weather.pirateweather + ulm_weather: weather.home entity_1: entity_id: scene.light_adaptive icon: "mdi:theme-light-dark" diff --git a/packages/button/automations.yaml b/packages/button/automations.yaml new file mode 100644 index 0000000..ffb3e87 --- /dev/null +++ b/packages/button/automations.yaml @@ -0,0 +1,116 @@ +automation: + - alias: button_on + trigger: + - platform: device + domain: mqtt + device_id: 121e4230e41feb19254fa92ed5335760 + type: action + subtype: 'on' + discovery_id: 0x2c1165fffebebf6d action_on + - platform: device + domain: mqtt + device_id: 4f9d195bf907da59e1461a5d2404f606 + type: action + subtype: "on" + discovery_id: 0x0c4314fffee0bb44 action_on + - platform: device + domain: mqtt + device_id: 5e67efdee83ccceaac84046dfc6c735e + type: action + subtype: "on" + discovery_id: 0x0c4314fffef68790 action_on + action: + - service: scene.turn_on + target: + entity_id: scene.light_adaptive + mode: single + + - alias: button_off + trigger: + - platform: device + domain: mqtt + device_id: 121e4230e41feb19254fa92ed5335760 + type: action + subtype: "on" + discovery_id: 0x2c1165fffebebf6d action_on + - platform: device + domain: mqtt + device_id: 4f9d195bf907da59e1461a5d2404f606 + type: action + subtype: "on" + discovery_id: 0x0c4314fffee0bb44 action_on + - platform: device + domain: mqtt + device_id: 5e67efdee83ccceaac84046dfc6c735e + type: action + subtype: "on" + discovery_id: 0x0c4314fffef68790 action_on + action: + - service: script.light_store_off + mode: single + + - alias: button_ceiling_on + trigger: + - platform: device + domain: mqtt + device_id: 4f9d195bf907da59e1461a5d2404f606 + type: action + subtype: arrow_left_click + discovery_id: 0x0c4314fffee0bb44 action_arrow_left_click + - platform: device + domain: mqtt + device_id: 5e67efdee83ccceaac84046dfc6c735e + type: action + subtype: arrow_left_click + discovery_id: 0x0c4314fffef68790 action_arrow_left_click + action: + - service: light.toggle + target: + entity_id: light.ceiling + mode: single + + - alias: button_ceiling_bed_on + trigger: + - platform: device + domain: mqtt + device_id: 4f9d195bf907da59e1461a5d2404f606 + type: action + subtype: arrow_right_click + discovery_id: 0x0c4314fffee0bb44 action_arrow_right_click + - platform: device + domain: mqtt + device_id: 5e67efdee83ccceaac84046dfc6c735e + type: action + subtype: arrow_right_click + discovery_id: 0x0c4314fffef68790 action_arrow_right_click + action: + - service: light.toggle + target: + device_id: 2f01ed8d8c56ffea9ab769ba3cf527d9 + mode: single + + - alias: button_sleep + trigger: + - platform: device + domain: mqtt + device_id: 121e4230e41feb19254fa92ed5335760 + type: action + subtype: "off" + discovery_id: 0x2c1165fffebebf6d action_off + - platform: device + domain: mqtt + device_id: 4f9d195bf907da59e1461a5d2404f606 + type: action + subtype: "off" + discovery_id: 0x0c4314fffee0bb44 action_off + - platform: device + domain: mqtt + device_id: 5e67efdee83ccceaac84046dfc6c735e + type: action + subtype: "off" + discovery_id: 0x0c4314fffef68790 action_off + action: + - service: switch.toggle + target: + entity_id: switch.adaptive_lighting_sleep_mode_default + mode: single \ No newline at end of file diff --git a/packages/button/dimming.yaml b/packages/button/dimming.yaml new file mode 100644 index 0000000..be3084a --- /dev/null +++ b/packages/button/dimming.yaml @@ -0,0 +1,13 @@ +# script: +# indirect_brightness_increase: +# sequence: +# - service: light.turn_on +# entity_id: light.indirect +# data_template: +# brightness: > +# {% set incr = 10 %} +# {% set current = (state_attr('light.indirect', 'brightness') | int) %} +# {% set new = current | int + incr %} +# {% if new > 255 %} 255 +# {% else %} {{ new_brightness }} +# {% endif %} \ No newline at end of file diff --git a/packages/climate/climate_automation.yaml b/packages/climate/climate_automation.yaml index 3be685e..011f620 100644 --- a/packages/climate/climate_automation.yaml +++ b/packages/climate/climate_automation.yaml @@ -6,6 +6,7 @@ automation: trigger: - platform: state entity_id: sensor.climate_temp_recommendation + from: 'open window' to: 'close window' action: - service: notify.notify @@ -15,6 +16,7 @@ automation: trigger: - platform: state entity_id: sensor.climate_temp_recommendation + from: 'close window' to: 'open window' action: - service: notify.notify diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index 8ad5e92..f12b0e6 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -103,7 +103,7 @@ sensor: {% 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_pirateweather")|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) %} diff --git a/packages/light/yeelight.yaml b/packages/light/yeelight.yaml index 9643372..e178057 100644 --- a/packages/light/yeelight.yaml +++ b/packages/light/yeelight.yaml @@ -19,28 +19,28 @@ yeelight: 10.10.10.82: name: ceiling1 save_on_change: False - transition: 1500 + transition: 1000 10.10.10.83: name: ceiling2 save_on_change: False - transition: 1500 + transition: 1000 10.10.10.80: name: ceiling3 save_on_change: False - transition: 1500 + transition: 1000 10.10.10.81: name: bed_ceiling save_on_change: False - transition: 1500 + transition: 1000 10.10.10.84: name: bed save_on_change: False - transition: 1500 + transition: 1000 model: strip1 10.10.10.85: name: desk save_on_change: False - transition: 1500 + transition: 1000 model: strip1 diff --git a/packages/pirate_weather.yaml b/packages/weather.yaml similarity index 84% rename from packages/pirate_weather.yaml rename to packages/weather.yaml index 582f1a2..58fe47b 100644 --- a/packages/pirate_weather.yaml +++ b/packages/weather.yaml @@ -18,7 +18,7 @@ sensor: - platform: template #api_key: !secret pirateweather sensors: - temperature_outside_pirateweather: - value_template: '{{ states.weather.pirateweather.attributes.temperature }}' + temperature_outside: + value_template: '{{ states.weather.home.attributes.temperature }}' friendly_name: 'Outside Temperature' unit_of_measurement: '°C' \ No newline at end of file From b8b822895aa11802da35dd56ebd369a38340eb64 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Fri, 5 Aug 2022 18:31:35 +0000 Subject: [PATCH 31/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 38d5ad5..cba43d1 100644 --- a/README.md +++ b/README.md @@ -4,5 +4,4 @@ - Climate control - morning automations -- vacuum dashboard - button_hold brightness \ No newline at end of file From 913acd53e2b8f27c57085805d04245433aedbd30 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Fri, 5 Aug 2022 18:38:04 +0000 Subject: [PATCH 32/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index cba43d1..2e1e780 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,19 @@ - Climate control - morning automations -- button_hold brightness \ No newline at end of file +- button_hold brightness + + +## Button Design +### Up + - Press: On/Restore || Off/Store + - Hold: Brightness Up +### Down + - Press: Sleep on || Sleep off + - Hold: Brightness Down +### Left + - Press: Ceiling on || Ceiling off + - Hold: +### Right + - Press: Ceiling_Bed on || Ceiling_Bed off + - Hold: \ No newline at end of file From b0a595997bc11a4d21bcd6244e9c3b04f9b114dc Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Fri, 5 Aug 2022 18:41:10 +0000 Subject: [PATCH 33/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2e1e780..c406a98 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ - Hold: Brightness Down ### Left - Press: Ceiling on || Ceiling off - - Hold: + - Hold: Indirect on || Indirect off ### Right - Press: Ceiling_Bed on || Ceiling_Bed off - Hold: \ No newline at end of file From 6b07c3b488c33ef1944ab8e5c6d00092f46f745f Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sun, 7 Aug 2022 11:05:28 +0000 Subject: [PATCH 34/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c406a98..e47c539 100644 --- a/README.md +++ b/README.md @@ -4,19 +4,38 @@ - Climate control - morning automations -- button_hold brightness ## Button Design -### Up - - Press: On/Restore || Off/Store - - Hold: Brightness Up -### Down - - Press: Sleep on || Sleep off - - Hold: Brightness Down -### Left - - Press: Ceiling on || Ceiling off - - Hold: Indirect on || Indirect off -### Right - - Press: Ceiling_Bed on || Ceiling_Bed off - - Hold: \ No newline at end of file + +### Functions +- Power on/off +- Brightness +- Scenes +- Individual Light Selection +- Adaptive & Sleep Mode + +### 4 Button + +#### 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 \ No newline at end of file From d7fedcd96b5077444350e4d8ef2fb1566f388692 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sun, 7 Aug 2022 20:10:43 +0200 Subject: [PATCH 35/57] Button Light Menu --- lovelace/overview/lights.yaml | 55 ++- lovelace/overview/welcome.yaml | 4 +- packages/button/button_inputs.yaml | 21 + packages/button/button_logic.yaml | 446 ++++++++++++++++++ .../{automations.yaml => button_press.yaml} | 116 ++--- packages/button/dimming.yaml | 13 - packages/homekit.yaml | 2 +- packages/light/lightscenes.yaml | 11 +- packages/light/lightstore.yaml | 44 +- packages/light/yeelight.yaml | 12 +- scripts.yaml | 1 + 11 files changed, 631 insertions(+), 94 deletions(-) create mode 100644 packages/button/button_inputs.yaml create mode 100644 packages/button/button_logic.yaml rename packages/button/{automations.yaml => button_press.yaml} (65%) delete mode 100644 packages/button/dimming.yaml create mode 100644 scripts.yaml diff --git a/lovelace/overview/lights.yaml b/lovelace/overview/lights.yaml index cdbcc69..3ef39c0 100644 --- a/lovelace/overview/lights.yaml +++ b/lovelace/overview/lights.yaml @@ -1,7 +1,60 @@ #- type: 'custom:button-card' # template: card_title # name: Lights +- 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 + +- type: 'custom:button-card' + template: card_generic + entity: timer.pos_timer - type: "horizontal-stack" cards: @@ -36,4 +89,4 @@ template: card_input_boolean entity: switch.adaptive_lighting_sleep_mode_default variables: - ulm_card_input_boolean_name: Sleep + ulm_card_input_boolean_name: Sleep \ No newline at end of file diff --git a/lovelace/overview/welcome.yaml b/lovelace/overview/welcome.yaml index 301d2f7..8cab316 100644 --- a/lovelace/overview/welcome.yaml +++ b/lovelace/overview/welcome.yaml @@ -17,10 +17,10 @@ name: "Adaptive" bg_color: "yellow" entity_2: - entity_id: scene.light_blue + entity_id: scene.light_bright icon: "mdi:television-play" icon_color: "blue" - name: "Blue" + name: "Bright" bg_color: "blue" entity_3: entity_id: "scene.light_night" diff --git a/packages/button/button_inputs.yaml b/packages/button/button_inputs.yaml new file mode 100644 index 0000000..6e9bc84 --- /dev/null +++ b/packages/button/button_inputs.yaml @@ -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" \ No newline at end of file diff --git a/packages/button/button_logic.yaml b/packages/button/button_logic.yaml new file mode 100644 index 0000000..937bf0a --- /dev/null +++ b/packages/button/button_logic.yaml @@ -0,0 +1,446 @@ +script: + #----------------------------------------------------------------------------------# + # L/R + #----------------------------------------------------------------------------------# + # 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: 0 + 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: 0 + 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/Down + #----------------------------------------------------------------------------------# + # 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: + - 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 + # 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 + # 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 + # 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 + # 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 + # 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 + # 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 + 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: + - 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 + # 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 + # 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 + # 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: script.light_ceiling_save + - delay: + hours: 0 + minutes: 0 + seconds: 0 + milliseconds: 500 + - service: light.turn_on + data: + effect: Twitter + target: + entity_id: light.ceiling + - delay: + hours: 0 + minutes: 0 + seconds: 1 + milliseconds: 0 + - service: script.light_ceiling_restore + # 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: script.light_ceiling_bed_save + - delay: + hours: 0 + minutes: 0 + seconds: 0 + milliseconds: 500 + - service: light.turn_on + data: + effect: Twitter + target: + entity_id: light.bed_ceiling + - delay: + hours: 0 + minutes: 0 + seconds: 1 + milliseconds: 0 + - service: script.light_ceiling_bed_restore + # 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: script.light_indirect_save + - delay: + hours: 0 + minutes: 0 + seconds: 0 + milliseconds: 500 + - service: light.turn_on + data: + effect: Twitter + target: + entity_id: light.all_indirect + - delay: + hours: 0 + minutes: 0 + seconds: 1 + milliseconds: 0 + - service: script.light_indirect_restore + # 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: script.light_store_save + - delay: + hours: 0 + minutes: 0 + seconds: 0 + milliseconds: 500 + - service: light.turn_on + data: + effect: Twitter + target: + entity_id: light.all_lights + - delay: + hours: 0 + minutes: 0 + seconds: 1 + milliseconds: 0 + - service: script.light_store_restore + # 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 + # 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 + # 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 \ No newline at end of file diff --git a/packages/button/automations.yaml b/packages/button/button_press.yaml similarity index 65% rename from packages/button/automations.yaml rename to packages/button/button_press.yaml index ffb3e87..622266f 100644 --- a/packages/button/automations.yaml +++ b/packages/button/button_press.yaml @@ -1,31 +1,51 @@ automation: - - alias: button_on + #----------------------------------------------------------------------------------# + # L/R + #----------------------------------------------------------------------------------# + # Button Left: Pos Left + - alias: button_pos_left trigger: - - platform: device - domain: mqtt - device_id: 121e4230e41feb19254fa92ed5335760 - type: action - subtype: 'on' - discovery_id: 0x2c1165fffebebf6d action_on - - platform: device - domain: mqtt - device_id: 4f9d195bf907da59e1461a5d2404f606 - type: action - subtype: "on" - discovery_id: 0x0c4314fffee0bb44 action_on - - platform: device - domain: mqtt - device_id: 5e67efdee83ccceaac84046dfc6c735e - type: action - subtype: "on" - discovery_id: 0x0c4314fffef68790 action_on + - platform: device + domain: mqtt + device_id: 4f9d195bf907da59e1461a5d2404f606 + type: action + subtype: arrow_left_click + discovery_id: 0x0c4314fffee0bb44 action_arrow_left_click + - platform: device + domain: mqtt + device_id: 5e67efdee83ccceaac84046dfc6c735e + type: action + subtype: arrow_left_click + discovery_id: 0x0c4314fffef68790 action_arrow_left_click action: - - service: scene.turn_on - target: - entity_id: scene.light_adaptive + - service: script.pos_left_incr mode: single - - alias: button_off + # Button Left: Pos Right + - alias: button_pos_right + trigger: + - platform: device + domain: mqtt + device_id: 4f9d195bf907da59e1461a5d2404f606 + type: action + subtype: arrow_right_click + discovery_id: 0x0c4314fffee0bb44 action_arrow_right_click + - 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: - platform: device domain: mqtt @@ -46,50 +66,10 @@ automation: subtype: "on" discovery_id: 0x0c4314fffef68790 action_on action: - - service: script.light_store_off + - service: script.pos_up mode: single - - - alias: button_ceiling_on - trigger: - - platform: device - domain: mqtt - device_id: 4f9d195bf907da59e1461a5d2404f606 - type: action - subtype: arrow_left_click - discovery_id: 0x0c4314fffee0bb44 action_arrow_left_click - - platform: device - domain: mqtt - device_id: 5e67efdee83ccceaac84046dfc6c735e - type: action - subtype: arrow_left_click - discovery_id: 0x0c4314fffef68790 action_arrow_left_click - action: - - service: light.toggle - target: - entity_id: light.ceiling - mode: single - - - alias: button_ceiling_bed_on - trigger: - - platform: device - domain: mqtt - device_id: 4f9d195bf907da59e1461a5d2404f606 - type: action - subtype: arrow_right_click - discovery_id: 0x0c4314fffee0bb44 action_arrow_right_click - - platform: device - domain: mqtt - device_id: 5e67efdee83ccceaac84046dfc6c735e - type: action - subtype: arrow_right_click - discovery_id: 0x0c4314fffef68790 action_arrow_right_click - action: - - service: light.toggle - target: - device_id: 2f01ed8d8c56ffea9ab769ba3cf527d9 - mode: single - - - alias: button_sleep + # Down + - alias: button_down trigger: - platform: device domain: mqtt @@ -110,7 +90,5 @@ automation: subtype: "off" discovery_id: 0x0c4314fffef68790 action_off action: - - service: switch.toggle - target: - entity_id: switch.adaptive_lighting_sleep_mode_default + - service: script.pos_down mode: single \ No newline at end of file diff --git a/packages/button/dimming.yaml b/packages/button/dimming.yaml deleted file mode 100644 index be3084a..0000000 --- a/packages/button/dimming.yaml +++ /dev/null @@ -1,13 +0,0 @@ -# script: -# indirect_brightness_increase: -# sequence: -# - service: light.turn_on -# entity_id: light.indirect -# data_template: -# brightness: > -# {% set incr = 10 %} -# {% set current = (state_attr('light.indirect', 'brightness') | int) %} -# {% set new = current | int + incr %} -# {% if new > 255 %} 255 -# {% else %} {{ new_brightness }} -# {% endif %} \ No newline at end of file diff --git a/packages/homekit.yaml b/packages/homekit.yaml index b11f9ba..bf521f7 100644 --- a/packages/homekit.yaml +++ b/packages/homekit.yaml @@ -1,5 +1,5 @@ homekit: - ip_address: 10.10.10.50 + ip_address: 10.10.20.50 filter: include_entities: diff --git a/packages/light/lightscenes.yaml b/packages/light/lightscenes.yaml index 8920883..db489c3 100644 --- a/packages/light/lightscenes.yaml +++ b/packages/light/lightscenes.yaml @@ -22,4 +22,13 @@ scene: rgb_color: [255, 139, 21] state: true brightness: 1 - switch.adaptive_lighting_sleep_mode_default: on \ No newline at end of file + 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 \ No newline at end of file diff --git a/packages/light/lightstore.yaml b/packages/light/lightstore.yaml index b93bdff..31a0f61 100644 --- a/packages/light/lightstore.yaml +++ b/packages/light/lightstore.yaml @@ -25,4 +25,46 @@ script: data: store_name: flash_store operation: restore - + + + light_ceiling_save: + sequence: + - service: python_script.light_store + data: + store_name: ceiling_store + entity_id: + - light.ceiling + light_ceiling_restore: + sequence: + - service: python_script.light_store + data: + store_name: ceiling_store + operation: restore + + light_ceiling_bed_save: + sequence: + - service: python_script.light_store + data: + store_name: ceiling_store + entity_id: + - light.bed_ceiling + light_ceiling_bed_restore: + sequence: + - service: python_script.light_store + data: + store_name: ceiling_store + operation: restore + + light_indirect_save: + sequence: + - service: python_script.light_store + data: + store_name: ceiling_store + entity_id: + - light.all_indirect + light_indirect_restore: + sequence: + - service: python_script.light_store + data: + store_name: ceiling_store + operation: restore \ No newline at end of file diff --git a/packages/light/yeelight.yaml b/packages/light/yeelight.yaml index e178057..3cca5ff 100644 --- a/packages/light/yeelight.yaml +++ b/packages/light/yeelight.yaml @@ -19,28 +19,28 @@ yeelight: 10.10.10.82: name: ceiling1 save_on_change: False - transition: 1000 + transition: 500 10.10.10.83: name: ceiling2 save_on_change: False - transition: 1000 + transition: 500 10.10.10.80: name: ceiling3 save_on_change: False - transition: 1000 + transition: 500 10.10.10.81: name: bed_ceiling save_on_change: False - transition: 1000 + transition: 500 10.10.10.84: name: bed save_on_change: False - transition: 1000 + transition: 500 model: strip1 10.10.10.85: name: desk save_on_change: False - transition: 1000 + transition: 500 model: strip1 diff --git a/scripts.yaml b/scripts.yaml new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/scripts.yaml @@ -0,0 +1 @@ + From f2f45782c5a9a84f829f5cea79103cc7b8e329ab Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sun, 7 Aug 2022 20:20:35 +0200 Subject: [PATCH 36/57] delete scripts folder --- scripts.yaml | 1 - 1 file changed, 1 deletion(-) delete mode 100644 scripts.yaml diff --git a/scripts.yaml b/scripts.yaml deleted file mode 100644 index 8b13789..0000000 --- a/scripts.yaml +++ /dev/null @@ -1 +0,0 @@ - From 6b1d46f915cf0e89ecc5d2ad44a21b861994dcd4 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sun, 7 Aug 2022 20:28:21 +0200 Subject: [PATCH 37/57] loop begin at start --- packages/button/button_logic.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/button/button_logic.yaml b/packages/button/button_logic.yaml index 937bf0a..66d1f73 100644 --- a/packages/button/button_logic.yaml +++ b/packages/button/button_logic.yaml @@ -24,7 +24,7 @@ script: then: - service: input_number.set_value data: - value: 0 + value: 1 target: entity_id: input_number.pos_left else: @@ -61,7 +61,7 @@ script: then: - service: input_number.set_value data: - value: 0 + value: 1 target: entity_id: input_number.pos_right else: From 47bf872514516a4a62ab2b5234abfaed6f89c070 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sun, 7 Aug 2022 20:32:29 +0200 Subject: [PATCH 38/57] Menu Control to Lights View --- lovelace/lights/lightmenu.yaml | 59 ++++++++++++++++++++++++++++++++++ lovelace/overview/lights.yaml | 55 ------------------------------- ui-lovelace.yaml | 4 +++ 3 files changed, 63 insertions(+), 55 deletions(-) create mode 100644 lovelace/lights/lightmenu.yaml diff --git a/lovelace/lights/lightmenu.yaml b/lovelace/lights/lightmenu.yaml new file mode 100644 index 0000000..86b2317 --- /dev/null +++ b/lovelace/lights/lightmenu.yaml @@ -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 \ No newline at end of file diff --git a/lovelace/overview/lights.yaml b/lovelace/overview/lights.yaml index 3ef39c0..2b36a66 100644 --- a/lovelace/overview/lights.yaml +++ b/lovelace/overview/lights.yaml @@ -1,61 +1,6 @@ #- type: 'custom:button-card' # template: card_title # name: Lights -- 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 - -- type: 'custom:button-card' - template: card_generic - entity: timer.pos_timer - - type: "horizontal-stack" cards: - type: 'custom:button-card' diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index d36a653..8dd6795 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -88,6 +88,10 @@ views: type: "vertical-stack" cards: !include lovelace/lights/lightstripes.yaml + - type: custom:vertical-layout + type: "vertical-stack" + cards: + !include lovelace/lights/lightmenu.yaml - type: custom:vertical-layout From f479b73b603a3c2dbf4441ae686bf1da75c0a774 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 8 Aug 2022 22:47:32 +0200 Subject: [PATCH 39/57] updates --- packages/light/night.yaml | 26 ++++++++++++++++++++++++++ packages/notifications.yaml | 6 ++++++ 2 files changed, 32 insertions(+) create mode 100644 packages/light/night.yaml create mode 100644 packages/notifications.yaml diff --git a/packages/light/night.yaml b/packages/light/night.yaml new file mode 100644 index 0000000..54ebb82 --- /dev/null +++ b/packages/light/night.yaml @@ -0,0 +1,26 @@ +input_boolean: + lights_needed: + name: Lights needed + initial: false + +automation: + - alias: lights_needed + mode: single + trigger: + - platform: time_pattern + minutes: "10" + action: + - if: + - condition: sun + before: sunrise + before_offset: "+01:00" + after: sunset + after_offset: "-01:00" + then: + - service: input_boolean.turn_on + target: + entity_id: input_boolean.lightsneeded + else: + - service: input_boolean.turn_off + target: + entity_id: input_boolean.lightsneeded \ No newline at end of file diff --git a/packages/notifications.yaml b/packages/notifications.yaml new file mode 100644 index 0000000..2d56b73 --- /dev/null +++ b/packages/notifications.yaml @@ -0,0 +1,6 @@ +notify: + - platform: html5 + name: browser + vapid_pub_key: !secret google_api_pub + vapid_prv_key: !secret google_api_priv + vapid_email: !secret google_api_email \ No newline at end of file From bd224ac15263f6c65d4fcbecbefec1c83ec3ef37 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 8 Aug 2022 22:49:12 +0200 Subject: [PATCH 40/57] name fix --- packages/light/night.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/light/night.yaml b/packages/light/night.yaml index 54ebb82..28ea7b2 100644 --- a/packages/light/night.yaml +++ b/packages/light/night.yaml @@ -19,8 +19,8 @@ automation: then: - service: input_boolean.turn_on target: - entity_id: input_boolean.lightsneeded + entity_id: input_boolean.lights_needed else: - service: input_boolean.turn_off target: - entity_id: input_boolean.lightsneeded \ No newline at end of file + entity_id: input_boolean.lights_needed \ No newline at end of file From a6b5f3714a1c7ab67d84ebbf2f636e4fe17a25d9 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 8 Aug 2022 23:30:39 +0200 Subject: [PATCH 41/57] fixes --- packages/light/night.yaml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/light/night.yaml b/packages/light/night.yaml index 28ea7b2..f7d1029 100644 --- a/packages/light/night.yaml +++ b/packages/light/night.yaml @@ -11,11 +11,12 @@ automation: minutes: "10" action: - if: - - condition: sun - before: sunrise - before_offset: "+01:00" - after: sunset - after_offset: "-01:00" + - condition: or + conditions: + - condition: sun + after: sunset + - condition: sun + before: sunrise then: - service: input_boolean.turn_on target: From a76437de5808a261f165d15a0e1e2d1a947ba4aa Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 8 Aug 2022 23:33:55 +0200 Subject: [PATCH 42/57] offset --- packages/light/night.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/light/night.yaml b/packages/light/night.yaml index f7d1029..31fc05d 100644 --- a/packages/light/night.yaml +++ b/packages/light/night.yaml @@ -15,8 +15,10 @@ automation: conditions: - condition: sun after: sunset + after_offset: "-01:00" - condition: sun before: sunrise + before_offset: "+01:00" then: - service: input_boolean.turn_on target: From 1f3c4e8b6ee05f6bd7c98cfbfc8bff5b02df0b0d Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 08:38:30 +0000 Subject: [PATCH 43/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index e47c539..b69870c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ ## Todo - Climate control -- morning automations +- morning automations (window, max temperature for the day) +- persistent notifcations (light reminder day, light reminder away) ## Button Design From e46c7eadab72592971065e9c7c98dcea575dec1c Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 11:21:13 +0200 Subject: [PATCH 44/57] Cleanup --- lovelace/lights/scenes.yaml | 28 +++++++++---------- lovelace/overview/batteries.yaml | 14 +--------- packages/button/button_logic.yaml | 10 ++++--- packages/button/button_press.yaml | 10 +++++++ packages/climate/climate_sensors.yaml | 12 +++----- packages/{ => climate}/weather.yaml | 0 packages/homeassistant/default_theme.yaml | 1 - packages/{ => homeassistant}/homekit.yaml | 0 .../{ => homeassistant}/notifications.yaml | 0 packages/{ => homeassistant}/time_date.yaml | 0 packages/light/circadian.yaml.disabled | 16 ----------- packages/light/lightstore.yaml | 13 ++++++++- packages/light/night.yaml | 2 ++ packages/light/yeelight.yaml | 13 ++------- packages/minimalist/custom_entities.yaml | 10 +------ packages/nas/wol.yaml | 2 -- ui-lovelace-testing.yaml | 14 ---------- ui-lovelace.yaml | 14 ++++++++-- 18 files changed, 65 insertions(+), 94 deletions(-) rename packages/{ => climate}/weather.yaml (100%) rename packages/{ => homeassistant}/homekit.yaml (100%) rename packages/{ => homeassistant}/notifications.yaml (100%) rename packages/{ => homeassistant}/time_date.yaml (100%) delete mode 100644 packages/light/circadian.yaml.disabled delete mode 100644 ui-lovelace-testing.yaml diff --git a/lovelace/lights/scenes.yaml b/lovelace/lights/scenes.yaml index e499229..254d31b 100644 --- a/lovelace/lights/scenes.yaml +++ b/lovelace/lights/scenes.yaml @@ -8,31 +8,31 @@ variables: entity_1: entity_id: scene.light_adaptive - icon: "mdi:YOUR_ICON" + icon: "mdi:theme-light-dark" icon_color: "yellow" - name: Adaptive + name: "Adaptive" bg_color: "yellow" entity_2: - entity_id: scene.light_blue - icon: "mdi:YOUR_ICON" + entity_id: scene.light_bright + icon: "mdi:television-play" icon_color: "blue" - name: Blue + name: "Bright" bg_color: "blue" entity_3: - entity_id: scene.light_night - icon: "mdi:YOUR_ICON" + entity_id: "scene.light_night" + icon: "mdi:weather-night" icon_color: "purple" - name: Night + name: "Night" bg_color: "purple" entity_4: - entity_id: script.light_store_restore - icon: "mdi:YOUR_ICON" + entity_id: "script.light_store_restore" + icon: "mdi:lightbulb-group" icon_color: "green" - name: All On + name: "All On" bg_color: "green" entity_5: - entity_id: script.light_store_off - icon: "mdi:YOUR_ICON" + entity_id: "script.light_store_off" + icon: "mdi:lightbulb-group-off-outline" icon_color: "red" - name: All Off + name: "All Off" bg_color: "red" \ No newline at end of file diff --git a/lovelace/overview/batteries.yaml b/lovelace/overview/batteries.yaml index 9f921a0..2fdf456 100644 --- a/lovelace/overview/batteries.yaml +++ b/lovelace/overview/batteries.yaml @@ -21,16 +21,4 @@ ulm_card_battery_charger_type_entity_id: sensor.ipad_battery_level ulm_card_battery_battery_level_danger: 30 ulm_card_battery_battery_level_warning: 80 - ulm_card_battery_name: iPad - - -# - type: "horizontal-stack" -# cards: -# - type: 'custom:button-card' -# template: card_battery -# entity: sensor.kais_apple_watch_battery_state -# variables: -# ulm_card_battery_charger_type_entity_id: sensor.kais_apple_watch_battery_state -# ulm_card_battery_battery_level_danger: 30 -# ulm_card_battery_battery_level_warning: 80 -# ulm_card_battery_name: Watch \ No newline at end of file + ulm_card_battery_name: iPad \ No newline at end of file diff --git a/packages/button/button_logic.yaml b/packages/button/button_logic.yaml index 66d1f73..f39c464 100644 --- a/packages/button/button_logic.yaml +++ b/packages/button/button_logic.yaml @@ -1,8 +1,7 @@ script: - #----------------------------------------------------------------------------------# - # L/R #----------------------------------------------------------------------------------# # Left + #----------------------------------------------------------------------------------# pos_left_incr: alias: pos_left_incr sequence: @@ -39,7 +38,9 @@ script: target: entity_id: timer.pos_timer mode: single + #----------------------------------------------------------------------------------# # Right + #----------------------------------------------------------------------------------# pos_right_incr: alias: pos_right_incr sequence: @@ -77,10 +78,9 @@ script: entity_id: timer.pos_timer mode: single - #----------------------------------------------------------------------------------# - # Up/Down #----------------------------------------------------------------------------------# # Up + #----------------------------------------------------------------------------------# pos_up: alias: pos_up sequence: @@ -169,7 +169,9 @@ script: target: entity_id: scene.light_bright mode: single + #----------------------------------------------------------------------------------# # Down + #----------------------------------------------------------------------------------# pos_down: alias: pos_down sequence: diff --git a/packages/button/button_press.yaml b/packages/button/button_press.yaml index 622266f..b0895c0 100644 --- a/packages/button/button_press.yaml +++ b/packages/button/button_press.yaml @@ -5,12 +5,14 @@ automation: # 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 @@ -24,12 +26,14 @@ automation: # 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 @@ -47,18 +51,21 @@ automation: # 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 @@ -71,18 +78,21 @@ automation: # 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 diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index f12b0e6..c93d4bc 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -1,9 +1,6 @@ -## -------------------------------------------------------------------------------------------------## -## Sensoren -## -------------------------------------------------------------------------------------------------## sensor: ## -----------------------------------------------------------------------------------------------## - ## Berechnung der Temperaturveränderung + ## Calculation of temperature change ## -----------------------------------------------------------------------------------------------## - platform: template sensors: @@ -16,7 +13,7 @@ sensor: {% if now == ("0.0"|float) %} {% set change = ("0.0"|float) %} {% endif %} {{ change | round(2) }} ## -----------------------------------------------------------------------------------------------## - ## Berechnung der aktuellen Zieltemperatur bzgl Morgen/Nacht, Automatik/Manuell + ## Calculation of the target temperature ## -----------------------------------------------------------------------------------------------## - platform: template sensors: @@ -71,7 +68,7 @@ sensor: ## -----------------------------------------------------------------------------------------------## - ## Unterer + Oberer Schwellwert + ## target min and max temperature ## -----------------------------------------------------------------------------------------------## - platform: template sensors: @@ -113,9 +110,8 @@ sensor: {% endif %} - ## -----------------------------------------------------------------------------------------------## - ## Differenz zu Ziel + ## difference to target ## -----------------------------------------------------------------------------------------------## - platform: template sensors: diff --git a/packages/weather.yaml b/packages/climate/weather.yaml similarity index 100% rename from packages/weather.yaml rename to packages/climate/weather.yaml diff --git a/packages/homeassistant/default_theme.yaml b/packages/homeassistant/default_theme.yaml index 844433e..a49d2d4 100644 --- a/packages/homeassistant/default_theme.yaml +++ b/packages/homeassistant/default_theme.yaml @@ -5,7 +5,6 @@ automation: trigger: - event: start platform: homeassistant - condition: [] action: - data: name: minimalist-desktop diff --git a/packages/homekit.yaml b/packages/homeassistant/homekit.yaml similarity index 100% rename from packages/homekit.yaml rename to packages/homeassistant/homekit.yaml diff --git a/packages/notifications.yaml b/packages/homeassistant/notifications.yaml similarity index 100% rename from packages/notifications.yaml rename to packages/homeassistant/notifications.yaml diff --git a/packages/time_date.yaml b/packages/homeassistant/time_date.yaml similarity index 100% rename from packages/time_date.yaml rename to packages/homeassistant/time_date.yaml diff --git a/packages/light/circadian.yaml.disabled b/packages/light/circadian.yaml.disabled deleted file mode 100644 index 2a1af2f..0000000 --- a/packages/light/circadian.yaml.disabled +++ /dev/null @@ -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 \ No newline at end of file diff --git a/packages/light/lightstore.yaml b/packages/light/lightstore.yaml index 31a0f61..1cc0305 100644 --- a/packages/light/lightstore.yaml +++ b/packages/light/lightstore.yaml @@ -3,6 +3,9 @@ ## https://github.com/pnbruckner/homeassistant-config/blob/master/python_scripts/light_store.py ## -------------------------------------------------------------------------------------------------## script: + #----------------------------------------------------------------------------------# + # All Lights + #----------------------------------------------------------------------------------# light_store_save: sequence: - service: python_script.light_store @@ -26,7 +29,9 @@ script: store_name: flash_store operation: restore - + #----------------------------------------------------------------------------------# + # Ceiling only + #----------------------------------------------------------------------------------# light_ceiling_save: sequence: - service: python_script.light_store @@ -41,6 +46,9 @@ script: store_name: ceiling_store operation: restore + #----------------------------------------------------------------------------------# + # Ceiling Bed only + #----------------------------------------------------------------------------------# light_ceiling_bed_save: sequence: - service: python_script.light_store @@ -55,6 +63,9 @@ script: store_name: ceiling_store operation: restore + #----------------------------------------------------------------------------------# + # Indirect only + #----------------------------------------------------------------------------------# light_indirect_save: sequence: - service: python_script.light_store diff --git a/packages/light/night.yaml b/packages/light/night.yaml index 31fc05d..144d65e 100644 --- a/packages/light/night.yaml +++ b/packages/light/night.yaml @@ -3,6 +3,7 @@ input_boolean: name: Lights needed initial: false + automation: - alias: lights_needed mode: single @@ -11,6 +12,7 @@ automation: minutes: "10" action: - if: + # Resets at midnight -> OR instead of AND - condition: or conditions: - condition: sun diff --git a/packages/light/yeelight.yaml b/packages/light/yeelight.yaml index 3cca5ff..4a491da 100644 --- a/packages/light/yeelight.yaml +++ b/packages/light/yeelight.yaml @@ -1,8 +1,3 @@ -## -------------------------------------------------------------------------------------------------## -## Yeelight -## -------------------------------------------------------------------------------------------------## - - ## -------------------------------------------------------------------------------------------------## ## Discovery disable ## -------------------------------------------------------------------------------------------------## @@ -12,7 +7,7 @@ discovery: ## -------------------------------------------------------------------------------------------------## -## Lampen-Konfig +## Lights ## -------------------------------------------------------------------------------------------------## yeelight: devices: @@ -45,7 +40,7 @@ yeelight: ## -------------------------------------------------------------------------------------------------## -## Lampengruppen +## Light Groups ## -------------------------------------------------------------------------------------------------## light: - platform: group @@ -78,6 +73,4 @@ light: name: all_lights entities: - light.all_direct - - light.all_indirect - - + - light.all_indirect \ No newline at end of file diff --git a/packages/minimalist/custom_entities.yaml b/packages/minimalist/custom_entities.yaml index c273303..75b321b 100644 --- a/packages/minimalist/custom_entities.yaml +++ b/packages/minimalist/custom_entities.yaml @@ -1,11 +1,3 @@ input_boolean: welcome_collapse: - name: welcome_collapse - - -input_select: - minimalist_ui_switch: - name: Select popup/view - options: - - light.all_indirect - - light.all_direct \ No newline at end of file + name: welcome_collapse \ No newline at end of file diff --git a/packages/nas/wol.yaml b/packages/nas/wol.yaml index b4c0609..b6a8a09 100644 --- a/packages/nas/wol.yaml +++ b/packages/nas/wol.yaml @@ -3,13 +3,11 @@ ## -------------------------------------------------------------------------------------------------## wake_on_lan: - switch: - platform: wake_on_lan mac: 54:04:A6:BF:1E:43 name: Server host: ip.wnsrt.de -#switch: - platform: template switches: server_template: diff --git a/ui-lovelace-testing.yaml b/ui-lovelace-testing.yaml deleted file mode 100644 index 68e13bd..0000000 --- a/ui-lovelace-testing.yaml +++ /dev/null @@ -1,14 +0,0 @@ ---- -button_card_templates: !include_dir_merge_named "custom_components/ui_lovelace_minimalist/__ui_minimalist__/ulm_templates/" - - -title: "Testing" -theme: "minimalist-desktop" -background: "var(--background-image)" - - -swipe_nav: - wrap: true - animate: swipe - prevent_default: true - swipe_amount: 30 \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 8dd6795..f16a2a0 100644 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -15,6 +15,9 @@ swipe_nav: views: + #----------------------------------------------------------------------------------# + # Dashboard + #----------------------------------------------------------------------------------# - type: custom:vertical-layout title: "Overview" path: 0 @@ -61,6 +64,9 @@ views: cards: !include lovelace/overview/vacuum.yaml + #----------------------------------------------------------------------------------# + # Lights + #----------------------------------------------------------------------------------# - type: custom:vertical-layout title: "Lights" path: 1 @@ -93,7 +99,9 @@ views: cards: !include lovelace/lights/lightmenu.yaml - + #----------------------------------------------------------------------------------# + # pfSense + #----------------------------------------------------------------------------------# - type: custom:vertical-layout title: "pfSense" path: 2 @@ -122,7 +130,9 @@ views: cards: !include lovelace/pfsense/traffic.yaml - + #----------------------------------------------------------------------------------# + # Climate + #----------------------------------------------------------------------------------# - type: custom:vertical-layout title: "Climate" path: 3 From 2a8c96e33644b4e83f037a46a96031e903aef554 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 12:49:58 +0200 Subject: [PATCH 45/57] Actionable Notification --- packages/light/light_notifications.yaml | 39 +++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/light/light_notifications.yaml diff --git a/packages/light/light_notifications.yaml b/packages/light/light_notifications.yaml new file mode 100644 index 0000000..7af664c --- /dev/null +++ b/packages/light/light_notifications.yaml @@ -0,0 +1,39 @@ +automation: + - alias: light_still_on_notification + mode: single + trigger: + - platform: state + entity_id: + - light.all_lights + from: "off" + 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: "LIGHT_TURN_OFF" + title: Turn them off + - alias: light_still_on_notification_event + trigger: + - platform: event + event_type: mobile_app_notification_action + event_data: + action: "LIGHT_TURN_OFF" + action: + - service: light.turn_off + target: + entity_id: light.all_lights \ No newline at end of file From 30c91d7e0d3490fb35e87c80a9cf6ee600108835 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 13:18:48 +0200 Subject: [PATCH 46/57] add symbol --- packages/light/light_notifications.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/light/light_notifications.yaml b/packages/light/light_notifications.yaml index 7af664c..448f75f 100644 --- a/packages/light/light_notifications.yaml +++ b/packages/light/light_notifications.yaml @@ -27,6 +27,7 @@ automation: actions: - action: "LIGHT_TURN_OFF" title: Turn them off + icon: "sfsymbols:lightbulb" - alias: light_still_on_notification_event trigger: - platform: event From c803b91fea1239e705b6204f6163d71e24ac4d71 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 15:12:46 +0200 Subject: [PATCH 47/57] device tracker network --- packages/light/light_notifications.yaml | 34 ++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/packages/light/light_notifications.yaml b/packages/light/light_notifications.yaml index 448f75f..1ecff3b 100644 --- a/packages/light/light_notifications.yaml +++ b/packages/light/light_notifications.yaml @@ -1,11 +1,10 @@ automation: - - alias: light_still_on_notification + - alias: light_still_on_still_needed_notify mode: single trigger: - platform: state entity_id: - light.all_lights - from: "off" to: "on" for: hours: 0 @@ -25,15 +24,42 @@ automation: message: "Lights are still on." data: actions: - - action: "LIGHT_TURN_OFF" + - 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: "LIGHT_TURN_OFF" + action: "LIGHTTURNOFF" action: - service: light.turn_off target: From a05dfeb7cefffe946d849ee0cebcc556cfe3d8d7 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 17:53:10 +0200 Subject: [PATCH 48/57] summary notification --- packages/homeassistant/notifications.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/homeassistant/notifications.yaml b/packages/homeassistant/notifications.yaml index 2d56b73..0e901cc 100644 --- a/packages/homeassistant/notifications.yaml +++ b/packages/homeassistant/notifications.yaml @@ -3,4 +3,6 @@ notify: name: browser vapid_pub_key: !secret google_api_pub vapid_prv_key: !secret google_api_priv - vapid_email: !secret google_api_email \ No newline at end of file + vapid_email: !secret google_api_email + + From 98d916c4ed616603de2d1e57e99d175708d9d049 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 17:53:26 +0200 Subject: [PATCH 49/57] summary notification --- packages/climate/climate_automation.yaml | 8 ++++---- packages/climate/climate_sensors.yaml | 4 ++-- packages/climate/weather.yaml | 17 +++++++++++++++-- .../homeassistant/notification_summary.yaml | 15 +++++++++++++++ 4 files changed, 36 insertions(+), 8 deletions(-) create mode 100644 packages/homeassistant/notification_summary.yaml diff --git a/packages/climate/climate_automation.yaml b/packages/climate/climate_automation.yaml index 011f620..f09dc90 100644 --- a/packages/climate/climate_automation.yaml +++ b/packages/climate/climate_automation.yaml @@ -6,8 +6,8 @@ automation: trigger: - platform: state entity_id: sensor.climate_temp_recommendation - from: 'open window' - to: 'close window' + from: 'open the window' + to: 'close the window' action: - service: notify.notify data: @@ -16,8 +16,8 @@ automation: trigger: - platform: state entity_id: sensor.climate_temp_recommendation - from: 'close window' - to: 'open window' + from: 'close the window' + to: 'open the window' action: - service: notify.notify data: diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index c93d4bc..8dd571b 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -104,9 +104,9 @@ sensor: {% 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 window" }} + {{ "open the window" }} {% else %} - {{ "close window" }} + {{ "close the window" }} {% endif %} diff --git a/packages/climate/weather.yaml b/packages/climate/weather.yaml index 58fe47b..ad8841d 100644 --- a/packages/climate/weather.yaml +++ b/packages/climate/weather.yaml @@ -16,9 +16,22 @@ sun: sensor: - platform: template - #api_key: !secret pirateweather sensors: temperature_outside: value_template: '{{ states.weather.home.attributes.temperature }}' friendly_name: 'Outside Temperature' - unit_of_measurement: '°C' \ No newline at end of file + unit_of_measurement: '°C' + temperature_today_max: + value_template: > + {{ state_attr('weather.pirateweather', 'forecast')[0].temperature }} + friendly_name: 'Max Temperature' + unit_of_measurement: '°C' + temperature_today_min: + value_template: > + {{ state_attr("weather.pirateweather", "forecast")[0].templow }} + friendly_name: 'Min Temperature' + unit_of_measurement: '°C' + temperature_today_condition: + value_template: > + {{ state_attr('weather.pirateweather', 'forecast')[0].condition }} + friendly_name: 'Condition' \ No newline at end of file diff --git a/packages/homeassistant/notification_summary.yaml b/packages/homeassistant/notification_summary.yaml new file mode 100644 index 0000000..46aba39 --- /dev/null +++ b/packages/homeassistant/notification_summary.yaml @@ -0,0 +1,15 @@ +script: + summary_notification: + sequence: + - service: notify.notify + data: + message: > + {% set maxTemp = states("sensor.temperature_today_max") %} + {% set minTemp = states("sensor.temperature_today_min") %} + {% set condition = states("sensor.temperature_today_condition") %} + {% set currentTemp = states("sensor.temperature_outside") %} + {% set recommendation = states("sensor.climate_temp_recommendation") %} + At the moment it is {{ condition }} outside with a temperature of {{ currentTemp }}°C. + Todays temperature will be between {{ maxTemp }}°C and {{ minTemp }}°C. + It is recommended to {{ recommendation }}. + mode: single \ No newline at end of file From 776d3871b5fe82bdc86cb96716ede22e6c91870f Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 18:01:56 +0200 Subject: [PATCH 50/57] inside temp --- packages/homeassistant/notification_summary.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/homeassistant/notification_summary.yaml b/packages/homeassistant/notification_summary.yaml index 46aba39..deff139 100644 --- a/packages/homeassistant/notification_summary.yaml +++ b/packages/homeassistant/notification_summary.yaml @@ -9,7 +9,8 @@ script: {% 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 temperature will be between {{ maxTemp }}°C and {{ minTemp }}°C. - It is recommended to {{ recommendation }}. + It is {{ insideTemp }} inside and recommended to {{ recommendation }}. mode: single \ No newline at end of file From bcda1606905528a4f9c5a08deeff6e1876e63a04 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 18:30:51 +0200 Subject: [PATCH 51/57] summary when entity is already in same state --- packages/button/button_logic.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/button/button_logic.yaml b/packages/button/button_logic.yaml index f39c464..540e0e5 100644 --- a/packages/button/button_logic.yaml +++ b/packages/button/button_logic.yaml @@ -95,6 +95,13 @@ script: 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 - service: light.turn_on target: entity_id: light.all_lights @@ -186,6 +193,13 @@ script: 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 - service: light.turn_off target: entity_id: light.all_lights From cc620be332b9c4f0e22b896bd13330c1caf47171 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Tue, 9 Aug 2022 22:27:38 +0200 Subject: [PATCH 52/57] save lights before turn off --- packages/button/button_logic.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/button/button_logic.yaml b/packages/button/button_logic.yaml index 540e0e5..4d3dc30 100644 --- a/packages/button/button_logic.yaml +++ b/packages/button/button_logic.yaml @@ -175,6 +175,13 @@ script: - service: scene.turn_on target: entity_id: scene.light_bright + - delay: + hours: 0 + minutes: 0 + seconds: 2 + milliseconds: 0 + - service: script.light_store_save + mode: single #----------------------------------------------------------------------------------# # Down @@ -182,6 +189,7 @@ script: pos_down: alias: pos_down sequence: + - service: script.light_store_save # 0,0 - if: - condition: and From 4390be9d7288041bcb5716292001c634f2b7d976 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Thu, 11 Aug 2022 21:07:23 +0200 Subject: [PATCH 53/57] Updates --- packages/button/button_logic.yaml | 118 ++++++++++------- packages/climate/weather.yaml | 26 ++-- packages/homeassistant/homeassistant.yaml | 1 - .../homeassistant/notification_summary.yaml | 5 +- packages/homeassistant/notifications.yaml | 4 +- .../{adaptive.yaml => light_adaptive.yaml} | 0 ...night.yaml => light_night_automation.yaml} | 0 .../{lightscenes.yaml => light_scenes.yaml} | 0 packages/light/light_snapshot.yaml | 20 +++ packages/light/lightstore.yaml | 81 ------------ python_scripts/light_store.py | 119 ------------------ 11 files changed, 106 insertions(+), 268 deletions(-) rename packages/light/{adaptive.yaml => light_adaptive.yaml} (100%) rename packages/light/{night.yaml => light_night_automation.yaml} (100%) rename packages/light/{lightscenes.yaml => light_scenes.yaml} (100%) create mode 100644 packages/light/light_snapshot.yaml delete mode 100644 packages/light/lightstore.yaml delete mode 100644 python_scripts/light_store.py diff --git a/packages/button/button_logic.yaml b/packages/button/button_logic.yaml index 4d3dc30..fdc266d 100644 --- a/packages/button/button_logic.yaml +++ b/packages/button/button_logic.yaml @@ -102,9 +102,13 @@ script: state: "on" then: - service: script.summary_notification - - service: light.turn_on - target: - entity_id: light.all_lights + 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: @@ -115,6 +119,9 @@ script: - service: light.turn_on target: entity_id: light.ceiling + - service: automation.trigger + target: + entity_id: automation.light_all_snapshot # 2,0 Bed - if: - condition: @@ -125,6 +132,9 @@ script: - 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: @@ -135,6 +145,9 @@ script: - 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: @@ -145,6 +158,9 @@ script: - 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: @@ -155,6 +171,9 @@ script: - 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: @@ -165,6 +184,9 @@ script: - 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: @@ -175,13 +197,9 @@ script: - service: scene.turn_on target: entity_id: scene.light_bright - - delay: - hours: 0 - minutes: 0 - seconds: 2 - milliseconds: 0 - - service: script.light_store_save - + - service: automation.trigger + target: + entity_id: automation.light_all_snapshot mode: single #----------------------------------------------------------------------------------# # Down @@ -189,7 +207,6 @@ script: pos_down: alias: pos_down sequence: - - service: script.light_store_save # 0,0 - if: - condition: and @@ -208,9 +225,10 @@ script: state: "off" then: - service: script.summary_notification - - service: light.turn_off - target: - entity_id: light.all_lights + else: + - service: light.turn_off + target: + entity_id: light.all_lights # 1,0 Ceiling - if: - condition: @@ -221,6 +239,9 @@ script: - service: light.turn_off target: entity_id: light.ceiling + - service: automation.trigger + target: + entity_id: automation.light_all_snapshot # 2,0 Bed - if: - condition: @@ -231,6 +252,9 @@ script: - 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: @@ -241,6 +265,9 @@ script: - 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: @@ -337,12 +364,9 @@ automation: - input_number.pos_left to: "1.0" action: - - service: script.light_ceiling_save - - delay: - hours: 0 - minutes: 0 - seconds: 0 - milliseconds: 500 + - service: automation.trigger + target: + entity_id: automation.light_all_snapshot - service: light.turn_on data: effect: Twitter @@ -353,7 +377,9 @@ automation: minutes: 0 seconds: 1 milliseconds: 0 - - service: script.light_ceiling_restore + - service: scene.turn_on + target: + entity_id: scene.snapshot_all # Pos 2,0 Ceiling Bed - alias: pos_2_0_flash mode: single @@ -363,12 +389,9 @@ automation: - input_number.pos_left to: "2.0" action: - - service: script.light_ceiling_bed_save - - delay: - hours: 0 - minutes: 0 - seconds: 0 - milliseconds: 500 + - service: automation.trigger + target: + entity_id: automation.light_all_snapshot - service: light.turn_on data: effect: Twitter @@ -379,7 +402,9 @@ automation: minutes: 0 seconds: 1 milliseconds: 0 - - service: script.light_ceiling_bed_restore + - service: scene.turn_on + target: + entity_id: scene.snapshot_all # Pos 3,0 Indirect - alias: pos_3_0_flash mode: single @@ -389,12 +414,9 @@ automation: - input_number.pos_left to: "3.0" action: - - service: script.light_indirect_save - - delay: - hours: 0 - minutes: 0 - seconds: 0 - milliseconds: 500 + - service: automation.trigger + target: + entity_id: automation.light_all_snapshot - service: light.turn_on data: effect: Twitter @@ -405,7 +427,9 @@ automation: minutes: 0 seconds: 1 milliseconds: 0 - - service: script.light_indirect_restore + - service: scene.turn_on + target: + entity_id: scene.snapshot_all # Pos 4,0 All Lights - alias: pos_4_0_flash mode: single @@ -415,12 +439,9 @@ automation: - input_number.pos_left to: "4.0" action: - - service: script.light_store_save - - delay: - hours: 0 - minutes: 0 - seconds: 0 - milliseconds: 500 + - service: automation.trigger + target: + entity_id: automation.light_all_snapshot - service: light.turn_on data: effect: Twitter @@ -431,7 +452,9 @@ automation: minutes: 0 seconds: 1 milliseconds: 0 - - service: script.light_store_restore + - service: scene.turn_on + target: + entity_id: scene.snapshot_all # Pos 0,1 Adaptive - alias: pos_0_1_flash mode: single @@ -444,6 +467,9 @@ automation: - 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 @@ -456,6 +482,9 @@ automation: - 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 @@ -467,4 +496,7 @@ automation: action: - service: scene.turn_on target: - entity_id: scene.light_bright \ No newline at end of file + entity_id: scene.light_bright + - service: automation.trigger + target: + entity_id: automation.light_all_snapshot \ No newline at end of file diff --git a/packages/climate/weather.yaml b/packages/climate/weather.yaml index ad8841d..9d6df1c 100644 --- a/packages/climate/weather.yaml +++ b/packages/climate/weather.yaml @@ -6,32 +6,22 @@ ## -------------------------------------------------------------------------------------------------## ## Wetter-Plattform ## -------------------------------------------------------------------------------------------------## -weather: - - platform: pirateweather - api_key: !secret pirateweather - mode: daily - -sun: - - sensor: - platform: template sensors: temperature_outside: - value_template: '{{ states.weather.home.attributes.temperature }}' + value_template: '{{ states.weather.openweathermap.attributes.temperature }}' friendly_name: 'Outside Temperature' unit_of_measurement: '°C' - temperature_today_max: + temperature_today: value_template: > - {{ state_attr('weather.pirateweather', 'forecast')[0].temperature }} + {{ state_attr('weather.home', 'forecast')[0].temperature }} friendly_name: 'Max Temperature' unit_of_measurement: '°C' - temperature_today_min: - value_template: > - {{ state_attr("weather.pirateweather", "forecast")[0].templow }} - friendly_name: 'Min Temperature' - unit_of_measurement: '°C' temperature_today_condition: value_template: > - {{ state_attr('weather.pirateweather', 'forecast')[0].condition }} - friendly_name: 'Condition' \ No newline at end of file + {{ state_attr('weather.home', 'forecast')[0].condition }} + friendly_name: 'Condition' + + +sun: \ No newline at end of file diff --git a/packages/homeassistant/homeassistant.yaml b/packages/homeassistant/homeassistant.yaml index a36ac90..36b02f2 100644 --- a/packages/homeassistant/homeassistant.yaml +++ b/packages/homeassistant/homeassistant.yaml @@ -39,7 +39,6 @@ history: map: mobile_app: person: -python_script: ssdp: system_health: timer: diff --git a/packages/homeassistant/notification_summary.yaml b/packages/homeassistant/notification_summary.yaml index deff139..2ffdbd7 100644 --- a/packages/homeassistant/notification_summary.yaml +++ b/packages/homeassistant/notification_summary.yaml @@ -4,13 +4,12 @@ script: - service: notify.notify data: message: > - {% set maxTemp = states("sensor.temperature_today_max") %} - {% set minTemp = states("sensor.temperature_today_min") %} + {% 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 temperature will be between {{ maxTemp }}°C and {{ minTemp }}°C. + Todays max temperature will be {{ maxTemp }}°C. It is {{ insideTemp }} inside and recommended to {{ recommendation }}. mode: single \ No newline at end of file diff --git a/packages/homeassistant/notifications.yaml b/packages/homeassistant/notifications.yaml index 0e901cc..2d56b73 100644 --- a/packages/homeassistant/notifications.yaml +++ b/packages/homeassistant/notifications.yaml @@ -3,6 +3,4 @@ notify: name: browser vapid_pub_key: !secret google_api_pub vapid_prv_key: !secret google_api_priv - vapid_email: !secret google_api_email - - + vapid_email: !secret google_api_email \ No newline at end of file diff --git a/packages/light/adaptive.yaml b/packages/light/light_adaptive.yaml similarity index 100% rename from packages/light/adaptive.yaml rename to packages/light/light_adaptive.yaml diff --git a/packages/light/night.yaml b/packages/light/light_night_automation.yaml similarity index 100% rename from packages/light/night.yaml rename to packages/light/light_night_automation.yaml diff --git a/packages/light/lightscenes.yaml b/packages/light/light_scenes.yaml similarity index 100% rename from packages/light/lightscenes.yaml rename to packages/light/light_scenes.yaml diff --git a/packages/light/light_snapshot.yaml b/packages/light/light_snapshot.yaml new file mode 100644 index 0000000..46af745 --- /dev/null +++ b/packages/light/light_snapshot.yaml @@ -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 \ No newline at end of file diff --git a/packages/light/lightstore.yaml b/packages/light/lightstore.yaml deleted file mode 100644 index 1cc0305..0000000 --- a/packages/light/lightstore.yaml +++ /dev/null @@ -1,81 +0,0 @@ -## -------------------------------------------------------------------------------------------------## -## Light_Store -## https://github.com/pnbruckner/homeassistant-config/blob/master/python_scripts/light_store.py -## -------------------------------------------------------------------------------------------------## -script: - #----------------------------------------------------------------------------------# - # All Lights - #----------------------------------------------------------------------------------# - light_store_save: - sequence: - - service: python_script.light_store - data: - store_name: flash_store - entity_id: - - light.bed - - light.ceiling - - light.desk - - light.bed_ceiling - - 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 - - #----------------------------------------------------------------------------------# - # Ceiling only - #----------------------------------------------------------------------------------# - light_ceiling_save: - sequence: - - service: python_script.light_store - data: - store_name: ceiling_store - entity_id: - - light.ceiling - light_ceiling_restore: - sequence: - - service: python_script.light_store - data: - store_name: ceiling_store - operation: restore - - #----------------------------------------------------------------------------------# - # Ceiling Bed only - #----------------------------------------------------------------------------------# - light_ceiling_bed_save: - sequence: - - service: python_script.light_store - data: - store_name: ceiling_store - entity_id: - - light.bed_ceiling - light_ceiling_bed_restore: - sequence: - - service: python_script.light_store - data: - store_name: ceiling_store - operation: restore - - #----------------------------------------------------------------------------------# - # Indirect only - #----------------------------------------------------------------------------------# - light_indirect_save: - sequence: - - service: python_script.light_store - data: - store_name: ceiling_store - entity_id: - - light.all_indirect - light_indirect_restore: - sequence: - - service: python_script.light_store - data: - store_name: ceiling_store - operation: restore \ No newline at end of file diff --git a/python_scripts/light_store.py b/python_scripts/light_store.py deleted file mode 100644 index 1340bb2..0000000 --- a/python_scripts/light_store.py +++ /dev/null @@ -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) \ No newline at end of file From deab38d90483a7c80d64436aa086b1a872adde60 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Thu, 11 Aug 2022 23:03:59 +0200 Subject: [PATCH 54/57] minor delay fixes + disable adaptive while switching --- packages/button/button_logic.yaml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/button/button_logic.yaml b/packages/button/button_logic.yaml index fdc266d..3cbf2b1 100644 --- a/packages/button/button_logic.yaml +++ b/packages/button/button_logic.yaml @@ -367,6 +367,9 @@ automation: - 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 @@ -376,7 +379,7 @@ automation: hours: 0 minutes: 0 seconds: 1 - milliseconds: 0 + milliseconds: 500 - service: scene.turn_on target: entity_id: scene.snapshot_all @@ -392,6 +395,9 @@ automation: - 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 @@ -401,7 +407,7 @@ automation: hours: 0 minutes: 0 seconds: 1 - milliseconds: 0 + milliseconds: 500 - service: scene.turn_on target: entity_id: scene.snapshot_all @@ -417,6 +423,9 @@ automation: - 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 @@ -426,7 +435,7 @@ automation: hours: 0 minutes: 0 seconds: 1 - milliseconds: 0 + milliseconds: 500 - service: scene.turn_on target: entity_id: scene.snapshot_all @@ -442,6 +451,9 @@ automation: - 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 @@ -451,7 +463,7 @@ automation: hours: 0 minutes: 0 seconds: 1 - milliseconds: 0 + milliseconds: 500 - service: scene.turn_on target: entity_id: scene.snapshot_all From 75dc47bc467d0f2a60bc58371beffd99ad6be1e0 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 15 Aug 2022 00:58:43 +0200 Subject: [PATCH 55/57] Updates --- lovelace/overview/climate.yaml | 31 +++++++++++++++++++++++-- packages/climate/climate_feelslike.yaml | 24 +++++++++++++++++++ packages/climate/climate_sensors.yaml | 11 +++++++++ packages/climate/weather.yaml | 1 - packages/homeassistant/logbook.yaml | 12 ++++++++++ 5 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 packages/climate/climate_feelslike.yaml create mode 100644 packages/homeassistant/logbook.yaml diff --git a/lovelace/overview/climate.yaml b/lovelace/overview/climate.yaml index 1a970fe..35eca39 100644 --- a/lovelace/overview/climate.yaml +++ b/lovelace/overview/climate.yaml @@ -22,6 +22,33 @@ 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' @@ -37,5 +64,5 @@ ulm_card_generic_name: Pressure -- type: custom:weather-card - entity: weather.pirateweather \ No newline at end of file +- type: weather-forecast + entity: weather.home \ No newline at end of file diff --git a/packages/climate/climate_feelslike.yaml b/packages/climate/climate_feelslike.yaml new file mode 100644 index 0000000..2a04a70 --- /dev/null +++ b/packages/climate/climate_feelslike.yaml @@ -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 \ No newline at end of file diff --git a/packages/climate/climate_sensors.yaml b/packages/climate/climate_sensors.yaml index 8dd571b..d86463d 100644 --- a/packages/climate/climate_sensors.yaml +++ b/packages/climate/climate_sensors.yaml @@ -124,6 +124,17 @@ sensor: {{ (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' ## -----------------------------------------------------------------------------------------------## diff --git a/packages/climate/weather.yaml b/packages/climate/weather.yaml index 9d6df1c..371942d 100644 --- a/packages/climate/weather.yaml +++ b/packages/climate/weather.yaml @@ -23,5 +23,4 @@ sensor: {{ state_attr('weather.home', 'forecast')[0].condition }} friendly_name: 'Condition' - sun: \ No newline at end of file diff --git a/packages/homeassistant/logbook.yaml b/packages/homeassistant/logbook.yaml new file mode 100644 index 0000000..5f6de40 --- /dev/null +++ b/packages/homeassistant/logbook.yaml @@ -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_* \ No newline at end of file From fc5cf539827ddc0cc4b6b4074a8a9634c79e069f Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Sun, 14 Aug 2022 23:30:45 +0000 Subject: [PATCH 56/57] =?UTF-8?q?=E2=80=9EREADME.md=E2=80=9C=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index b69870c..a78e108 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ ## Todo - Climate control -- morning automations (window, max temperature for the day) -- persistent notifcations (light reminder day, light reminder away) ## Button Design From 5a4d3be4d68f388eef5dd26f7dee043babf7ef78 Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Mon, 15 Aug 2022 14:04:23 +0200 Subject: [PATCH 57/57] minor fix --- packages/homeassistant/notification_summary.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/homeassistant/notification_summary.yaml b/packages/homeassistant/notification_summary.yaml index 2ffdbd7..9088604 100644 --- a/packages/homeassistant/notification_summary.yaml +++ b/packages/homeassistant/notification_summary.yaml @@ -11,5 +11,5 @@ script: {% 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 }} inside and recommended to {{ recommendation }}. + It is {{ insideTemp }}°C inside and recommended to {{ recommendation }}. mode: single \ No newline at end of file