summaryrefslogtreecommitdiffstats
path: root/blueprints/script/devices/aircon.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'blueprints/script/devices/aircon.yaml')
-rw-r--r--blueprints/script/devices/aircon.yaml135
1 files changed, 135 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