ciotlosm / lovelace-thermostat-dark-card

🌡 Thermostat card with a round and black feel to it
MIT License
729 stars 186 forks source link

Allow me to specify an entity to display it's state inside the dial above the temperature... #271

Open danielbrunt57 opened 3 years ago

danielbrunt57 commented 3 years ago

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like I'd like the ability to specify an entity I've created which carries a message based upon a calculated time-to-temp. See screenshot below...

Describe alternatives you've considered N/A

Additional context image

I am trying to emulate... image

The messages are from this sensor:

      nest_time_to_temp_message:
        friendly_name: Living Room Time to Temp
        value_template: >
          {% if state_attr('climate.living_room','hvac_action') == 'off' and states('climate.living_room') == 'heat' %}
            HEAT SET TO
          {% elif state_attr('climate.living_room','hvac_action') == 'off' and states('climate.living_room') == 'cool' %}
            COOLING SET TO
          {% else %}
            {{ state_attr('sensor.nest_time_to_temp','message') }}
          {% endif %}
        attribute_templates:
          hvac_action: >
            {{ state_attr('climate.living_room','hvac_action') }}

which pulls from here:

#   Climate            
      nest_time_to_temp:
        friendly_name: Living Room Time to Temp
        icon_template: mdi:camera-timer
        value_template: >
            {{ ((state_attr('climate.living_room','temperature')|float - states('sensor.living_room_temperature')|float) * state_attr('sensor.nest_time_to_temp','rate_of_change')|float/60)|abs|int }}
        attribute_templates:
          message: |
            {% if states('sensor.nest_time_to_temp')|float < 10 %}
             IN LESS THAN 10 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 16 %}
             IN 15 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 21 %}
             IN 20 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 26 %}
             IN 25 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 31 %}
             IN 30 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 36 %}
             IN 35 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 41 %}
             IN 40 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 46 %}
             IN 45 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 51 %}
             IN 50 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 56 %}
             IN 55 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 61 %}
             IN 1 HR
            {% elif states('sensor.nest_time_to_temp')|float < 66 %}
             IN 1 HR 5 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 71 %}
             IN 1 HR 10 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 76 %}
             IN 1 HR 15 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 81 %}
             IN 1 HR 20 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 86 %}
             IN 1 HR 25 MIN
            {% elif states('sensor.nest_time_to_temp')|float < 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 - states('input_number.hvac_heat_start_temp')|float)|abs|round(1) }}
          rate_of_change: >
            {% if state_attr('sensor.nest_time_to_temp', 'degrees_of_separation')|float > 0 %}
             {{ state_attr('sensor.nest_time_to_temp', 'elapsed_seconds')|float / state_attr('sensor.nest_time_to_temp', 'degrees_of_separation')|float }}
            {% 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.nest_time_to_temp','temp_at_last_change_from_heat')|float - state_attr('sensor.nest_time_to_temp','temp_at_last_change_to_heat')|float) * state_attr('sensor.nest_time_to_temp','rate_of_change')|float)|abs|timestamp_custom('%H:%M:%S', false) }}
ischorr commented 3 years ago

Agree this would be great. Or just in general, the option to include various extra already known information as text would be useful.