From ff7a978c6b8f2e5cab3490ad0ad726fb119b155f Mon Sep 17 00:00:00 2001 From: darthsandmann Date: Fri, 5 Aug 2022 12:54:01 +0200 Subject: [PATCH] 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