I am trying to make automation to run only when Samsung air conditioner (A/C) is on.
Specifically, I made an automation to check the temperature every 5 minutes between 08:30AM and 03:00AM, and depending on the temperature, A/C’s target temperature is set accordingly.
Sometimes, A/C is intentionally in OFF state (turned off by myself) between 08:30AM and 03:00AM. In such case, I do not want the automation to turn on the A/C. The automation below keeps on turning on A/C.
I tried “- condition: template” and “- condition: state” but the A/C is still turned on by automation…
For “- condition: state” , I chose “heat” because there is no “ON” as A/C has multiple “ON” states…No matter which state I choose for “- condition: state”, the automation would not stop turning on the A/C.
template condition must be true to stop automation from turning on the A/C.
What is wrong with the template condition?
If 2 conditions match
Executed: January 26, 2026 at 2:55:00 AM
Result:
result: false
conditions/0
[If the time is after 8:30 AM and before 3:00 AM]
Executed: January 26, 2026 at 2:55:00 AM
Result:
after:
__type: <class 'datetime.time'>
isoformat: '08:30:00'
now_time:
__type: <class 'datetime.time'>
isoformat: '02:55:00.393464'
before:
__type: <class 'datetime.time'>
isoformat: '03:00:00'
weekday:
- sun
- mon
- tue
- wed
- thu
- fri
- sat
now_weekday: mon
result: true
conditions/1
[If template renders a value equal to true]
Executed: January 26, 2026 at 2:55:00 AM
Result:
result: false
entities:
- climate.lounge_ac
Were those the results when you testing it with the Time Pattern Trigger (between 8:30 AM and 3:00 AM) or when you used the “Run” command?
Because the “Run” command will skip the conditions section and simply execute the actions section.
If you didn’t use the “Run” command, what is the state of climate.lounge_ac displayed in Developer Tools → States when the A/C unit is turned off? If it is literally off then the Template Condition you created should have worked because it requires the state to be notoff in order for the automation to execute its actions.