My Nest Thermostat card config using thermostat-dark-card

Hello,
I turned on the heating plant last night. In the living room it was 22 degrees and I set the central heating to 24 degrees to do the test.
The problem is that the time it takes to reach 24 degrees was 10 minutes and in the application it was 1 hour 30 minutes.

Where did I go wrong ?

The code is:

template:
  - sensor:
    - name: "Living Room Time to Temp"
      unique_id: living_room_time_to_temp
      icon: mdi:camera-timer
      unit_of_measurement: 'minutes'
      state: "{{ ((state_attr('climate.living_room','temperature')|float(0) - states('sensor.living_room_temperature')|float(0)) * state_attr('sensor.living_room_time_to_temp','rate_of_change')|float(0)/60)|abs|int }}"
      attributes:
        message: |
          {% if states('sensor.living_room_time_to_temp')|float(0) < 10 %}
           IN LESS THAN 10 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 16 %}
           IN 15 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 21 %}
           IN 20 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 26 %}
           IN 25 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 31 %}
           IN 30 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 36 %}
           IN 35 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 41 %}
           IN 40 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 46 %}
           IN 45 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 51 %}
           IN 50 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 56 %}
           IN 55 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 61 %}
           IN 1 HR
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 66 %}
           IN 1 HR 5 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 71 %}
           IN 1 HR 10 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 76 %}
           IN 1 HR 15 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 81 %}
           IN 1 HR 20 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 86 %}
           IN 1 HR 25 MIN
          {% elif states('sensor.living_room_time_to_temp')|float(0) < 191 %}
           IN 1½ HR
          {% else %}
           IN 2+ HR
          {% endif %}

You seem to be missing most of the attributes for the sensor.living_room_time_to_temp:

  - name: "Living Room Time to Temp"
    unique_id: living_room_time_to_temp
    icon: mdi:camera-timer
    unit_of_measurement: 'minutes'
    state: "{{ ((state_attr('climate.living_room','temperature')|float(0) - states('sensor.living_room_temperature')|float(0)) * state_attr('sensor.living_room_time_to_temp','rate_of_change')|float(0)/60)|abs|int }}"
    attributes:
      message: |
        {% if states('sensor.living_room_time_to_temp')|float(0) < 10 %} IN LESS THAN 10 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 16 %} IN 15 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 21 %} IN 20 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 26 %} IN 25 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 31 %} IN 30 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 36 %} IN 35 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 41 %} IN 40 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 46 %} IN 45 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 51 %} IN 50 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 56 %} IN 55 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 61 %} IN 1 HR
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 66 %} IN 1 HR 5 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 71 %} IN 1 HR 10 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 76 %} IN 1 HR 15 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 81 %} IN 1 HR 20 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 86 %} IN 1 HR 25 MIN
        {% elif states('sensor.living_room_time_to_temp')|float(0) < 191 %} IN 1½ HR
        {% else %} IN 2+ HR
        {% endif %}
      time_of_current_change_to_heating: >
        {{ states('input_datetime.hvac_current_heat_started') }}
      time_of_last_change_to_heating: >
        {{ states('input_datetime.hvac_heat_started') }}
      time_of_last_change_from_heating: >
        {{ states('input_datetime.hvac_heat_ended') }}
      elapsed_seconds: >
        {{ as_timestamp(states('input_datetime.hvac_heat_ended')) - as_timestamp(states('input_datetime.hvac_heat_started')) }}
      temp_at_last_change_to_heat: >
        {{ states('input_number.hvac_heat_start_temp') }}
      temp_at_last_change_from_heat: >
        {{ states('input_number.hvac_heat_end_temp') }}
      degrees_of_separation: >-
          {{ (states('input_number.hvac_heat_end_temp')|float(0) - states('input_number.hvac_heat_start_temp')|float(0))|abs|round(1,"even",0) }}
      rate_of_change: >
        {% if state_attr('sensor.living_room_time_to_temp', 'degrees_of_separation')|float(0) > 0 %}
         {{ state_attr('sensor.living_room_time_to_temp', 'elapsed_seconds')|float(0) / state_attr('sensor.living_room_time_to_temp', 'degrees_of_separation')|float(0) }}
        {% else %}
         0
        {% endif %}
      current_temp: >
        {{ states('sensor.living_room_temperature') }}
      target_temp: >
        {{ state_attr('climate.living_room','temperature') }}
      last_estimated_time_to_temp: >
        {{ ((state_attr('sensor.living_room_time_to_temp','temp_at_last_change_from_heat')|float(0) - state_attr('sensor.living_room_time_to_temp','temp_at_last_change_to_heat')|float(0)) * state_attr('sensor.living_room_time_to_temp','rate_of_change')|float(0))|abs|timestamp_custom('%H:%M:%S', true) }}

