{"id":13585021,"url":"https://github.com/jcwillox/hass-template-climate","last_synced_at":"2025-03-17T14:12:22.502Z","repository":{"id":38036703,"uuid":"226446134","full_name":"jcwillox/hass-template-climate","owner":"jcwillox","description":"❄️Templatable Climate Device for Home Assistant, Supports Running Actions On Service Calls.","archived":false,"fork":false,"pushed_at":"2024-07-20T07:58:39.000Z","size":68,"stargazers_count":134,"open_issues_count":34,"forks_count":38,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-11T03:43:46.690Z","etag":null,"topics":["climate","hacs","homeassistant","template"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcwillox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"ko_fi":"jcwillox"}},"created_at":"2019-12-07T02:50:18.000Z","updated_at":"2024-10-05T22:18:31.000Z","dependencies_parsed_at":"2023-02-01T00:00:36.096Z","dependency_job_id":"b5eb4a3d-f1d0-4ce4-98b3-8403f2ce8451","html_url":"https://github.com/jcwillox/hass-template-climate","commit_stats":{"total_commits":35,"total_committers":5,"mean_commits":7.0,"dds":0.3142857142857143,"last_synced_commit":"594041e6d64357676e17b17572d4a9dcf9a63dc7"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcwillox%2Fhass-template-climate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcwillox%2Fhass-template-climate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcwillox%2Fhass-template-climate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcwillox%2Fhass-template-climate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcwillox","download_url":"https://codeload.github.com/jcwillox/hass-template-climate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241960888,"owners_count":20049344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["climate","hacs","homeassistant","template"],"created_at":"2024-08-01T15:04:41.349Z","updated_at":"2025-03-05T04:14:47.759Z","avatar_url":"https://github.com/jcwillox.png","language":"Python","funding_links":["https://ko-fi.com/jcwillox"],"categories":["Python"],"sub_categories":[],"readme":"# ❄️ Template Climate\n\n[![HACS Badge](https://img.shields.io/badge/HACS-Custom-41BDF5.svg?style=for-the-badge)](https://github.com/hacs/integration)\n[![License](https://img.shields.io/github/license/jcwillox/hass-template-climate?style=for-the-badge)](https://github.com/jcwillox/hass-template-climate/blob/main/LICENSE)\n[![Latest Release](https://img.shields.io/github/v/release/jcwillox/hass-template-climate?style=for-the-badge)](https://github.com/jcwillox/hass-template-climate/releases)\n[![Size](https://img.badgesize.io/https:/github.com/jcwillox/hass-template-climate/releases/latest/download/climate_template.zip?style=for-the-badge)](https://github.com/jcwillox/hass-template-climate/releases)\n[![Code style](https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge)](https://github.com/psf/black)\n\nThe `climate_template` platform creates climate devices that combine integrations and provides the ability to run scripts or invoke services for each of the `set_*` commands of a climate entity.\n\n## Configuration\n\nAll configuration variables are optional. The climate device will work in optimistic mode (assumed state) if a template isn't defined.\n\nIf you do not define a `template` or its corresponding `action` the climate device will not have that attribute, e.g. either `swing_mode_template` or `set_swing_mode` must be defined for the climate to have a swing mode.\n\n| Name                             | Type                                                                      | Description                                                                                                                                                                                                                                                                                     | Default Value                                      |\n| -------------------------------- | ------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------- |\n| name                             | `string`                                                                  | The name of the climate device.                                                                                                                                                                                                                                                                 | \"Template Climate\"                                 |\n| unique_id                             | `string`                                                                  | The [unique id](https://developers.home-assistant.io/docs/entity_registry_index/#unique-id) of the climate entity.                                                                                                                                                                                                                                                                 | None                                 |\n| icon_template                    | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template for the icon of the sensor.                                                                                                                                                                                                                                                  |                                                    |\n| entity_picture_template          | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template for the entity picture of the sensor.                                                                                                                                                                                                                                        |                                                    |\n| availability_template            | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the `available` state of the component. If the template returns `true`, the device is `available`. If the template returns any other value, the device will be `unavailable`. If `availability_template` is not configured, the component will always be `available`. | true                                               |\n|                                  |                                                                           |                                                                                                                                                                                                                                                                                                 |                                                    |\n| current_temperature_template     | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the current temperature.                                                                                                                                                                                                                                              |                                                    |\n| current_humidity_template        | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the current humidity.                                                                                                                                                                                                                                                 |                                                    |\n| min_humidity_template            | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the minimum target humidity.                                                                                                                                                                                                                                          |                                                    |\n| max_humidity_template            | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the maximum target humidity.                                                                                                                                                                                                                                          |                                                    |\n| target_humidity_template         | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the target humidity.                                                                                                                                                                                                                                                  |                                                    |\n| target_temperature_template      | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the target temperature of the climate device.                                                                                                                                                                                                                         |                                                    |\n| target_temperature_high_template | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the target temperature high of the climate device.                                                                                                                                                                                                                    |                                                    |\n| target_temperature_low_template  | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the target temperature low of the climate device.                                                                                                                                                                                                                     |                                                    |\n| hvac_mode_template               | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the hvac mode of the climate device.                                                                                                                                                                                                                                  |                                                    |\n| fan_mode_template                | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the fan mode of the climate device.                                                                                                                                                                                                                                   |                                                    |\n| preset_mode_template             | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the preset mode of the climate device.                                                                                                                                                                                                                                |                                                    |\n| swing_mode_template              | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the swing mode of the climate device.                                                                                                                                                                                                                                 |                                                    |\n| hvac_action_template              | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the [`hvac action`](https://developers.home-assistant.io/docs/core/entity/climate/#hvac-action) of the climate device.                                                                                                                                                                                                                                 |                                                    |\n|                                  |                                                                           |                                                                                                                                                                                                                                                                                                 |                                                    |\n| set_humidity                     | [`action`](https://www.home-assistant.io/docs/scripts)                    | Defines an action to run when the climate device is given the set humidity command. Can use `humidity` variable.                                                                                                                                                                                |                                                    |\n| set_temperature                  | [`action`](https://www.home-assistant.io/docs/scripts)                    | Defines an action to run when the climate device is given the set temperature command. Can use `temperature`, `target_temp_high`, `target_temp_low` and `hvac_mode` variables.                                                                                                          |                                                    |\n| set_hvac_mode                    | [`action`](https://www.home-assistant.io/docs/scripts)                    | Defines an action to run when the climate device is given the set hvac mode command. Can use `hvac_mode` variable.                                                                                                                                                                              |                                                    |\n| set_fan_mode                     | [`action`](https://www.home-assistant.io/docs/scripts)                    | Defines an action to run when the climate device is given the set fan mode command. Can use `fan_mode` variable.                                                                                                                                                                                |                                                    |\n| set_preset_mode                     | [`action`](https://www.home-assistant.io/docs/scripts)                 | Defines an action to run when the climate device is given the set preset mode command. Can use `preset_mode` variable.                                                                                                                                                                                |                                                    |\n| set_swing_mode                   | [`action`](https://www.home-assistant.io/docs/scripts)                    | Defines an action to run when the climate device is given the set swing mode command. Can use `swing_mode` variable.                                                                                                                                                                            |                                                    |\n|                                  |                                                                           |                                                                                                                                                                                                                                                                                                 |                                                    |\n| modes                            | `list`                                                                    | A list of supported hvac modes. Needs to be a subset of the default values.                                                                                                                                                                                                                     | [\"auto\", \"off\", \"cool\", \"heat\", \"dry\", \"fan_only\"] |\n| fan_modes                        | `list`                                                                    | A list of supported fan modes.                                                                                                                                                                                                                                                                  | [\"auto\", \"low\", \"medium\", \"high\"]                  |\n| preset_modes                     | `list`                                                                    | A list of supported preset modes.                                                                                                                                                                                                                                                               | [\"activity\", \"away\", \"boost\", \"comfort\", \"eco\", \"home\", \"sleep\"] |\n| swing_modes                      | `list`                                                                    | A list of supported swing modes.                                                                                                                                                                                                                                                                | [\"on\", \"off\"]                                      |\n|                                  |                                                                           |                                                                                                                                                                                                                                                                                                 |                                                    |\n| min_temp                         | `float`                                                                   | Minimum set point available.                                                                                                                                                                                                                                                                    | 7                                                  |\n| min_temp_template                | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the minimum set point available. Overrides value specified by `min_temp`.                                                                                                                                                                                             |                                                    |\n| max_temp                         | `float`                                                                   | Maximum set point available.                                                                                                                                                                                                                                                                    | 35                                                 |\n| max_temp_template                | [`template`](https://www.home-assistant.io/docs/configuration/templating) | Defines a template to get the maximum set point available. Overrides value specified by `max_temp`.                                                                                                                                                                                             |                                                    |\n| precision                        | `float`                                                                   | The desired precision for this device.                                                                                                                                                                                                                                                          | 0.1 for Celsius and 1.0 for Fahrenheit.            |\n| temp_step                        | `float`                                                                   | Step size for temperature set point.                                                                                                                                                                                                                                                            | 1                                                  |\n\n## Example Configuration\n\n```yaml\nclimate:\n  - platform: climate_template\n    name: Bedroom Aircon\n    modes:\n      - \"auto\"\n      - \"dry\"\n      - \"off\"\n      - \"cool\"\n      - \"fan_only\"\n    min_temp: 16\n    max_temp: 30\n\n    # get current temp.\n    current_temperature_template: \"{{ states('sensor.bedroom_temperature') }}\"\n\n    # get current humidity.\n    current_humidity_template: \"{{ states('sensor.bedroom_humidity') }}\"\n\n    # swing mode switch for UI.\n    swing_mode_template: \"{{ states('input_boolean.bedroom_swing_mode') }}\"\n\n    # available based on esphome nodes' availability.\n    availability_template: \"{{ is_state('binary_sensor.bedroom_node_status', 'on') }}\"\n\n    # example action\n    set_hvac_mode:\n      # allows me to disable sending commands to aircon via UI.\n      - condition: state\n        entity_id: input_boolean.enable_aircon_controller\n        state: \"on\"\n\n      # send the climates current state to esphome.\n      - service: esphome.bedroom_node_aircon_state\n        data:\n          temperature: \"{{ state_attr('climate.bedroom_aircon', 'temperature') | int }}\"\n          operation_mode: \"{{ states('climate.bedroom_aircon') }}\"\n          fan_mode: \"{{ state_attr('climate.bedroom_aircon', 'fan_mode') }}\"\n          swing_mode: \"{{ is_state_attr('climate.bedroom_aircon', 'swing_mode', 'on') }}\"\n          light: \"{{ is_state('light.bedroom_aircon_light', 'on') }}\"\n\n      # could also send IR command via broadlink service calls etc.\n```\n\n### Example action to control existing Home Assistant devices\n\n```yaml\nclimate:\n  - platform: climate_template\n    # ...\n    set_hvac_mode:\n      # allows you to control an existing Home Assistant HVAC device\n      - service: climate.set_hvac_mode\n        data:\n          entity_id: climate.bedroom_ac_nottemplate\n          hvac_mode: \"{{ states('climate.bedroom_ac_template') }}\"\n```\n\n### Use Cases\n\n- Merge multiple components into one climate device (just like any template platform).\n- Control optimistic climate devices such as IR aircons via service calls.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcwillox%2Fhass-template-climate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcwillox%2Fhass-template-climate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcwillox%2Fhass-template-climate/lists"}