From 9f99de450970d28c2033b91ff2061a3a75e9cf12 Mon Sep 17 00:00:00 2001 From: Philipp Hansen Date: Fri, 12 Aug 2022 11:08:44 +0200 Subject: [PATCH] Add Mailbox Automations --- configuration.yaml | 0 lovelace/dashboard/hello_world.yaml | 37 +++++++++-------- lovelace/dashboard/kunibert.yaml | 21 ++++++++++ packages/light/adaptive.yaml | 1 + packages/mailbox/mailbox_received.yaml | 53 +++++++++++++++++++++++++ packages/mailbox/mailbox_taken_out.yaml | 51 ++++++++++++++++++++++++ packages/mailbox/switch.yaml | 19 +++++++++ ui-lovelace.yaml | 10 ++++- 8 files changed, 174 insertions(+), 18 deletions(-) mode change 100755 => 100644 configuration.yaml create mode 100755 lovelace/dashboard/kunibert.yaml create mode 100755 packages/mailbox/mailbox_received.yaml create mode 100755 packages/mailbox/mailbox_taken_out.yaml create mode 100755 packages/mailbox/switch.yaml diff --git a/configuration.yaml b/configuration.yaml old mode 100755 new mode 100644 diff --git a/lovelace/dashboard/hello_world.yaml b/lovelace/dashboard/hello_world.yaml index 6a50dff..1f74c77 100755 --- a/lovelace/dashboard/hello_world.yaml +++ b/lovelace/dashboard/hello_world.yaml @@ -15,6 +15,26 @@ icon: "mdi:lightbulb" #OPTIONAL name: Temp color: "green" + +- type: 'custom:button-card' + color_type: icon + entity: switch.mailbox + name: Mailbox + tap_action: none + show_label: true + size: 20% + state: + - operator: template + value: > + [[[ return states['switch.mailbox'].state === 'on' ]]] + icon: mdi:mailbox + label: Mail + - operator: default + icon: mdi:mailbox-outline + label: No Mail + + + - type: horizontal-stack cards: @@ -37,21 +57,4 @@ - type: custom:weather-card entity: weather.pirateweather -- type: vertical-stack - cards: - - type: 'custom:valetudo-map-card' - vacuum: 'valetudo_kunibert' - 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_kunibert' - diff --git a/lovelace/dashboard/kunibert.yaml b/lovelace/dashboard/kunibert.yaml new file mode 100755 index 0000000..0ad4448 --- /dev/null +++ b/lovelace/dashboard/kunibert.yaml @@ -0,0 +1,21 @@ +- type: 'custom:button-card' + template: card_title + name: Kunibert + label: information + +- type: vertical-stack + cards: + - type: 'custom:valetudo-map-card' + vacuum: 'valetudo_kunibert' + 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_kunibert' \ No newline at end of file diff --git a/packages/light/adaptive.yaml b/packages/light/adaptive.yaml index f12c027..957ad88 100755 --- a/packages/light/adaptive.yaml +++ b/packages/light/adaptive.yaml @@ -1,5 +1,6 @@ adaptive_lighting: min_brightness: 35 + transition: 0 lights: - light.office_bulb - light.bedroom_bulb_light \ No newline at end of file diff --git a/packages/mailbox/mailbox_received.yaml b/packages/mailbox/mailbox_received.yaml new file mode 100755 index 0000000..67d8daa --- /dev/null +++ b/packages/mailbox/mailbox_received.yaml @@ -0,0 +1,53 @@ +automation: + - alias: mailbox_mail_received + mode: single + trigger: + - device_id: ca819ab69f4c9e16861daf8ffacdd10e + entity_id: binary_sensor.mailbox_motion_iaszone + domain: binary_sensor + platform: device + type: motion + condition: + - type: is_not_open + condition: device + device_id: 6649a68ae459ea3e7f61eb4155ffe23d + entity_id: binary_sensor.mailbox_door_iaszone + domain: binary_sensor + action: + - service: notify.notify + data: + title: Post + message: ist da. + - service: switch.turn_on + target: + entity_id: switch.mailbox + - service: scene.create + data: + scene_id: before + snapshot_entities: + - light.office_bulb + - delay: + seconds: 2 + - service: scene.create + data: + scene_id: after + snapshot_entities: + - switch.adaptive_lighting_default + - service: switch.turn_off + target: + entity_id: switch.adaptive_lighting_default + - service: light.turn_on + target: + entity_id: light.office_bulb + data: + color_name: blue + - delay: + seconds: 15 + - service: scene.turn_on + target: + entity_id: scene.before + - delay: + seconds: 1 + - service: scene.turn_on + target: + entity_id: scene.after \ No newline at end of file diff --git a/packages/mailbox/mailbox_taken_out.yaml b/packages/mailbox/mailbox_taken_out.yaml new file mode 100755 index 0000000..2052b23 --- /dev/null +++ b/packages/mailbox/mailbox_taken_out.yaml @@ -0,0 +1,51 @@ +automation: + - alias: mailbox_mail_taken_out + mode: single + trigger: + - device_id: 6649a68ae459ea3e7f61eb4155ffe23d + entity_id: binary_sensor.mailbox_door_iaszone + domain: binary_sensor + platform: device + type: opened + action: + - service: notify.notify + data: + title: Post + message: ist aus dem Briefkasten geholt. + - service: switch.turn_off + target: + entity_id: switch.mailbox + - service: scene.create + data: + scene_id: before + snapshot_entities: + - light.office_bulb + - automation.mailbox_mail_received + - service: automation.turn_off + target: + entity_id: automation.mailbox_mail_received + - service: scene.create + data: + scene_id: after + snapshot_entities: + - switch.adaptive_lighting_default + - delay: + seconds: 2 + - service: switch.turn_off + target: + entity_id: switch.adaptive_lighting_default + - service: light.turn_on + target: + entity_id: light.office_bulb + data: + color_name: red + - delay: + seconds: 15 + - service: scene.turn_on + target: + entity_id: scene.before + - delay: + seconds: 1 + - service: scene.turn_on + target: + entity_id: scene.after \ No newline at end of file diff --git a/packages/mailbox/switch.yaml b/packages/mailbox/switch.yaml new file mode 100755 index 0000000..45cfdd2 --- /dev/null +++ b/packages/mailbox/switch.yaml @@ -0,0 +1,19 @@ +# Example configuration.yaml entry +switch: + - platform: template + switches: + mailbox: + turn_on: + service: switch.turn_on + target: + entity_id: switch.mailbox + turn_off: + service: switch.turn_off + target: + entity_id: switch.mailbox + icon_template: > + {% if is_state('switch.mailbox', 'on') %} + mdi:mailbox + {% else %} + mdi:mailbox-outline + {% endif %} \ No newline at end of file diff --git a/ui-lovelace.yaml b/ui-lovelace.yaml index 6881d34..fab67d4 100755 --- a/ui-lovelace.yaml +++ b/ui-lovelace.yaml @@ -24,4 +24,12 @@ views: - type: custom:vertical-layout type: vertical-stack cards: - !include lovelace/dashboard/sensors.yaml \ No newline at end of file + !include lovelace/dashboard/sensors.yaml + - type: custom:vertical-layout + title: "Kunibert" + path: 1 + cards: + - type: custom:vertical-layout + type: vertical-stack + cards: + !include lovelace/dashboard/kunibert.yaml \ No newline at end of file