Skip to content

Instantly share code, notes, and snippets.

@Ceralor
Last active August 13, 2020 03:27
Show Gist options
  • Save Ceralor/dc67404882fa33c649e5b66e56a7bde0 to your computer and use it in GitHub Desktop.
Save Ceralor/dc67404882fa33c649e5b66e56a7bde0 to your computer and use it in GitHub Desktop.
Simple Thermometer

thermostat

Simple elegant thermometer card for Home Assistant. Tweak as-needed!

- id: updatesetpoint
alias: Update Setpoint
description: Updates the input helper for setpoint
trigger:
- platform: state
entity_id: sensor.thermostat_setpoint
condition: []
action:
- service: input_number.set_value
entity_id: input_number.thermostat_setpoint
data_template:
value: '{{ states("sensor.thermostat_setpoint")|int }}'
- id: updatetherm
alias: Update Thermostat
mode: restart
description: Updates the thermostat for setpoint
trigger:
- platform: state
entity_id: input_number.thermostat_setpoint
condition: []
action:
- delay: 00:00:05
- service: climate.set_temperature
entity_id: climate.thermostat
data_template:
temperature: '{{ states("input_number.thermostat_setpoint")|int }}'
# Requires dual-gauge, stack-in-card, and paper-buttons-row
# Add this as a manual card, replace climate.thermostat with your thermostat entity
type: 'custom:stack-in-card'
title: Environment
cards:
- type: 'custom:dual-gauge-card'
inner:
entity: input_number.thermostat_setpoint
label: Set
unit: °F
min: 40
outer:
entity: climate.thermostat
attribute: current_temperature
label: Now
unit: °F
- type: 'custom:paper-buttons-row'
buttons:
- entity: binary_sensor.thermostat_heat
icon: 'mdi:fire'
name: false
tap_action:
action: call-service
service: climate.set_hvac_mode
service_data:
entity_id: climate.thermostat
hvac_mode: heat
- entity: binary_sensor.thermostat_cool
hold_action:
action: call-service
service: script.hvac_mode_off
icon: 'mdi:snowflake'
name: false
tap_action:
action: call-service
service: climate.set_hvac_mode
service_data:
entity_id: climate.thermostat
hvac_mode: cool
- name: false
icon: 'mdi:arrow-up-box'
tap_action:
action: call-service
service: input_number.increment
service_data:
entity_id: input_number.thermostat_setpoint
- name: false
icon: 'mdi:arrow-down-box'
tap_action:
action: call-service
service: input_number.decrement
service_data:
entity_id: input_number.thermostat_setpoint
- entity: binary_sensor.thermostat_fan_on
icon: 'mdi:fan'
name: false
tap_action:
action: call-service
service: climate.set_fan_mode
service_data:
entity_id: climate.thermostat
fan_mode: 'On'
- entity: binary_sensor.thermostat_fan_auto
hold_action:
action: call-service
service: climate.set_fan_mode
service_data:
entity_id: climate.thermostat
fan_mode: diffuse
icon: 'mdi:autorenew'
name: false
tap_action:
action: call-service
service: set_fan_mode
service_data:
entity_id: climate.thermostat
fan_mode: Auto
# Replace 'climate.thermostat' with your Thermostat entity ID.
# These can also be inserted into binary_sensors.yaml and sensors.yaml instead if you use them
binary_sensor:
- platform: template
sensors:
thermostat_heat:
friendly_name: Thermostat Heating
value_template: >-
{{ is_state('climate.thermostat','heat') }}
thermostat_cool:
friendly_name: Thermostat Cooling
value_template: >-
{{ is_state('climate.thermostat','cool') }}
thermostat_fan_on:
friendly_name: Thermostat Fan On
value_template: >-
{{ is_state_attr('climate.thermostat','fan_mode','on') or is_state_attr('climate.thermostat','fan_mode','diffuse') }}
thermostat_fan_auto:
friendly_name: Thermostat Fan Auto
value_template: >-
{{ is_state_attr('climate.thermostat','fan_mode','auto') or is_state_attr('climate.thermostat','fan_mode','diffuse') }}
sensor:
- platform: template
sensors:
thermostat_current_temperature:
friendly_name: Thermostat Current Temperature
value_template: '{{ state_attr("climate.thermostat","current_temperature") }}'
device_class: temperature
unit_of_measurement: '°F'
entity_id: climate.thermostat
thermostat_setpoint:
friendly_name: Thermostat Setpoint
value_template: '{{ state_attr("climate.thermostat","temperature") }}'
device_class: temperature
unit_of_measurement: '°F'
entity_id: climate.thermostat
thermostat_current_humidity:
friendly_name: Thermostat Current Humidity
value_template: '{{ state_attr("climate.thermostat","current_humidity") }}'
device_class: humidity
unit_of_measurement: '%'
entity_id: climate.thermostat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment