Comments (4)
Is this more what your aiming for, to turn a switch on/off based on the aircon state.
The section below set_hvac_mode
is just a standard automation action, so I generated this quickly with the UI and then copied the YAML version.
# ...
set_hvac_mode:
if:
- condition: state
entity_id: climate.bedroom_aircon
state: "off"
then:
- service: switch.turn_off
data: {}
target:
entity_id: switch.aircon
else:
- service: switch.turn_on
data: {}
target:
entity_id: switch.aircon
from hass-template-climate.
It can however the way I did it was with a service call to an ESPHome device and a custom bit of C code on that device to make use of the IRremoteESP8266 library, to construct and send the IR message. I don't have any experience with the Broadlink integration for Home Assistant, and I'm not sure how well it will work for this as aircons don't have discrete on/off or cool/fan IR codes, instead, they send the entire "state" of the aircon in one message.
In case it helps here's the configuration I use for my aircon.
climate:
- platform: climate_template
name: Bedroom Aircon
modes:
- "auto"
- "dry"
- "off"
- "cool"
- "fan_only"
min_temp: 16
max_temp: 30
current_temperature_template: '{{ states("sensor.bedroom_temperature") }}'
current_humidity_template: '{{ states("sensor.bedroom_humidity") }}'
swing_mode_template: '{{ states("input_boolean.bedroom_swing_mode") }}'
availability_template: '{{ is_state("binary_sensor.bedroom_node_status", "on") }}'
set_hvac_mode:
service: script.update_aircon_state
set_fan_mode:
service: script.update_aircon_state
set_temperature:
service: script.update_aircon_state
set_swing_mode:
service: script.update_aircon_state
script:
update_aircon_state:
alias: "Update Aircon State"
sequence:
- condition: state
entity_id: input_boolean.enable_aircon_controller
state: "on"
- service: esphome.bedroom_node_aircon_state
data:
temperature: '{{ state_attr("climate.bedroom_aircon", "temperature") | int }}'
operation_mode: '{{ states("climate.bedroom_aircon") }}'
fan_mode: '{{ state_attr("climate.bedroom_aircon", "fan_mode") }}'
swing_mode: '{{ is_state_attr("climate.bedroom_aircon", "swing_mode", "on") }}'
light: >
{% if light is defined %}
{{ light }}
{% else %}
{{ is_state("light.bedroom_aircon_light", "on") }}
{% endif %}
from hass-template-climate.
@jcwillox josh, thank you for your quick reply. The question is more how you map the values to update the 'new' entity.
You are for example working with scripts whereas I am working switches.
I am looking to map power on/off, temperature up and down, and state.
Is this possible?
from hass-template-climate.
@jcwillox Thank you for taking the time. The aim is to create a climate entity so I can use the same Lovelace cards as my other smart a/c's.
So I hoped with your project I would be able to make a mapping to create a climate entity (cfr. Universal media player ( https://www.home-assistant.io/integrations/universal/ ) which I used to build a media_player based on BroadLink generated switches)
from hass-template-climate.
Related Issues (20)
- [FR]: Target temperature step to 0.5 HOT 1
- `None` `hvac_action` should be allowed HOT 1
- How to install this template? HOT 3
- Set_temperature error HOT 1
- Moes UFO-R11 Zigbee IR blaster setup HOT 2
- hvac_mode_template HOT 10
- Template loop detected while rendering hvac_action_template
- Unable to see/set target temperature HOT 1
- [FR]: target_humidity_template and set_humidity
- target_temperature not visible HOT 2
- [FR]: set_hvac_action
- Error "running script requires passing in a context" | Fancoil Modbus Integration HOT 2
- [FR]: initial_hvac_mode HOT 1
- [FR]: Make possible to reload entities by reloading yaml
- How to change the target temperature when controlling the AC with an IR control
- Can't pass changed temperature to set_temperature script HOT 3
- [ISSUE] unique_id not working, name already use
- Target Temperature is never displayed and can't be set, also fan modes are not displayed HOT 13
- Entity state is always "Off" even though all controls work as expected HOT 7
- Cant set Target temp low and Target temp high with thermostat entity when in heat/cool mode
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 hass-template-climate.