simple-thermostat icon indicating copy to clipboard operation
simple-thermostat copied to clipboard

Hide state brackets text and button color/text

Open sharonna511 opened this issue 2 years ago • 8 comments

Describe the bug Hello How can i hide the state text part that is in brackets (Heat) (Off) ?

My thermostat (home assistant generic thermostat) has the hvac modes off/heat and it has the hvac actions off/idle/heating.

Is there any way i can make it that the button color is grey in idle and only orange when heating ? Also the text on the button says heat i would like it to read idle when idle and Heat when heating.

I also tried with version: 3, but then operation only says idle/heat and no heating anymore.

Thanks for your help.

YAML `type: custom:simple-thermostat entity: climate.martin_thermostat sensors:

  • entity: sensor.martin_humidity name: Humidity layout: mode: names: true icons: true headings: false header: name: Martin faults:
    • entity: binary_sensor.window_martin icon: mdi:window-open-variant`

Screenshots climate2 climate1

version 3 climate3 climate4

Browser

  • OS: Windows 10
  • Browser: Brave
  • Simple Thermostat version from browser console: 2.4.3
  • Home Assistant version: 2022.4.6

sharonna511 avatar Apr 30 '22 10:04 sharonna511

I would also like a way to hide the state text in brackets so the State only shows hvac_action.

vbtrek avatar May 24 '22 22:05 vbtrek

I stumbled upon this issue about state brackets, but as I did manage to find a solution, I'm sharing it here.

Version 3 seems to be the way...

- type: custom:simple-thermostat
  version: 3

So state entities shows like this: Screenshot 2022-06-08 at 09 40 27

For temperature unit, I did this:

sensors:
  - id: temperature
    label: '{{ui.currently}}'
    template: '{{current_temperature|formatNumber}} °C'

But also, I could split hvac mode & heater switch in two separate states, by adding my heater switch

sensors:
  - label: Heater
    entity: switch.ab_heater

And my card shows now like this: Screenshot 2022-06-08 at 09 54 14

Version 3 is documented here: https://github.com/nervetattoo/simple-thermostat/blob/master/examples/sensors.md

alinefr avatar Jun 08 '22 13:06 alinefr

Just one more thing. If instead of hvac mode you want hvac action...

 - id: state
   template: '{{hvac_action}}'
   label: '{{ui.operation}}'

alinefr avatar Jun 08 '22 13:06 alinefr

Using version 3 messes up the rest of my setup for example the sensor I have for my air purifier just states On/Off instead of air quality number. Looks like it disregards attribute.

Code:

    sensors:
      - entity: fan.levoit
        attribute: air_quality
        name: Air Quality

Ali229 avatar Jun 29 '22 12:06 Ali229

Using version 3 messes up the rest of my setup for example the sensor I have for my air purifier just states On/Off instead of air quality number. Looks like it disregards attribute.

Code:

    sensors:
      - entity: fan.levoit
        attribute: air_quality
        name: Air Quality

I don't have one of those, but I would try something like

sensors:
  - entity: fan.levoit
    label: Air Quality
    template: '{{air_quality}}'

alinefr avatar Jun 29 '22 13:06 alinefr

That works perfectly, sorry but I have another question, my motion detector with v3 shows on/off instead of detected/clear. So I created this template:

{% if is_state("binary_sensor.upstairs_occupancy", "on") -%}
  Detected
{%- else -%}
  Clear
{%- endif %}

How do I include this as template similar to how you did template: '{{air_quality}}' or is creating a new template sensor the only option?

Ali229 avatar Jun 29 '22 15:06 Ali229

I don't think there is a way to map output values. A template sensor seems to be the way to go.

alinefr avatar Jun 29 '22 20:06 alinefr

That works perfectly, sorry but I have another question, my motion detector with v3 shows on/off instead of detected/clear. So I created this template:

{% if is_state("binary_sensor.upstairs_occupancy", "on") -%}
  Detected
{%- else -%}
  Clear
{%- endif %}

How do I include this as template similar to how you did template: '{{air_quality}}' or is creating a new template sensor the only option?

how does look your complete card with this if command? - Or do you have create a real template in config.yaml?

duczz avatar Dec 17 '23 10:12 duczz