Lovelace: Simple thermostat card

First read this and then do this might help as a temporary fix.

1 Like

Is there a way to have an icon display for a sensor state? I have window sensors and I’d like to have an icon or entity_picture shown within the card, either in the list of sensors, or as an additional button in the controls section.

You may set icon under sensors (see the last one ), but in my knowledge icon is fixed, no template based on state:

  type: custom:simple-thermostat
  entity: climate.tado_smart_thermostat_ruxxxxxxxxx
  sensors:
    - entity: sensor.derivate_temp_living_room
      name: Trend temperatura
    - entity: sensor.state_current_temp_smart_radiator_living_room
      name: Termosifone grande
      unit: °C
    - entity: sensor.state_temperature_smart_radiator_living_room
      name: Impostata
      unit: °C
    - entity: input_number.tado_offset_smart_radiator
      name: Offset
    - entity: climate.tado_smart_radiator_thermostat_vaxxxxxx
      name: State
      attribute: hvac_action
    - entity: sensor.vitodens_totalgas_year_euro
      decimals: 1
      unit: €
      icon: mdi:math-integral

Yeah, I attempted to use various if methods etc and the icon never displays unless it’s a plain icon.

Another issue I now have:
–st-mode-active-background has no function at all. --st-mode-background works fine, but --st-mode-active-background doesn’t change the button color.
This should turn the orange button red, but does not:

I’m using the version with the fix for the +/- buttons being too dark.

Hello, I need to change the status color of the window.
when open, then one color, when closed, then another.
tell me how to do it.
thank you in advance.

scr

Hi,
i use this and it works:

For inactive preset buttons like “manual, eco, boost…” and my inactive hvac “auto” button:

ha-card .mode-item {
      background: grey;
      color: white;
      --st-spacing: 0px;
      border-radius: 20px;
    }

For active preset buttons:

    ha-card .mode-item.active { 
      background: blue;
      color: white;
    }

For active hvac “off” button → Thats what you want

    ha-card .mode-item.active.off {
      background: red;
      color: white;
    }

You can find the hvac button names in the “/config/www/community/simple-thermostat/simple-thermostat.js”

.mode-item.active.off
.mode-item.active.heat
.mode-item.active.cool
.mode-item.active.heat_cool
.mode-item.active.auto
.mode-item.active.dry
.mode-item.active.fan_only

My Questions are:

  • How can i change the button size, if i use 2 rows like the picture
  • How can i put all buttons (hvac and preset) in one row

grafik
grafik

Thank you

1 Like

Thanks, that was the one that did the trick.

Hi,

the question regarding the button size has been settled. I solved it as follows (width & margin):

    ha-card .mode-item {
      background: grey;
      color: black;
      --st-spacing: 0px;
      border-radius: 18px;
      width: 140px;
      margin: auto;     
    }

Can someone help

  1. Is it possible to put hvac and preset buttons in a row?
    and
  2. How can I set a name in the header without opening the entity’s properties when I click?

Thank you

Is it possible to remove one of the mode buttons? My thermostat does not have the cool_heat option, despite having the button for it on the lovelace card, so I would like to remove it from the card altogether.

As noted various times in this thread: :slight_smile:

2 questions:

  • In dark mode the increase/decrease temperature buttons are not visible. Is there a way to change the color of the icons?

  • Where does the card get the “currently” temperature from? How do I tell the card which entity to use? If not possible, how do I hide it? The yaml below doesn’t seem to work.

hide:
- temperature: true

Hi,

the current temperature comes from the thermostat (hvac entity). If you want to integrate a different sensor, try this. “Hide temperature” and “hide state” works too (see my code):

entity: climate.zigbee_h01
header:
  name: test
  icon: false
sensors:
  - icon: mdi:thermometer
    entity: sensor.zigbee_t07_temperature
  - icon: mdi:water-percent
    entity: sensor.zigbee_t07_humidity
step_size: '0.5'
step: column
hide:
  temperature: true
  state: true

Did you indent “temperature”?

Yes I did indent, but I had a ‘-’. My mistake.

This is what I have now. I am quite happy with it.

type: custom:simple-thermostat
entity: climate.office_ac_remote
header: false
layout:
  mode:
    names: true
    icons: true
    headings: false
  step: column
  sensors:
    labels: true
hide:
  state: false
  temperature: true
