Comments (5)
https://gist.github.com/ALERTua/0e89f5279dd0e1de7ee270c9e718d8d2
based on https://github.com/custom-components/pyscript and https://github.com/ALERTua/ha_pyscript_modules
from ha-dual-smart-thermostat.
Hello, this was my need too but it doesn't seem that the component is designed to control one unit that has both a heat and cool function. My attempt was to set both the heater and cooler parameters to the same switch but it seems like it only uses the first one.
from ha-dual-smart-thermostat.
@ALERTua @dugancom does this help? I had the same issue as you guys (plus another annoying issue), I wanted to use this component to control an AC unit that I use for both heating and cooling, but with an external sensor because the one in the Unit is borderline useless.
To do this, I created two template switches that control the AC unit in different ways:
- platform: template
switches:
office_aircon_cool:
value_template: "{{is_state('climate.office_ac', 'cool')}}"
turn_on:
- service: climate.set_hvac_mode
data:
hvac_mode: cool
target:
entity_id: climate.office_ac
- service: climate.set_temperature
data:
hvac_mode: cool
temperature: "{{state_attr('climate.office_smart_thermostat', 'target_temp_low') | round(0, 'floor') }}"
target:
entity_id: climate.office_ac
turn_off:
service: climate.set_hvac_mode
data:
hvac_mode: "fan_only"
target:
entity_id: climate.office_ac
office_aircon_heat:
value_template: "{{is_state('climate.office_ac', 'heat')}}"
turn_on:
- service: climate.set_hvac_mode
data:
hvac_mode: heat
target:
entity_id: climate.office_ac
- service: climate.set_temperature
data:
hvac_mode: heat
temperature: "{{state_attr('climate.office_smart_thermostat', 'target_temp_high') | round(0, 'ceiling') }}"
target:
entity_id: climate.office_ac
turn_off:
service: climate.set_hvac_mode
data:
hvac_mode: "fan_only"
target:
entity_id: climate.office_ac
A couple of things to note here, as it might not be relevant to you:
My AC is really stupid, when you power it off it won't accept additional commands until it has done its power-off-clean-cycle, which can take up to 20mins to do - not ideal when I just want it to keep the temperature in check, so for these switches the "Off" function just sets the AC to fan-only mode, which will let it quickly switch back to heat or cool mode when it needs to.
My AC's built-in temperature sensor is also terrible but it tries to use it regardless, so in order to get it to actually heat or cool based off of the external temperature, I set the target temperature in the service call to a rounded number (up if heating, down if cooling) - so if you set the temperature to say 22.4, it'll be 22 in cooling mode or 23 in heating mode
Finally, with those two switches defined, I use them in this dual smart thermostat like so:
climate:
- platform: dual_smart_thermostat
name: Office smart Thermostat
heater: switch.office_aircon_heat
cooler: switch.office_aircon_cool
target_sensor: sensor.lumi_lumi_weather_temperature
min_temp: 18
max_temp: 26
target_temp: 22
target_temp_high: 22.0
target_temp_low: 21.0
cold_tolerance: 0.3
hot_tolerance: 0.3
min_cycle_duration:
seconds: 5
initial_hvac_mode: "heat_cool" # hvac mode will reset to this value after restart
heat_cool_mode: true
keep_alive:
minutes: 3
away: # this preset will be available for all hvac modes
temperature: 7
target_temp_low: 7
target_temp_high: 30
anti_freeze: # this preset will be available for all hvac modes
temperature: 7
target_temp_low: 7
target_temp_high: 30
comfort: # this preset will be available for all hvac modes
temperature: 22
target_temp_low: 21.0
target_temp_high: 22.0
home: # this preset will be available only for heat or cool hvac mode
temperature: 21
precision: 0.1
I have defined the anti_freeze
and away
profile for scheduling purposes, they're just there to effectively turn the AC off because I can't find a good way to actually switch it off since the "off" mode in both is defined as fan mode. Hope all that makes sense.
from ha-dual-smart-thermostat.
Yes, this would help. This was my first solution. But then I wrote my own script using Pyscript.
from ha-dual-smart-thermostat.
I'd be interested in learning more about your solution, @ALERTua, if you have something you're able to share?
from ha-dual-smart-thermostat.
Related Issues (20)
- Setting temperature in a preset mode changes preset mode none HOT 1
- The preset_mode is not a valid preset_mode: HOT 5
- typing errors in readme HOT 1
- [Question] Dual mode generic HOT 6
- Particular thermostat does not start or it dissapears after some time HOT 1
- [AUX heating] improve tolerance
- [AUX heating] set proper AUX heating mode for UI
- [AUX heating] Add option to keep primary heater on while aux heater is on
- [chore] Update required home assistatnt version
- Climate entity has no unique_id: Can't set Area HOT 4
- Feature request: additional attribute or hvac_state if thermostat is "idle" due to an "opening" HOT 13
- Fix hvac mode and temperature issues
- Thermostat supports climate.turn_off service but not climate.turn_on? HOT 1
- [docs] add unique_id to documentation
- ac_mode not working for me HOT 7
- [feature] Allow heater and cooler be the same entity in heat_cool_mode HOT 1
- [FEAT] - heat pump mode (dual with only one switch) HOT 1
- [bug]. wrong HVACAction is set. HOT 9
- Service climate: set temperature does not work HOT 2
- [feat] - add binary sensor for aux heater status
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha-dual-smart-thermostat.