Hoping @dbrunt or someone else can provide guidance as to why the 4 icons do not appear on my thermostat card and also why the secondary card Nest Setpoint shows 160 degrees as opposed to 71 and Nest Temperature shows 159.8. I changed the Outside Temp on the thermostat card to use openweather temp instead of sensor.nest_outside_temperature cause it currently shows 142 degrees. Let me know what else I can provide to further assist with this issue.

You’ve got something amiss in your template sensors!
You’d have to check your yaml config for sensor.nest_setpoint and sensor.nest_temperature.

sensor:
  - name: "Nest Setpoint"
    unique_id: nest_setpoint
    device_class: temperature
    unit_of_measurement: '°C'
    state: "{{ state_attr('climate.living_room', 'temperature') }}"

  - name: "Nest Temperature"
    unique_id: nest_temperature
    device_class: temperature
    unit_of_measurement: '°C'
    state: "{{ state_attr('climate.living_room','current_temperature')|round(1, 'half', default=0) }}"

What is the entity_id for your Nest thermostat?

My Nest Thermostat is called: climate.living_room
I believe I had the same as you, but I copy & pasted over it just in case, here’s my code:

- name: "Nest Setpoint"
  unique_id: nest_setpoint
  device_class: temperature
  unit_of_measurement: '°C'
  state: "{{ state_attr('climate.living_room', 'temperature') }}"

- name: "Nest Time to Temp Message"
  unique_id: nest_time_to_temp_message
  state: >
    {% if state_attr('climate.living_room','hvac_action') == 'off' %} SYSTEM IS OFF
    {% elif state_attr('climate.living_room','hvac_action') == 'idle' and states('climate.living_room') == 'heat' %} HEAT SET TO
    {% elif state_attr('climate.living_room','hvac_action') == 'idle' and states('climate.living_room') == 'cool' %} COOLING SET TO
    {% else %} {{ state_attr('sensor.living_room_time_to_temp','message') }}
    {% endif %}
  attributes:
    hvac_action: "{{ state_attr('climate.living_room','hvac_action') }}"

- name: "Nest Temperature"
  unique_id: nest_temperature
  device_class: temperature
  unit_of_measurement: '°C'
  state: "{{ state_attr('climate.living_room','current_temperature')|round(1, 'half', default=0) }}"

Well, if you truly have what you say, and you are still seeing 160 °F, then you must also being seeing 160 °F here in dev tools, and in the Nest app!

No, in Dev Tools it shows the correct information as reported by the Nest Thermostat.
Would it be effected by another sensor that shows that correct temp but with different entity_ids such as:
sensor.living_room_setpoint: 71
sensor.living_room_temperature: 71
If I use these entities that show the correct numbers, would I have to change your code elsewhere?

Okay, you appear to have climate.living_room
with attributes:
current_temperature: 71
temperature: 71

You appear to have

- name: "Nest Setpoint"
  unique_id: nest_setpoint
  device_class: temperature
  unit_of_measurement: '°C'
  state: "{{ state_attr('climate.living_room', 'temperature') }}"

- name: "Nest Temperature"
  unique_id: nest_temperature
  device_class: temperature
  unit_of_measurement: '°C'
  state: "{{ state_attr('climate.living_room','current_temperature')|round(1, 'half', default=0) }}"

Therefore you should see…
{{ states('sensor.nest_setpoint') }} as “71” and
{{ states('sensor.nest_temperature') }} as “71”

and you should be seeing…

In Dev Tools → STATES you can filter the states of all entities to find the entity that is 160 °F and the one that is 159.8 °F (or whatever values you currently are seeing):

Whoa, wait a sec, I see the problem!!!

image

Change this:

- name: "Nest Setpoint"
  unique_id: nest_setpoint
  device_class: temperature
  unit_of_measurement: '°C'
  state: "{{ state_attr('climate.living_room', 'temperature') }}"

- name: "Nest Temperature"
  unique_id: nest_temperature
  device_class: temperature
  unit_of_measurement: '°C'
  state: "{{ state_attr('climate.living_room','current_temperature')|round(1, 'half', default=0) }}"

To this:

- name: "Nest Setpoint"
  unique_id: nest_setpoint
  device_class: temperature
  unit_of_measurement: '°F'
  state: "{{ state_attr('climate.living_room', 'temperature') }}"

- name: "Nest Temperature"
  unique_id: nest_temperature
  device_class: temperature
  unit_of_measurement: '°F'
  state: "{{ state_attr('climate.living_room','current_temperature')|round(1, 'half', default=0) }}"

That did the trick, thank you! Any idea why the icons won’t appear on the Thermostat Card?

