Forráskód Böngészése

Merge branch 'master' of cobra/home-assistant into master

felix 2 éve
szülő
commit
6e96c6135b
3 módosított fájl, 106 hozzáadás és 0 törlés
  1. 4 0
      README.md
  2. 9 0
      configuration.yaml
  3. 93 0
      packages/wakeup.yaml

+ 4 - 0
README.md

@@ -0,0 +1,4 @@
+# Version History
+
+## 0.1
+* wakeup package for Philips Hue Lights

+ 9 - 0
configuration.yaml

@@ -0,0 +1,9 @@
+homeassistant:
+  # Package
+  packages: !include_dir_named packages
+
+
+sensor:
+  - platform: time_date
+    display_options:
+      - 'time'

+ 93 - 0
packages/wakeup.yaml

@@ -0,0 +1,93 @@
+sensor:
+  - platform: template
+    sensors:
+      wakeup_start_time_lights:
+        friendly_name: 'Start time'
+        value_template: >
+          {% set starttime = states.input_datetime.wakeup_alarm_time.attributes.timestamp - (states.input_number.wakeup_duration.state | int) * 60 %}
+          {{ starttime | timestamp_custom('%H:%M', False) }}
+        icon_template: 'mdi:clock-start'
+
+input_boolean:
+  wakeup:
+    name: 'Wakeup light'
+    icon: mdi:power
+    initial: off
+  wakeup_weekends:
+    name: 'Wakeup Weekend'
+    icon: mdi:calendar-clock
+    initial: off
+
+input_number:
+  wakeup_duration:
+    name: Dauer
+    icon: mdi:clock-in
+    initial: 20
+    min: 5
+    max: 60
+    step: 5
+    unit_of_measurement: 'min'
+
+input_datetime:
+  wakeup_alarm_time:
+    name: 'Alarm time'
+    #icon: mdi:clock-end
+    has_date: false
+    has_time: true
+    initial: '06:30'
+
+
+group:
+  wakeuplight:
+    name: Wakeup Light
+    control: hidden
+    entities:
+      - input_datetime.wakeup_alarm_time
+      - input_number.wakeup_duration
+      - sensor.wakeup_start_time_lights
+      - input_boolean.wakeup
+      - input_boolean.wakeup_weekends
+
+automation:
+  - action:
+    - service: script.wakeup_bedroom
+    alias: 'Wakeup Bedroom'
+    hide_entity: true
+    condition:
+      condition: and
+      conditions:
+        - condition: state
+          entity_id: input_boolean.wakeup
+          state: 'on'
+        - condition: or
+          conditions:
+            - condition: state
+              entity_id: input_boolean.wakeup_weekends
+              state: 'on'
+            - condition: time
+              weekday:
+                - mon
+                - tue
+                - wed
+                - thu
+                - fri
+    trigger:
+      platform: template
+      value_template: '{{ states.sensor.time.state == states.sensor.wakeup_start_time_lights.state }}'
+
+script:
+  wakeup_bedroom:
+    alias: 'Wakeup Light'
+    sequence:
+      - service: light.turn_on
+        data_template:
+          entity_id: light.bedroom
+          brightness: 1
+          xy_color: [0.5016, 0.4151]
+      - delay:
+          seconds: 1
+      - service: light.turn_on
+        data_template:
+          entity_id: light.bedroom
+          brightness: 255
+          transition: '{{ states.input_number.wakeup_duration.state | multiply(60) | int }}'