diff options
| author | Joe Mou <dev@mou.fo> | 2024-06-19 23:04:33 -0400 |
|---|---|---|
| committer | Joe Mou <dev@mou.fo> | 2024-10-09 13:48:40 -0400 |
| commit | 1abb43173e05aad3f5c9b7ac85c80ebf14749fb0 (patch) | |
| tree | d69bc1ac8bbc3117201073ab684e3798f90b97f5 /hostnix/elmo | |
| parent | e31bb0c936a3a30b741ac32a73b1ebf9a0e2569b (diff) | |
Control AC with bedroom temperature sensor
Diffstat (limited to 'hostnix/elmo')
| -rw-r--r-- | hostnix/elmo/home-assistant.nix | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/hostnix/elmo/home-assistant.nix b/hostnix/elmo/home-assistant.nix index 68fa615..d97e7a1 100644 --- a/hostnix/elmo/home-assistant.nix +++ b/hostnix/elmo/home-assistant.nix @@ -61,10 +61,37 @@ brightness_mode_time_light = 3 * 60 * 60; }; + switch = [ + { + platform = "template"; + switches = { + midea_cool = { + value_template = "{{ is_state('climate.air_conditioner_1', 'cool') and state_attr('climate.air_conditioner_1', 'temperature')|float < 72 }}"; + turn_on = [ + { + service = "climate.set_temperature"; + target.entity_id = "climate.air_conditioner_1"; + data = { + hvac_mode = "cool"; + temperature = 70; + }; + } + ]; + turn_off = [ + { + service = "climate.turn_off"; + target.entity_id = "climate.air_conditioner_1"; + } + ]; + }; + }; + } + ]; + climate = [ { platform = "generic_thermostat"; - name = "Bedroom"; + name = "Bedroom Heat"; heater = "switch.thermostat_heat"; target_sensor = "sensor.bedroom_temperature"; min_cycle_duration.minutes = 2; @@ -72,6 +99,14 @@ # initial_hvac_mode = "off" keep_alive.minutes = 5; } + { + platform = "generic_thermostat"; + name = "Bedroom Cool"; + ac_mode = true; + heater = "switch.midea_cool"; + target_sensor = "sensor.bedroom_temperature"; + min_cycle_duration.minutes = 2; + } ]; # - alias: Sound machine switch @@ -421,6 +456,7 @@ }; action = [ (service "light.turn_off" "light.panel_light") + (service "climate.turn_off" "climate.bedroom_cool") ]; } |
