Ok, I am fairly new with Hassio, and have a question with regards to the use of the generic thermostat.
I built a thermostat a while ago using python on a raspberry pi and relays, and recently came across the video by Drzzs regarding his thermostat, and now would like to move away from such a large-ish design for my DIY thermostat to the new wemos/relay Hassio based thermostat.
I do not have a split AC and Heat system, which would be really easy and I would rest easy with that basic component, but I have a heat pump, which must have the reversing valve energized for cooling mode. So, in testing with hassio (on a breadboard w/ LEDs) and with the experience from the old pi thermostat, I need to energize the reversing valve and the compressor for the cooling to happen. What I have done in my hassio testing is to setup a switch group to energize those two switches for cooling, and only the compressor line for heating, which seems to work (with the LEDs).
My question is, with a heat pump, is this the right way to go?
climate:
- platform: generic_thermostat
name: "AC"
heater: group.air_conditioner
target_sensor: sensor.average_house_temp
min_temp: 40
max_temp: 90
initial_operation_mode: "off"
min_cycle_duration:
minutes: 10
target_temp: 76
away_temp: 80
cold_tolerance: 1.0
hot_tolerance: 1.0
precision: 1.0
ac_mode: true
- platform: generic_thermostat
name: "Heat"
heater: group.heater
target_sensor: sensor.average_house_temp
min_temp: 40
max_temp: 90
initial_operation_mode: "off"
min_cycle_duration:
minutes: 10
target_temp: 68
away_temp: 62
cold_tolerance: 1.0
hot_tolerance: 1.0
precision: 1.0
ac_mode: false
###Group Switches###
air_conditioner:
name : Air Conditioner
view : no
entities:
- switch.reversing_valve
- switch.compressor
heater:
name : Heater
view : no
entities:
- switch.compressor
#
I would cycle the reversing valve based on the system mode, not on the call for cooling. I would also be careful going down the DIY road with HVAC systems. If you aren’t careful you can damage the compressor.
I appreciate the feedback, but when HA calls for a change in the reversing valve state, I still need it to call for the compressor and fan to run. Do you have an idea as to what I could setup, or an alias maybe, that if it calls for heat then toggle the reversing valve off, and the compressor and fan on, and vice versa for cooling, toggle the reversing valve on as well as the compressor and fan?
Also, I completely agree with you about being careful with the DIY on HVAC Systems, which is why I haven’t swapped anything out yet, as it could be a costly mistake. I want to make sure that I have it right, then test, verify, test some more, verify, and test even more.
I think I will take back my recommendation on the system mode trigger. I can’t find anything conclusive about it, but found one that says it cycles with the cooling command. Might check with a multimeter to see what it does.
The reversing valve is a solenoid that more than likely fails to heating instead of cooling. If it energized, the refrigeration cycle reverses for cooling. You only need to energize the reversing valve for a single mode. That usually depends on the brand.
As far as the fan is concerned, the easiest way would be to jumper from Y (compressor) to G (fan) so that the fan always runs with the compressor. However, do you only want it to run when the compressor? Do you want an Auto/On for the fan? Then maybe something like:
input_select:
climate_fan_mode:
options:
- 'On'
- Auto
automation:
alias: climate fan mode control
trigger:
- platform: state
entity_id: input_select.climate_fan_mode, switch.compressor
action:
- service_template: >
{% set m = 'input_select.climate_fan_mode' %}
{% set s = 'switch.compressor' %}
homeassistant.turn_o{% if is_state(m,'On') %}n
{% elif is_state(m,'Auto') and is_state(s,'on') %}n
{% else %}ff{% endif %}
entity_id: switch.fan
Not specifying the states for the trigger will make it trigger on any change from either, then evaluate in the action to turn on or turn off the fan.
Service templates are something that I haven’t had the chance to delve into yet, but that is a great idea. So, from what I understand about this automation, is that instead of having the switch group “air_conditioner” called from the “generic_thermostat” when calling for cool, it calls this service template instead.
The service template would set the climate fan mode (set m) to on when the switch.compressor (set s) is running. That template is tied to the switch.fan entity action for call. That all makes sense, but now I have another question or assumption to bounce against you. What would be your opinion on expanding or duplicating this template to include the heating option. Something along the lines of climate.set_hvac_mode (set c) to heat, then trigger the switch.fan entity only and not the switch.reversing valve, or even more so, trigger the service template based on the hvac_mode, which would set the state of the switch.reversing_valve.
Your assumption is correct with regard to the reversing valve being required to be energized to operate in cooling mode, and when the relay fails it defaults to heat (or or when normally open is calls for heat).
I sincerely appreciate your help and willingness for me bouncing ideas off of you.
I would keep the automations free from each other to keep things simple
The service template is doing a couple things, but I don’t think you read it correctly.
The ‘set’ is only setting the following as a variable to shorten the characters needed for the logic.
The way I interpret the sequence for the fan is this:
When the Fan Mode is set to On, the Fan is turned on regardless of the call for compressor.
When the Fan Mode is set to Auto and Compressor is ON, the Fan is turned on.
Else, turn the fan off. Which should be Fan Mode is Auto and Compressor is OFF.
This was not to replace the switch groups you have already, but working with them.
As an example for the reversing valve, you only need to evaluate the cooling entity to turn on the reversing valve otherwise it is off. I don’t have experience with the generic thermostats but this is how I would interact with my Zwave thermostat
automation:
alias: climate reversing valve control
trigger:
- platform: state
entity_id: climate.ac
action:
- service_template: >
homeassistant.turn_o{% if is_state('climate.ac','cool') %}n
{% else %}ff{% endif %}
entity_id: switch.rev_valve
If the system is the Cooling Mode, turn ON the reversing valve.
Else, turn the reversing valve OFF.