Mine’s broke too! Until such time as I fix the svg+xml code I spents days (if not weeks) developing well over a year ago, or find a good alternative for it, here is a temporary solution using HA native mdi icons:

  - type: horizontal-stack
    card_mod:
      style: |
        ha-card {
          border: none;
          {% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
            background: #EB6D00;
            border-bottom: 1pt solid #E65E00;
          {% else %}
            {% if is_state_attr('climate.living_room', 'hvac_action', 'cooling') %}
              background: #0055FF ; 
              border-bottom: 1pt solid #00008B;
            {% else %}
              background: #373F48 ;
              border-bottom: 1pt solid #2b333a;
            {% endif %}
          {% endif %}
        }
    cards:
      - type: custom:button-card
        entity: sensor.nest_hvac_mode
        name: MODE
        show_name: true
        tap_action:
          action: more-info
        color_type: icon
        state:
          - operator: template
            value: |
              [[[ return states['climate.living_room'].state === 'off' ]]]
            icon: mdi:waves
            color: white
          - operator: template
            value: |
              [[[ return states['climate.living_room'].state === 'heat' ]]]
            icon: mdi:waves
            color: white
          - operator: template
            value: |
              [[[ return states['climate.living_room'].state === 'cool' ]]]
            color: blue
            icon: mdi:waves
        show_state: false
        card_mod:
          style: |
            ha-card {
              color: white;
              border: none;
              font-size: .8rem !important;
              {% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
                background: #EB6D00;
                border-bottom: 1pt solid #E65E00;
              {% else %}
                {% if is_state_attr('climate.living_room', 'hvac_action', 'cooling') %}
                  background: #0055FF ; 
                {% else %}
                  background: #373F48 ;
                {% endif %}
              {% endif %}
            }
      - type: custom:button-card
        entity: sensor.nest_preset_mode
        name: ECO
        label: ECO
        tap_action:
          action: more-info
        color_type: icon
        state:
          - operator: template
            value: >
              [[[ return states['climate.living_room'].attributes.preset_mode ==
              'none' ]]]
            icon: mdi:leaf-off
            color: white
          - operator: template
            value: >
              [[[ return states['climate.living_room'].attributes.preset_mode ==
              'eco' ]]]
            icon: mdi:leaf
            color: white
        show_state: false
        show_name: true
        card_mod:
          style: |
            ha-card {
              color: white;
              border: none;
              font-size: .8rem !important;
              {% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
                background: #EB6D00;
              {% else %}
                {% if is_state_attr('climate.living_room', 'hvac_action', 'cooling') %}
                  background: #0055FF ; 
                {% else %}
                  background: #373F48 ;
                  border-bottom: 1pt solid #2b333a;
                {% endif %}
              {% endif %}
            }
      - type: custom:button-card
        entity: climate.living_room
        name: SCHEDULE
        tap_action:
          action: more-info
        color_type: icon
        icon: mdi:calendar-clock-outline
        color: white
        show_state: false
        show_name: true
        card_mod:
          style: |
            ha-card {
              color: white;
              border: none;
              font-size: .8rem !important;
              {% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
                background: #EB6D00;
              {% else %}
                {% if is_state_attr('climate.living_room', 'hvac_action', 'cooling') %}
                  background: #0055FF ; 
                {% else %}
                  background: #373F48 ;
                  border-bottom: 1pt solid #2b333a;
                {% endif %}
              {% endif %}
            }
      - type: custom:button-card
        entity: climate.living_room
        name: HISTORY
        tap_action:
          action: url
          url_path: https://home.nest.com/thermostat/02AA01AC28140A0G
        color_type: icon
        icon: mdi:history
        color: white
        show_state: false
        show_name: true
        card_mod:
          style: >
            ha-card {
              color: white;
              border: none;
              font-size: .8rem !important;
              {% if is_state_attr('climate.living_room', 'hvac_action', 'heating') %}
                background: #EB6D00;
              {% else %}
                {% if is_state_attr('climate.living_room', 'hvac_action', 'cooling') %}
                  background: #0055FF ; 
                  border-bottom: 1pt solid #00008B;
                {% else %}
                  background: #373F48 ;
                {% endif %}
              {% endif %}
            }
1 Like

Thanks for all your help!

Hi Daniel, can you tell me what this sensor is used for? I don’t see it referenced anywhere else…

- name: “Nest Heating Runtime”
  unique_id: nest_heat_runtime
  unit_of_measurement: ‘seconds’
  state: “{{state_attr(‘climate.living_room’,‘elapsed_seconds’)|float(0) }}”

Also, should 191% be 91%?

{% elif states('sensor.dining_room_time_to_temp')|float(0) < 86 %} In 1 Hour 25 Minutes
{% elif states('sensor.dining_room_time_to_temp')|float(0) < 191 %} In 1½ Hour

Seems like all other time increment in 5% …

Yep! Fat fingers!

I’ve no idea now! It’s not referenced anywhere else in my config either!
image

hello
can someone help me I have the thermostat working but wen i click to schedule i don’t receive a schedule but a thermostat? Is there something i can do to receive the schedule ?

You need to have the Scheduler integration installed.

image

image