Git Product home page Git Product logo

ha-thermostat-update's Introduction

Thermostat Update

GitHub Release hacs_badge Community Forum Buy me a coffee

This script updates Z-Wave thermostat entity (e.g. Danfoss 014G0013) state and current temperature from external sensor in the Home Assistant.

This script use Home Assistant python_script component.

You can install this script via HACS or just download thermostat_update.py file and save it in /config/python_scripts folder.

Go to HA community for support and help.

Configuration example

- id: update_thermostats
  alias: 'Update Thermostats'
  trigger:
    platform: state
    entity_id:
      - climate.thermostat_kitchen
      - climate.thermostat_bedroom
      - climate.thermostat_bathroom
      - sensor.temperature_kitchen
      - sensor.temperature_bedroom
      - sensor.temperature_bathroom
  condition:
    condition: template
    value_template: >-
      {% if "thermostat" in trigger.entity_id and trigger.to_state.attributes.current_temperature == none %}
         true
      {% elif "sensor" in trigger.entity_id %}
         true
      {% else %}
         false
      {% endif %}
  action:
    service: python_script.thermostat_update
    data_template:
      heat_state: 'auto'
      idle_state: 'idle'
      idle_heat_temp: 10
      thermostat: >-
         {% if "thermostat" in trigger.entity_id %}
            {{ trigger.entity_id }}
         {% else %}
            climate.thermostat_{{ trigger.entity_id | replace('sensor.temperature_', '') }}
         {% endif %}
      sensor: >-
         {% if "sensor" in trigger.entity_id %}
            {{ trigger.entity_id }}
         {% else %}
            sensor.temperature_{{ (trigger.entity_id | replace('climate.thermostat_', '')) }}
         {% endif %}

Configuration example for state only update

- id: update_thermostats
  alias: 'Update Thermostats'
  trigger:
    platform: state
    entity_id:
      - climate.thermostat_kitchen
      - climate.thermostat_bedroom
      - climate.thermostat_bathroom
  action:
    service: python_script.thermostat_update
    data_template:
      heat_state: 'auto'
      idle_state: 'idle'
      idle_heat_temp: 10
      thermostat: '{{ trigger.entity_id }}'

Script arguments

key optional type default description
thermostat False string thermostat entity_id
sensor True string sensor entity_id
heat_state True string heat name of heating state, changing this from default value will broke compatibility with HomeKit
idle_state True string off name of idle state, changing this from default value will broke compatibility with HomeKit
idle_heat_temp True float 8 temperature value between idle and heat states
state_only True boolean false with state_only set to true script will update only state of the thermostat
temp_only True boolean false with temp_only set to true app will update only current_temperature of the thermostat

ha-thermostat-update's People

Contributors

bieniu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.