You REALLY need to format your code correctly for the forum. Especially for that one.
edit your post above and put three backticks (```) on the line before and on the line after your code block.
You can likely reduce the code significantly by getting rid of all those “condition: and” lines. But it’s hard to tell if that’s the only problem because we can’t see the actual formatting of your existing code.
Sorry for that error with leaving out the back ticks. I created this automation with “visual editor” then opened it with “YAML” to post it here.
Before I posted it as code this site warned me to add the tick marks. I am not seeing the option for back tick marks on my iphone keyboard, so I clicked on the “post it anyway” button.
Also, any extra code words in there were from the visual editor to YAML translation I suppose.
alias: Allow A/C to Run After Windows Are Closed
description: End Whole House Fan Operation
trigger:
- platform: state
entity_id: binary_sensor.master_toilet_window
from: 'On'
to: 'Off'
condition:
- condition: and
conditions:
- condition: state
state: 'off'
entity_id: binary_sensor.master_shower_tub
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.back_bathroom_patio
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.back_bedroom_sliding
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.dining_room_window
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.master_patio_window
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.living_room_window
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.master_front_window
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.master_bathroom_sliding
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.wetbar_sliding_patio
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.front_bedroom_sliding
state: 'Off'
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.kitchen_window_left
state: 'Off'
action:
- service: climate.set_hvac_mode
target:
device_id: d050031c984183e50190c27f79659d37
entity_id: climate.american_standard_heat_pump
area_id: main_house
data:
hvac_mode: cool
mode: single
max: 10
Thank you!
I will make the changes, test it out and reply back here .
I have made these changes to the automation. It’s still not able to bring the A/C unit back into “Cool” mode.
alias: Allow A/C to Run After Windows Are Closed (Duplicate)
description: End Whole House Fan Operation
mode: single
trigger:
- platform: state
entity_id: binary_sensor.master_toilet_window
to: 'off'
from: 'on'
condition:
- condition: state
entity_id: binary_sensor.master_shower_tub
state: 'off'
- condition: state
entity_id: binary_sensor.back_bathroom_patio
state: 'off'
- condition: state
entity_id: binary_sensor.back_bedroom_sliding
state: 'off'
- condition: state
entity_id: binary_sensor.dining_room_window
state: 'off'
- condition: state
entity_id: binary_sensor.master_patio_window
state: 'off'
- condition: state
entity_id: binary_sensor.living_room_window
state: 'off'
- condition: state
entity_id: binary_sensor.master_front_window
state: 'off'
- condition: state
entity_id: binary_sensor.master_bathroom_sliding
state: 'off'
- condition: state
entity_id: binary_sensor.wetbar_sliding_patio
state: 'off'
- condition: state
entity_id: binary_sensor.front_bedroom_sliding
state: 'off'
- condition: state
entity_id: binary_sensor.kitchen_window_left
state: 'off'
action:
- service: climate.set_hvac_mode
target:
device_id: d050031c984183e50190c27f79659d37
entity_id: climate.american_standard_heat_pump
area_id: main_house
data:
hvac_mode: cool
max: 10
If I hit the “Run Actions” button in the automation, it does switch to “Cool” mode. I realize that this is not a true test of the whole automation but I do have a connection to the A/C unit.