summaryrefslogtreecommitdiffstats
path: root/blueprints/script/devices
diff options
context:
space:
mode:
authorroot <root@smartpi.suren.me>2023-01-10 07:45:02 +0400
committerroot <root@smartpi.suren.me>2023-01-10 07:45:02 +0400
commit2c0c331eb7b7a03152309bbbd4e0fee157e8d86c (patch)
tree03391160212b39c4597ecc26010f2ba1235a65e3 /blueprints/script/devices
downloadhass-2c0c331eb7b7a03152309bbbd4e0fee157e8d86c.tar.gz
hass-2c0c331eb7b7a03152309bbbd4e0fee157e8d86c.tar.bz2
hass-2c0c331eb7b7a03152309bbbd4e0fee157e8d86c.tar.xz
hass-2c0c331eb7b7a03152309bbbd4e0fee157e8d86c.zip
Initial configuration
Diffstat (limited to 'blueprints/script/devices')
-rw-r--r--blueprints/script/devices/aircon.yaml135
-rw-r--r--blueprints/script/devices/kodi-alarm.yaml29
2 files changed, 164 insertions, 0 deletions
diff --git a/blueprints/script/devices/aircon.yaml b/blueprints/script/devices/aircon.yaml
new file mode 100644
index 0000000..b2641be
--- /dev/null
+++ b/blueprints/script/devices/aircon.yaml
@@ -0,0 +1,135 @@
+blueprint:
+ name: AirCon
+ description: Stream photos from security camera
+ domain: script
+ input:
+ power:
+ name: Power
+ description: Aircon Smart Power Plug
+ selector:
+ entity:
+ domain: switch
+ temperature:
+ name: Temperature
+ description: Temperature sensor
+ selector:
+ entity:
+ domain: sensor
+ device_class: temperature
+ cold_temp:
+ name: Cold Temp
+ description: Temperature threshold to turn on heating
+ default: 16
+ selector:
+ number:
+ min: 8
+ max: 20
+ unit_of_measurement: C
+ hot_temp:
+ name: Hot Temp
+ description: Temperature threshold to turn on cooling
+ default: 20
+ selector:
+ number:
+ min: 20
+ max: 36
+ unit_of_measurement: C
+ cool_scene:
+ name: Cool Scene
+ description: Cooling scene of Aircon
+ selector:
+ entity:
+ domain: scene
+ heat_scene:
+ name: Heat Scene
+ description: Warming scene of Aircon
+ selector:
+ entity:
+ domain: scene
+ off_scene:
+ name: Off Scene
+ description: Off scene of Aircon
+ selector:
+ entity:
+ domain: scene
+ confirm:
+ name: Confirm
+ description: Confirmation script
+ default: []
+ selector:
+ action:
+
+variables:
+ temp: !input temperature
+ cold: !input cold_temp
+ hot: !input hot_temp
+
+alias: AirCon
+sequence:
+ - if:
+ - condition: state
+ entity_id: !input power
+ state: 'on'
+ then:
+ - service: scene.turn_on
+ target:
+ entity_id: !input off_scene
+ - delay:
+ hours: 0
+ minutes: 0
+ seconds: 5
+ milliseconds: 0
+ - service: switch.turn_off
+ target:
+ entity_id: !input power
+ else:
+ - service: switch.turn_on
+ target:
+ entity_id: !input power
+ - delay:
+ hours: 0
+ minutes: 0
+ seconds: 5
+ milliseconds: 0
+ - choose:
+ - conditions:
+ - "{{ states('sensor.bedroom_temp_temperature') | float < cold }}"
+ sequence:
+ - service: scene.turn_on
+ target:
+ entity_id: !input heat_scene
+ - conditions:
+ - "{{ states('sensor.bedroom_temp_temperature') | float > hot }}"
+ sequence:
+ - service: scene.turn_on
+ target:
+ entity_id: !input cool_scene
+ default:
+ - service: switch.turn_off
+ target:
+ entity_id: !input power
+ - service: switch.turn_on
+ target:
+ entity_id: !input power
+ - choose: []
+ default: !input "confirm"
+
+# - if:
+# - condition: state
+# entity_id: switch.bedroom_aircon
+# state: 'off'
+# then:
+# - service: switch.turn_on
+# data: {}
+# target:
+# entity_id: switch.bedroom_aircon
+# - delay:
+# hours: 0
+# minutes: 0
+# seconds: 5
+# milliseconds: 0
+ - service: scene.turn_on
+ target:
+ entity_id: scene.hyundai_aircon_cool_18
+ metadata: {}
+mode: single
diff --git a/blueprints/script/devices/kodi-alarm.yaml b/blueprints/script/devices/kodi-alarm.yaml
new file mode 100644
index 0000000..48ecd1c
--- /dev/null
+++ b/blueprints/script/devices/kodi-alarm.yaml
@@ -0,0 +1,29 @@
+blueprint:
+ name: Kodi - Play Alarm
+ description: Stream photos from security camera
+ domain: script
+ input:
+ player:
+ name: Player
+ description: KoDi Media Player
+ selector:
+ entity:
+ domain: media_player
+ song:
+ name: Player
+ description: KoDi Media Player
+ selector:
+ media: {}
+
+mode: restart
+sequence:
+ - service: media_player.volume_set
+ data:
+ volume_level: 1
+ target:
+ entity_id: !input player
+ - service: media_player.play_media
+ target:
+ entity_id: !input player
+ data:
+ !input song