Browse Source

First vorking version

root 4 năm trước cách đây
commit
0260793560
7 tập tin đã thay đổi với 181 bổ sung0 xóa
  1. 32 0
      .gitignore
  2. 59 0
      automations.yaml
  3. 67 0
      configuration.yaml
  4. 0 0
      groups.yaml
  5. 23 0
      packages/ext_lights.yaml
  6. 0 0
      scenes.yaml
  7. 0 0
      scripts.yaml

+ 32 - 0
.gitignore

@@ -0,0 +1,32 @@
+# Git Ignore File
+
+# Do not ignore
+!/.gitignore
+!/.travis.yml
+
+# Logs
+logs
+*.log
+
+# Ignore Folders
+.storage
+.cloud
+.vscode
+.Trash-*
+deps/
+
+# Ignored Files
+secrets.yaml
+ip_bans.yaml
+known_devices.yaml
+*.conf
+*.db
+*.uuid
+.HA_VERSION
+
+# Node-Red
+node-red
+
+# Operating System Trash Files
+.DS_Store
+

+ 59 - 0
automations.yaml

@@ -0,0 +1,59 @@
+- id: '1604224258912'
+  alias: Exterior lights ON in evening
+  description: In the evening, turn the lights ON
+  trigger:
+  - platform: numeric_state
+    entity_id: sensor.lux_outside_the_garage
+    below: '100'
+  condition:
+  - condition: state
+    entity_id: input_boolean.ext_light_on_done
+    state: 'off'
+  action:
+  - service: light.turn_on
+    data: {}
+    entity_id: light.exterior_lights_repeater
+  - service: light.turn_on
+    data: {}
+    entity_id: light.exterior_lights
+  - service: input_boolean.turn_on
+    data: {}
+    entity_id: input_boolean.ext_light_on_done
+  mode: single
+- id: '1604250273403'
+  alias: Exterior lights OFF in morning
+  description: ''
+  trigger:
+  - platform: numeric_state
+    entity_id: sensor.lux_outside_the_garage
+    above: '50'
+  condition:
+  - condition: state
+    entity_id: input_boolean.ext_light_off_done
+    state: 'off'
+  action:
+  - service: light.turn_off
+    data: {}
+    entity_id: light.exterior_lights_repeater
+  - service: light.turn_off
+    data: {}
+    entity_id: light.exterior_lights
+  - service: input_boolean.turn_on
+    data: {}
+    entity_id: input_boolean.ext_light_off_done
+  mode: single
+- id: '1604426412714'
+  alias: Turn boolean switches off at midnight
+  description: ''
+  trigger:
+  - platform: time
+    at: 00:05:00
+  condition: []
+  action:
+  - service: input_boolean.turn_off
+    data: {}
+    entity_id: input_boolean.ext_light_off_done
+  - service: input_boolean.turn_off
+    data: {}
+    entity_id: input_boolean.ext_light_on_done
+  mode: single

+ 67 - 0
configuration.yaml

@@ -0,0 +1,67 @@
+
+
+# Configure a default setup of Home Assistant (frontend, api, etc)
+#default_config:
+config:
+frontend:
+
+logger:
+  logs:
+    rflink: debug
+    homeassistant.components.rflink: debug
+
+homeassistant:
+  packages: !include_dir_named packages
+
+binary_sensor:
+counter:
+logbook:
+notify:
+input_boolean:
+input_datetime:
+input_number:
+input_select:
+input_text:
+timer:
+#websocket_api
+
+system_health:
+recorder:
+  purge_keep_days: 5
+  db_url: mysql://hassio:hassiopassword@192.168.1.110/hass?charset=utf8
+history:
+
+
+
+rflink:
+  host: 127.0.0.1
+  port: 12345
+  wait_for_ack: false
+
+sensor:
+  - platform: rflink
+    automatic_add: true
+
+  - platform: sql
+    db_url: mysql://hassio:hassiopassword@192.168.1.110/RemoteRxLog
+    queries:
+      - name: Lux outside the garage
+        query: "SELECT CAST(AVG(data) AS signed) as data FROM (SELECT data FROM RemoteRxLog.rawTemp WHERE type = 'lux' and data < '65535' ORDER BY id DESC LIMIT 3) items;"
+        column: 'data'
+        unit_of_measurement: Lux
+      - name: Exterior light status
+        query: "SELECT onOff FROM RemoteRxLog.nexaLog where remote_id = '20071094' and button='1' order by ts desc LIMIT 1;"
+        column: 'onOff'
+      - name: Outside temperature
+        query: "SELECT temp1 FROM RemoteRxLog.temp order by ts desc LIMIT 1;"
+        column: 'temp1'
+        unit_of_measurement: C
+
+switch:
+  - platform: rflink
+    automatic_add: true
+
+group: !include groups.yaml
+automation: !include automations.yaml
+script: !include scripts.yaml
+scene: !include scenes.yaml

+ 0 - 0
groups.yaml


+ 23 - 0
packages/ext_lights.yaml

@@ -0,0 +1,23 @@
+############################ Battery Automations, Scripts & Sensors ##################################
+# All entities to have the prefix: "battery_" or name: Battery: 
+######################################################################################################
+
+
+light:
+  - platform: rflink
+    automatic_add: true
+    devices:
+      newkaku_013242b6_1:
+        name: Exterior lights
+        type: switchable
+      newkaku_013242b5_1:
+        name: Exterior lights REPEATER
+        type: switchable
+
+input_boolean:
+  ext_light_on_done:
+    name: Bool switch, Ext light turned ON
+    icon: mdi:car
+  ext_light_off_done:
+    name: Bool switch, Ext light turned OFF
+    icon: mdi:car

+ 0 - 0
scenes.yaml


+ 0 - 0
scripts.yaml