Skip to content

Instantly share code, notes, and snippets.

@lennon101
Last active October 21, 2024 00:56
Show Gist options
  • Save lennon101/e796312151172f93d749b564dafc3d26 to your computer and use it in GitHub Desktop.
Save lennon101/e796312151172f93d749b564dafc3d26 to your computer and use it in GitHub Desktop.
temp and rh card with decision tree to show if it's cooler outside than it is inside

This code produces the following card in HA. Dependences include:

2024-10-21_10 46 47_ShareX Rooms_–Home_Assistant-_Google_Chrome

How to use:

  1. replace the occurance of sensor.gw1100c_outdoor_temperature with your outdoor temperature
  2. replace the occurance of sensor.bedroom_temperature with your indoor temperature
type: vertical-stack
cards:
- type: custom:mushroom-title-card
title: BEDROOM DASHBOARD 🛌
subtitle: ""
- type: vertical-stack
cards:
- type: horizontal-stack
cards:
- type: custom:mini-graph-card
name: Temperature
entities:
- sensor.bedroom_temperature
show:
labels: true
color_thresholds:
- value: 30
color: "#f39c12"
- value: 23
color: "#d35400"
- value: 15
color: "#c0392b"
- type: custom:mini-graph-card
name: Humidity
entities:
- sensor.bedroom_humidity
show:
labels: true
color_thresholds:
- value: 90
color: "#1688A0"
- value: 70
color: "#D0E4F5"
- value: 60
color: "#F5F5F5"
- type: markdown
content: >-
{% if (states('sensor.gw1100c_outdoor_temperature') | float < states('sensor.bedroom_temperature') | float)%} <ha-icon icon="mdi:snowflake"></ha-icon> It is cooler outside than it is inside.
{% elif (states('sensor.gw1100c_outdoor_temperature') | float > states('sensor.bedroom_temperature') | float)%} <ha-icon icon="mdi:thermometer-alert"></ha-icon> It is hotter outside than it is inside.
{% endif %}
- Outside Temp: {{states('sensor.gw1100c_outdoor_temperature')}} °C
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment