I’m trying to figure out why this automation trace thinks its calling for heating-only…I think the variable do_cool
should be true not false?
This is convoluted because its a portable heat pump unit and Midea put the temp sensor in a shitty location and made the min heating temp possible to set seems to be 60-61F so if the outdoor temp is below the set-point once it sits a few minutes it decides to heat more even though the real room temperature is quite warm (e.g. for this particular trace, the REAL room temperature is 71F and outdoor temp around 50F). Then to make it more annoying, the unit begins heating/cooling at reduced capacity before it reaches the setpoint by 3F (e.g. if I set it to 65F heat it comes on maximum speed when the room is 64F but still heating low-speed when the room is 68F) but in mild weather that is still too much heating/cooling so I made up some “offsets” to try and help create a dead-band in my code.
Side-note, why the heck is it SO HARD to copy anything off the HA web UI now? Every couple seconds it seems to do something that un-highlights everything and shortcuts like CTRL+A don’t work either? And then thanks to all the Javascript I can’t highlight more than what’s on the screen either - it won’t scroll while highlighting. This makes it a LOT more painful to post in forums asking for help! It shouldn’t take me 10 minutes to successfully copy the debug information to a forum post
Trace Variables:
context:
id: 01JBVH51YGZV04JF0ZGW0R3WWA
parent_id: 01JBVH51Y9H1J930XXFWJRPBBR
user_id: null
current_mode: cool
cool_set: 73
heat_set: 57
max_set: 86
min_set: 61
room_temp: 62
cool_offset: 3
heat_offset: 5
cool_set_too_low: false
cool_set_too_high: false
cool_set_in_range: true
heat_set_too_low: true
heat_set_too_high: false
heat_set_in_range: false
room_below_cool_set: true
room_above_cool_set: false
room_below_heat_set: true
room_above_heat_set: false
room_below_cool_max: true
room_above_cool_max: false
room_below_heat_min: true
room_above_heat_min: false
do_cool: false
do_heat: true
do_max_cool: false
do_min_heat: false
Variable Code:
variables:
current_mode: '{{ states(''climate.whynter_arc_1230wnh'') }}'
cool_set: >-
{{ [states('sensor.whynter_portable_heatpump_hvac_requested_heat_computed')
|
int(0),states('sensor.whynter_portable_heatpump_hvac_requested_cool_computed')
| int(0)]|max }}
heat_set: >-
{{ [states('sensor.whynter_portable_heatpump_hvac_requested_heat_computed')
|
int(0),states('sensor.whynter_portable_heatpump_hvac_requested_cool_computed')
| int(0)]|min }}
max_set: '{{ 86 }}'
min_set: '{{ 61 }}'
room_temp: >-
{{ state_attr('climate.whynter_arc_1230wnh','current_temperature') | int(0)
}}
cool_offset: '{{ 3 }}'
heat_offset: '{{ 5 }}'
cool_set_too_low: '{{ cool_set < min_set }}'
cool_set_too_high: '{{ cool_set > max_set }}'
cool_set_in_range: '{{ cool_set >= min_set and cool_set <= max_set }}'
heat_set_too_low: '{{ heat_set < min_set }}'
heat_set_too_high: '{{ heat_set > max_set }}'
heat_set_in_range: '{{ heat_set >= min_set and heat_set <= max_set }}'
room_below_cool_set: '{{ room_temp < cool_set-cool_offset }}'
room_above_cool_set: '{{ room_temp >= cool_set-cool_offset }}'
room_below_heat_set: '{{ room_temp <= heat_set+heat_offset }}'
room_above_heat_set: '{{ room_temp > heat_set+heat_offset }}'
room_below_cool_max: '{{ room_temp < max_set-cool_offset }}'
room_above_cool_max: '{{ room_temp >= max_set-cool_offset }}'
room_below_heat_min: '{{ room_temp <= min_set+heat_offset }}'
room_above_heat_min: '{{ room_temp > min_set+heat_offset }}'
do_cool: |-
{{
(cool_set_too_low) or
(cool_set_in_range and room_above_heat_set) or
(cool_set_too_high and room_below_cool_set and room_below_cool_max) or
(cool_set_too_high and room_above_cool_set)
}}
do_heat: |-
{{
(heat_set_too_low and room_below_heat_set) or
(heat_set_too_low and room_above_heat_set and room_above_heat_min) or
(heat_set_in_range and room_below_cool_set) or
(heat_set_too_high)
}}
do_max_cool: |-
{{
(heat_set_too_low and room_above_heat_set and room_below_heat_min and room_below_cool_max)
}}
do_min_heat: |-
{{
(cool_set_too_high and room_below_cool_set and room_above_cool_max and room_above_heat_min)
}}
Entire automation:
alias: Whynter Portable Heatpump HVAC Set Temperatures
id: Whynter Portable Heatpump HVAC Set Temperatures
trace:
stored_traces: 100
trigger:
- platform: state
entity_id:
- sensor.whynter_portable_heatpump_hvac_requested_heat_computed
- sensor.whynter_portable_heatpump_hvac_requested_cool_computed
- platform: state
entity_id:
- sensor.whynter_portable_heatpump_hvac_requested_heat_computed
- sensor.whynter_portable_heatpump_hvac_requested_cool_computed
for: '00:00:05'
- platform: state
entity_id: climate.whynter_arc_1230wnh
from: 'off'
- platform: state
entity_id: climate.whynter_arc_1230wnh
from: heat
to: cool
- platform: state
entity_id: climate.whynter_arc_1230wnh
from: cool
to: heat
mode: queued
condition:
- condition: state
entity_id: climate.whynter_arc_1230wnh
state:
- cool
- heat
action:
- variables:
current_mode: '{{ states(''climate.whynter_arc_1230wnh'') }}'
cool_set: >-
{{
[states('sensor.whynter_portable_heatpump_hvac_requested_heat_computed')
|
int(0),states('sensor.whynter_portable_heatpump_hvac_requested_cool_computed')
| int(0)]|max }}
heat_set: >-
{{
[states('sensor.whynter_portable_heatpump_hvac_requested_heat_computed')
|
int(0),states('sensor.whynter_portable_heatpump_hvac_requested_cool_computed')
| int(0)]|min }}
max_set: '{{ 86 }}'
min_set: '{{ 61 }}'
room_temp: >-
{{ state_attr('climate.whynter_arc_1230wnh','current_temperature') |
int(0) }}
cool_offset: '{{ 3 }}'
heat_offset: '{{ 5 }}'
cool_set_too_low: '{{ cool_set < min_set }}'
cool_set_too_high: '{{ cool_set > max_set }}'
cool_set_in_range: '{{ cool_set >= min_set and cool_set <= max_set }}'
heat_set_too_low: '{{ heat_set < min_set }}'
heat_set_too_high: '{{ heat_set > max_set }}'
heat_set_in_range: '{{ heat_set >= min_set and heat_set <= max_set }}'
room_below_cool_set: '{{ room_temp < cool_set-cool_offset }}'
room_above_cool_set: '{{ room_temp >= cool_set-cool_offset }}'
room_below_heat_set: '{{ room_temp <= heat_set+heat_offset }}'
room_above_heat_set: '{{ room_temp > heat_set+heat_offset }}'
room_below_cool_max: '{{ room_temp < max_set-cool_offset }}'
room_above_cool_max: '{{ room_temp >= max_set-cool_offset }}'
room_below_heat_min: '{{ room_temp <= min_set+heat_offset }}'
room_above_heat_min: '{{ room_temp > min_set+heat_offset }}'
do_cool: |-
{{
(cool_set_too_low) or
(cool_set_in_range and room_above_heat_set) or
(cool_set_too_high and room_below_cool_set and room_below_cool_max) or
(cool_set_too_high and room_above_cool_set)
}}
do_heat: |-
{{
(heat_set_too_low and room_below_heat_set) or
(heat_set_too_low and room_above_heat_set and room_above_heat_min) or
(heat_set_in_range and room_below_cool_set) or
(heat_set_too_high)
}}
do_max_cool: |-
{{
(heat_set_too_low and room_above_heat_set and room_below_heat_min and room_below_cool_max)
}}
do_min_heat: |-
{{
(cool_set_too_high and room_below_cool_set and room_above_cool_max and room_above_heat_min)
}}
- choose:
- conditions:
condition: template
value_template: |
{{
(do_cool and not do_heat) or
(do_cool and do_heat and current_mode == "cool")
}}
sequence:
- data:
entity_id: climate.whynter_arc_1230wnh
hvac_mode: cool
temperature: '{{ [cool_set,max_set] | min }}'
action: climate.set_temperature
- data:
entity_id: input_number.whynter_portable_heatpump_hvac_last_set_temp
value: '{{ [cool_set,max_set] | min }}'
action: input_number.set_value
- conditions:
condition: template
value_template: |
{{
(do_heat and not do_cool) or
(do_heat and do_cool and current_mode == "heat")
}}
sequence:
- data:
entity_id: climate.whynter_arc_1230wnh
hvac_mode: heat
temperature: '{{ [heat_set,min_set] | max }}'
action: climate.set_temperature
- data:
entity_id: input_number.whynter_portable_heatpump_hvac_last_set_temp
value: '{{ [heat_set,min_set] | max }}'
action: input_number.set_value
- conditions:
condition: template
value_template: |
{{ do_max_cool }}
sequence:
- data:
entity_id: climate.whynter_arc_1230wnh
hvac_mode: cool
temperature: '{{ max_set }}'
action: climate.set_temperature
- data:
entity_id: input_number.whynter_portable_heatpump_hvac_last_set_temp
value: '{{ max_set }}'
action: input_number.set_value
- conditions:
condition: template
value_template: |
{{ do_min_heat }}
sequence:
- data:
entity_id: climate.whynter_arc_1230wnh
hvac_mode: heat
temperature: '{{ min_set }}'
action: climate.set_temperature
- data:
entity_id: input_number.whynter_portable_heatpump_hvac_last_set_temp
value: '{{ min_set }}'
action: input_number.set_value