- id: lounge_aircon_manual alias: 'Lounge Room Aircon' hide_entity: True trigger: platform: state entity_id: input_select.lounge_ac_mode action: - service_template: > {% if is_state('input_select.lounge_ac_mode', 'Powerful Heat') %} shell_command.lounge_ac_powerful_heat {% elif is_state('input_select.lounge_ac_mode', 'Normal Heat') %} shell_command.lounge_ac_normal_heat {% elif is_state('input_select.lounge_ac_mode', 'Silent Heat') %} shell_command.lounge_ac_silent_heat {% elif is_state('input_select.lounge_ac_mode', 'Powerful Cool') %} shell_command.lounge_ac_powerful_cool {% elif is_state('input_select.lounge_ac_mode', 'Normal Cool') %} shell_command.lounge_ac_normal_cool {% elif is_state('input_select.lounge_ac_mode', 'Silent Cool') %} shell_command.lounge_ac_silent_cool {% elif is_state('input_select.lounge_ac_mode', 'Dry') %} shell_command.lounge_ac_dry {% elif is_state('input_select.lounge_ac_mode', 'Off') %} shell_command.lounge_ac_off {% endif %} - id: lounge_aircon_auto_am_on alias: 'Lounge Room Aircon Scheduled AM On' trigger: platform: template value_template: "{{ states('sensor.time') == (states.input_datetime.lounge_ac_am_on_time.state[0:5]) }}" condition: condition: and conditions: - condition: state entity_id: input_boolean.lounge_ac_am_automation # If automation is required and ... state: 'on' - condition: or conditions: - condition: state entity_id: input_boolean.lounge_ac_workday # If workday is not tested or is a workday state: 'off' - condition: state entity_id: binary_sensor.workday_sensor state: 'on' action: - service: input_select.select_option data_template: entity_id: input_select.lounge_ac_mode option: > {% if states.sensor.stats_roomt_mean.state < states.input_number.lounge_ac_heat_temp_set.state %} Normal Heat {% elif states.sensor.stats_roomt_mean.state > states.input_number.lounge_ac_cool_temp_set.state %} Normal Cool {% else %} 'Off' {% endif %} - id: lounge_aircon_auto_pm_on alias: 'Lounge Room Aircon Scheduled PM On' trigger: platform: template value_template: "{{ states('sensor.time') == (states.input_datetime.lounge_ac_pm_on_time.state[0:5]) }}" condition: condition: and conditions: - condition: state entity_id: input_boolean.lounge_ac_pm_automation # If automation is required and ... state: 'on' - condition: or conditions: - condition: state entity_id: input_boolean.lounge_ac_workday # If workday is not tested or is a workday state: 'off' - condition: state entity_id: binary_sensor.workday_sensor state: 'on' action: - service: input_select.select_option data_template: entity_id: input_select.lounge_ac_mode option: > {% if states.sensor.stats_roomt_mean.state < states.input_number.lounge_ac_heat_temp_set.state %} Normal Heat {% elif states.sensor.stats_roomt_mean.state > states.input_number.lounge_ac_cool_temp_set.state %} Normal Cool {% else %} 'Off' {% endif %} - id: lounge_aircon_auto_am_off alias: 'Lounge Room Aircon Scheduled AM Off' trigger: platform: template value_template: "{{ states('sensor.time') == (states.input_datetime.lounge_ac_am_off_time.state[0:5]) }}" condition: condition: and conditions: - condition: state entity_id: input_boolean.lounge_ac_am_automation # If automation is required and ... state: 'on' - condition: or conditions: - condition: state entity_id: input_boolean.lounge_ac_workday # If workday is not tested or is a workday state: 'off' - condition: state entity_id: binary_sensor.workday_sensor state: 'on' action: - service: input_select.select_option data_template: entity_id: input_select.lounge_ac_mode option: 'Off' - id: lounge_aircon_auto_pm_off alias: 'Lounge Room Aircon Scheduled PM Off' trigger: platform: template value_template: "{{ states('sensor.time') == (states.input_datetime.lounge_ac_pm_off_time.state[0:5]) }}" condition: condition: and conditions: - condition: state entity_id: input_boolean.lounge_ac_pm_automation # If automation is required and ... state: 'on' - condition: or conditions: - condition: state entity_id: input_boolean.lounge_ac_workday # If workday not tested or if workday state: 'off' - condition: state entity_id: binary_sensor.workday_sensor state: 'on' action: - service: input_select.select_option data_template: entity_id: input_select.lounge_ac_mode option: 'Off'