This is my current automation code:
- alias: 'Turn AC to idle with button click if not already idle'
trigger: # trigger on no motion
platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_158d0001a9dbdc
click_type: single
condition: # check climate.panasonic_aircon state isn't already idle
condition: or
conditions:
- condition: state
entity_id: 'climate.panasonic_aircon'
state: 'auto'
- condition: state
entity_id: 'climate.panasonic_aircon'
state: 'heat'
- condition: state
entity_id: 'climate.panasonic_aircon'
state: 'cool'
- condition: state
entity_id: 'climate.panasonic_aircon'
state: 'fan'
action: # turn the AC to idle mode
- service: persistent_notification.create
data:
message: "I just the AC to idle"
title: "AC Notification"
- service: climate.set_operation_mode
data:
entity_id: climate.panasonic_aircon
operation_mode: idle
Can someone please help me with using a value template for the condition part of the automation?