Browse Source

Add min_renovasjon, minor light changes and notify

Joachim M. Giæver 11 months ago
parent
commit
1e19e1aa05
4 changed files with 98 additions and 0 deletions
  1. 31 0
      Entrance/hall_lights.yaml
  2. 41 0
      Entrance/porch_light.yaml
  3. 12 0
      General/min_renovasjon.yaml
  4. 14 0
      Office/office_dashboard.yaml

+ 31 - 0
Entrance/hall_lights.yaml

@@ -0,0 +1,31 @@
+automation:
+  - id: hall_light_react
+    alias:  "Entrance - Hall: Turn on ceiling lights"
+    trigger: 
+      platform: event
+      event_type: zwave_js_value_notification
+      event_data:
+        domain: zwave_js
+        node_id: 226
+    action:
+      service: system_log.write
+      data:
+        message: "This is it! Here's trigger {{ trigger.event.data }} {{ area_entities(device_attr(trigger.event.data.device_id, 'area_id'))|selectattr('domain','in','light')|list }}"
+        level: warning
+      # service: "light.{{ 'turn_off' if trigger.event.data.value_raw else 'turn_on' }}"
+      # entity_id: >-
+      #   {{ area_entities(device_attr(trigger.event.data.device_id, 'area_id'))|expand|selectattr('domain', 'eq', 'light')|list }}
+  - id: 'entrance_hall_motion_active_lights'
+    alias: 'Entrance - Hall: Motion active lights'
+    use_blueprint:
+      path: motion_detected_lights.yaml
+      input:
+        trigger_sensors:
+          - binary_sensor.entrance_motion_sensor_home_security_motion_detection
+          - binary_sensor.entrance_door_sensor_access_control_window_door_is_open
+        synced_lights:
+          - light.entrance_ceiling_lights
+        after_wait_actions:
+          - wait_template: "{{ is_state('input_boolean.housekeeping_mode', 'off') }}"
+        wait_actions_before_dim: []
+        delay: 1

+ 41 - 0
Entrance/porch_light.yaml

@@ -0,0 +1,41 @@
+switch:
+  - platform: group
+    name: "Entrance: Porch light"
+    entities:
+      - switch.entrance_porch_light_1
+      - switch.entrance_porch_light_4
+
+
+light:
+  - platform: template
+    lights:
+      entrance_porch_light:
+        friendly_name: "Entrance: Porch light"
+        turn_on:
+          service: switch.turn_on
+          entity_id: switch.entrance_porch_light
+        turn_off:
+          service: switch.turn_off
+          entity_id: switch.entrance_porch_light
+        value_template: >-
+          {{ false if is_state('switch.entrance_porch_light', 'unknown') else states('switch.entrance_porch_light') }}
+        availability_template: >-
+          {{ not is_state('switch.entrance_porch_light', 'unavailable') }}
+
+automation:
+  - id: entrance_switch_on_off_porch_light
+    alias: "Entrance: Switch on/off porch light"
+    trigger:
+      - platform: state
+        entity_id: sensor.period_of_day
+      - platform: homeassistant
+        event: start
+    action:
+      - wait_template: "{{ not is_state('light.entrance_porch_light', 'unavailable') }}"
+      - if: "{{ is_state('sensor.period_of_day', 'day') }}"
+        then:
+          service: light.turn_off
+          entity_id: light.entrance_porch_light
+        else:
+          service: light.turn_on
+          entity_id: light.entrance_porch_light

+ 12 - 0
General/min_renovasjon.yaml

@@ -0,0 +1,12 @@
+min_renovasjon:
+  street_name: "Kirkegårdsvegen"
+  house_no: "14"
+  street_code: "19500"
+  county_id: "5401"
+  date_format: "None"
+
+sensor:
+  - platform: min_renovasjon
+    fraction_id:
+      - 4
+      - 23

+ 14 - 0
Office/office_dashboard.yaml

@@ -0,0 +1,14 @@
+# Require: https://github.com/jmgiaever/home-assistant-blueprints/blob/master/automation/cast_lovelace_on_motion.yaml
+automation:
+  - id: 'office_dashboard'
+    alias: "Office: Cast lovelace on motion detection"
+    description: ''
+    use_blueprint:
+      path: cast_lovelace_on_motion.yaml
+      input:
+        trigger_sensors:
+        - binary_sensor.office_motion_sensor_home_security_motion_detection
+        media_devices:
+        - media_player.office_display
+        dashboard_path: lovelace
+        dashboard_view: home #"{{ 'kitchen' if is_state('input_boolean.kitchen_dashboard', 'on') else 'home' }}"