neilimixamo / Home-Assistant-Quick-Look-Mobile

129 stars 6 forks source link

Optional Humidity on climate cards #36

Open RealityTest opened 4 months ago

RealityTest commented 4 months ago

I'm using temperature and humidity sensors that display the temperature for my climate control cards and it would be useful if the cards could also display humidity as an optional value right below or next to the temperature. Is there anything like this planned or would it be possible to add?

neilimixamo commented 4 months ago

image

Adding the following line of code as the climate label should do the trick : just replace climate.lounge (1) with your entity and, if necessary, current_temperature (2) and current_humidity (3) attributes to return the values you wish to display.

- type: custom:button-card 
  template: climate
  variables:
    entity: climate.lounge
    name: Salon
    battery: 
    label: "[[[return states['climate.lounge'].attributes.current_temperature.toFixed(1) + ' °C' + ' - ' + states['climate.lounge'].attributes.current_humidity.toFixed(0) + '%' ]]]"

image

neilimixamo commented 1 day ago

Hi @RealityTest, can we consider your issue resolved to close it ?