step_size: '1'
decimals: '0'
sensors:
  - entity: sensor.broadlink_lv_remote_temperature
    name: Current
  - entity: sensor.office_ac_power
    name: Power
control:
  hvac:
    heat:
      include: false
    heat_cool:
      include: false
    dry:
      include: false
  fan:
    _hide_when_off: true
    quiet:
      include: false
    mid:
      include: false

Make sure you updated to the latest version of the card, the icon color should be fixed in that.

1 Like

I have a honeywell thermostat and by default this card dont show humidity. I can see in development tools current_humidity as option but cannot seem to get it to display using sensor option. do i also need to add sensor in yamlconfig? if so any examples?

EDIT…I got it! used attribute: current_humidity

Now i need to figure out how to hide presets :slight_smile:

Dear all,
I have a rendering issue with this card.
I need to replace the current temperature sensor exposed by my Tado with this average sensor

- platform: average
    name: 'Average rooms temperature'
    entities:
      - sensor.deumidificatore_simone_am2301_temperature
      - sensor.riscaldamento_temperature
      - sensor.sensore_stanza_chiara_temperature
      - sensor.deumidificatore_stanza_da_letto_am2301_temperature

so I wrote this code

type: custom:simple-thermostat
entity: climate.riscaldamento
version: 3
sensors:
  - id: temperature
    label: '{{ui.currently}}'
    template: '{{states("sensor.average_rooms_temperature")|formatNumber }}'
  - entity: sensor.deumidificatore_simone_am2301_temperature
  - entity: sensor.sensore_stanza_chiara_temperature
  - entity: sensor.deumidificatore_stanza_da_letto_am2301_temperature
  - entity: sensor.riscaldamento_temperature
setpoints:
  temperature: 21
decimals: '1'

Unfortunately, this card is rendered blank in Lovelace.
Where is my mistake?

I solved with

sensors:
  - id: temperature
    label: '{{ui.currently}}'
    template: '{{ sensor.average_rooms_temperature|formatNumber }}'

I’m loving this card! Thanks for creating and maintaining it.

For now I’m trying to do the following:
I have one entity which is the thermostat. Unfortunately the thermostat only tells me if it’s in heating mode, but the actual valve for activating the heating is another entity. I have solved it so that I will be able to see the state of that other entity between the sensors.
However I would love to see if it’s possible to use the main icon in the header to show this.

So the question is: how can I control the header icon (Show or type, or even color) based on the state of another entity.

entity: climate.woonkamer_wk_thermostaat_375
type: custom:simple-thermostat
header:
  name: Woonkamer
step_size: '0.5'
sensors:
  - entity: sensor.woonkamer_wk_kamertemperatuur_377
    icon: mdi:thermometer
  - entity: sensor.woonkamer_wk_kamervochtigheid_378
    icon: mdi:water-percent
  - entity: switch.woonkamer_convectorputklep_277
    icon: mdi:power
  - entity: climate.woonkamer_wk_thermostaat_375
    icon: mdi:battery-40
    attribute: battery_level
hide:
  temperature: true
  state: true
control: false
icon:
  - entity: switch.woonkamer_convectorputklep_277
    'on': mdi:power-on
    'off': mdi:power-off

As you can see I tried to do something below with icon and then mentioning the device which I would like to control the icon. This however won’t work.

So I’ve had the custom:simple-thermostat card for my ventilation system. Now all of a sudden, without changing anything, the arrows for setting the temp doesn’t show anymore?

Before:
image

Now:

Edit:
Seems like the arrows also disapeared from my ipad dash aswell.

EDIT 2:
Sorry - saw I was missing an update. All good now :slight_smile:

1 Like

Sorry @bouwew, I really can’t figure this out. I’ve been trying and trying but I can’t even figure out where to put the sensor from which the data should be taken from.
Here’s my code so far:

card:
  type: custom:simple-thermostat
  version: 3
  entity: climate.radiator_livingroom_dx
  header:
    name: Radiator livingroom dx
  decimals: '1'
  unit: °C
  step_size: '0.5'
  control: false
  faults: false
  layout:
    step: row
    mode:
      headings: false
      icons: false
      names: false
  sensors:
    - entity: sensor.livingroom_dx_multisensor_air_temperature
      name: Current temperature
    - id: temperature
      label: '{{ui.currently}}'
      template: '{{sensor.livingroom_average_temperature|float}}'
conditions:
  - entity: sensor.seasons_boolean
    state: cold
type: conditional